/* CESER Consulta de Servicio. Todo va prefijado con .ceser-cq para no chocar con el tema. */
:root {
  --ceser-accent: #1d4ed8;
}

.ceser-cq,
.ceser-cq-modal,
.ceser-cq-fab,
.ceser-cq-button {
  --ceser-text: #0f172a;
  --ceser-muted: #64748b;
  --ceser-border: #e2e8f0;
  --ceser-surface: #ffffff;
  --ceser-soft: #f1f5f9;
  --ceser-danger: #b91c1c;
  font-family: inherit;
  box-sizing: border-box;
}

.ceser-cq *,
.ceser-cq-modal * {
  box-sizing: border-box;
}

/* ---------- Formulario ---------- */
.ceser-cq {
  color: var(--ceser-text);
  max-width: 420px;
}

.ceser-cq--inline {
  padding: 20px;
  border: 1px solid var(--ceser-border);
  border-radius: 16px;
  background: var(--ceser-surface);
}

.ceser-cq__intro {
  margin: 0 0 14px;
  color: var(--ceser-muted);
  font-size: 14px;
  line-height: 1.4;
}

/* Tipo de documento: tres opciones en una sola barra */
.ceser-cq__types {
  display: flex;
  gap: 2px;
  margin: 0 0 12px;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: var(--ceser-soft);
}

.ceser-cq__type {
  flex: 1;
  margin: 0;
  cursor: pointer;
}

.ceser-cq__type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ceser-cq__type span {
  display: block;
  padding: 7px 0;
  border-radius: 8px;
  color: var(--ceser-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.ceser-cq__type input:checked + span {
  background: #fff;
  color: var(--ceser-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.ceser-cq__type input:focus-visible + span {
  outline: 2px solid var(--ceser-accent);
  outline-offset: 1px;
}

.ceser-cq__field {
  display: block;
  margin: 0;
}

.ceser-cq__field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ceser-cq__field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--ceser-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ceser-text);
  font: inherit;
  font-size: 16px; /* evita el zoom automático en iPhone */
  letter-spacing: 0.02em;
}

.ceser-cq__field input::placeholder {
  color: #94a3b8;
}

.ceser-cq__field input:focus {
  outline: 2px solid color-mix(in srgb, var(--ceser-accent) 35%, transparent);
  outline-offset: 0;
  border-color: var(--ceser-accent);
}

.ceser-cq__field input[aria-invalid='true'] {
  border-color: var(--ceser-danger);
}

.ceser-cq__error {
  margin: 8px 0 0;
  color: var(--ceser-danger);
  font-size: 13px;
}

.ceser-cq__submit,
.ceser-cq-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--ceser-accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.ceser-cq__submit {
  width: 100%;
  margin-top: 12px;
}

.ceser-cq__submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.ceser-cq__submit:hover,
.ceser-cq-button:hover {
  filter: brightness(1.1);
}

/* ---------- Resultados ---------- */
.ceser-cq__results:not(:empty) {
  margin-top: 16px;
}

.ceser-cq__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ceser-cq__card {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ceser-soft);
}

.ceser-cq__card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ceser-cq__number {
  font-weight: 700;
  font-size: 14px;
}

.ceser-cq__badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.ceser-cq__badge--info { background: #dbeafe; color: #1e40af; }
.ceser-cq__badge--warning { background: #fef3c7; color: #92400e; }
.ceser-cq__badge--success { background: #dcfce7; color: #166534; }
.ceser-cq__badge--neutral { background: #e2e8f0; color: #334155; }

.ceser-cq__equipment {
  margin: 8px 0 2px;
  font-size: 14px;
  font-weight: 600;
}

.ceser-cq__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.ceser-cq__meta,
.ceser-cq__contact {
  margin: 6px 0 0;
  color: var(--ceser-muted);
  font-size: 12px;
}

.ceser-cq__contact {
  margin-top: 12px;
}

.ceser-cq__empty {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ceser-soft);
  font-size: 14px;
}

.ceser-cq__empty p {
  margin: 4px 0 0;
  color: var(--ceser-muted);
}

/* ---------- Botón del menú (junto a "Contacto") ---------- */
a[href='#estado-servicio'],
.ceser-cq-menu-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  /* Altura propia y centrada: en menús de Elementor el enlace se estira hasta el borde de la cabecera */
  align-self: center !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 4px !important;
  padding: 6px 14px !important;
  text-transform: none !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--ceser-accent) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s;
}

a[href='#estado-servicio']:hover,
.ceser-cq-menu-btn:hover {
  filter: brightness(1.12);
}

.ceser-cq-menu-btn svg {
  flex: none;
}

/* ---------- Botón flotante (opcional) ---------- */
.ceser-cq-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99998;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--ceser-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.ceser-cq-fab:hover {
  filter: brightness(1.1);
}

.ceser-cq-fab:focus-visible,
.ceser-cq-button:focus-visible,
.ceser-cq__submit:focus-visible,
.ceser-cq-menu-btn:focus-visible,
a[href='#estado-servicio']:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

/* ---------- Ventana ---------- */
.ceser-cq-lock {
  overflow: hidden;
}

.ceser-cq-modal[hidden] {
  display: none;
}

.ceser-cq-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ceser-cq-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ceser-cq-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  background: var(--ceser-surface);
  color: var(--ceser-text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  animation: ceser-cq-in 0.18s ease-out;
}

@keyframes ceser-cq-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.ceser-cq-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ceser-cq-modal__header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ceser-text);
}

.ceser-cq-modal__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ceser-muted);
  cursor: pointer;
}

.ceser-cq-modal__close:hover {
  background: var(--ceser-soft);
  color: var(--ceser-text);
}

.ceser-cq-modal .ceser-cq {
  max-width: none;
}

@media (max-width: 480px) {
  .ceser-cq-fab {
    right: 12px;
    bottom: 12px;
  }

  .ceser-cq-modal {
    place-items: end stretch;
    padding: 0;
  }

  .ceser-cq-modal__dialog {
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ceser-cq-modal__dialog {
    animation: none;
  }
}
