/* ── Formulario online de autorización de menores de 12 años ───── */

.menores-form-card {
  margin-top: 28px;
  padding: 26px 24px;
  border-radius: 18px;
  border: 1px solid rgba(0, 52, 113, 0.1);
  background: linear-gradient(135deg, rgba(0, 167, 209, 0.04), rgba(0, 52, 113, 0.03));
}

.menores-form-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.menores-form-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #003471, #00a7d1);
  color: #fff;
  font-size: 21px;
}

.menores-form-head h2 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.menores-form-head p {
  margin: 0;
  font-size: 13.5px;
  color: #536471;
  line-height: 1.6;
}

.menores-form-step {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  min-width: 0;
  border: 1px solid rgba(0, 52, 113, 0.08);
  border-radius: 14px;
  background: var(--card, #fff);
}

.menores-form-step.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.menores-form-step legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #003471);
}

.menores-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 167, 209, 0.14);
  color: #003471;
  font-size: 12px;
  font-weight: 800;
}

.menores-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.menores-choice {
  position: relative;
  cursor: pointer;
}

.menores-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menores-choice-body {
  display: grid;
  align-content: start;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border, #e3eaf5);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.menores-choice:hover .menores-choice-body {
  border-color: rgba(0, 167, 209, 0.45);
}

.menores-choice input:focus-visible + .menores-choice-body {
  box-shadow: 0 0 0 3px rgba(0, 52, 113, 0.18);
}

.menores-choice input:checked + .menores-choice-body {
  border-color: #00a7d1;
  background: rgba(0, 167, 209, 0.07);
  box-shadow: 0 0 0 1px #00a7d1;
}

.menores-choice-code {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #003471, #00a7d1);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.menores-choice-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text, #0f172a);
}

.menores-choice-title i {
  color: #00a7d1;
}

.menores-choice-desc {
  font-size: 12.5px;
  color: var(--muted, #516072);
}

/* Los datos se imprimen en mayúsculas en el PDF: se muestran igual al escribir. */
.menores-form input[type="text"],
.menores-form input[type="tel"] {
  text-transform: uppercase;
}

.menores-form input::placeholder {
  text-transform: none;
  opacity: 0.6;
}

/* Que el aviso de error no desplace el campo de al lado en las filas de dos columnas. */
.menores-form .form-field {
  align-content: start;
}

.menores-field-error {
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

:root[data-theme="dark"] .menores-field-error {
  color: #fb7185;
}

.menores-form input.is-invalid,
.menores-form select.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.menores-signature {
  position: relative;
  height: 180px;
  border: 1.5px dashed rgba(0, 52, 113, 0.3);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.menores-signature.is-invalid {
  border-color: #dc2626;
  border-style: solid;
}

.menores-signature canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.menores-signature-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  color: rgba(15, 23, 42, 0.35);
  font-size: 14px;
  pointer-events: none;
}

.menores-signature.has-signature .menores-signature-hint {
  display: none;
}

.menores-signature-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(0, 52, 113, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #003471;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.menores-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.menores-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.menores-form-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  max-width: 420px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--muted, #516072);
  line-height: 1.45;
}

.menores-form-preview i {
  font-size: 18px;
  color: #d93025;
}

.menores-form-card .menores-download-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

#msgMenores p {
  margin: 0 0 10px;
}

.menores-result-btn {
  display: inline-flex;
  gap: 8px;
}

@media (max-width: 640px) {
  .menores-form-card {
    padding: 20px 14px;
  }

  .menores-form-step {
    padding: 14px 12px;
  }

  .menores-choice-grid,
  .menores-form .info-form-2col {
    grid-template-columns: 1fr;
  }

  .menores-form-actions .menores-download-btn {
    width: 100%;
    justify-content: center;
  }
}

:root[data-theme="dark"] .menores-form-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .menores-form-step {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .menores-form-head p,
:root[data-theme="dark"] .menores-choice-desc,
:root[data-theme="dark"] .menores-form-preview {
  color: #8899a6;
}

:root[data-theme="dark"] .menores-form-step legend,
:root[data-theme="dark"] .menores-step-num {
  color: #7eb8e8;
}

:root[data-theme="dark"] .menores-choice-body {
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .menores-choice-title {
  color: #e2e8f0;
}

/* La zona de firma se mantiene blanca (como el papel) también en modo oscuro. */
:root[data-theme="dark"] .menores-signature {
  border-color: rgba(126, 184, 232, 0.4);
}

/* Asterisco de obligatorio en el título de un paso (mismo estilo que label.is-req). */
.menores-req {
  margin-left: -4px;
  color: #e53e3e;
  font-weight: 700;
}

/* El formulario es ahora el primer bloque del contenido. */
.info-content > .menores-form-card:first-child {
  margin-top: 0;
}

/* Badges de líneas dentro de la selección de red. */
.menores-choice-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.menores-choice-lines .line-pill {
  gap: 6px;
  padding: 4px 11px;
  font-size: 12px;
}

/* ── Modal de vista previa del PDF ─────────────────────────────── */

html.menores-modal-open {
  overflow: hidden;
}

.menores-preview-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--card, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.menores-preview-modal[open] {
  display: flex;
  flex-direction: column;
}

.menores-preview-modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.menores-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e3eaf5);
}

.menores-preview-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.menores-preview-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, #516072);
}

.menores-preview-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border, #e3eaf5);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
}

.menores-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #e9eef5;
}

.menores-preview-pages {
  display: grid;
  gap: 12px;
}

.menores-preview-page {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
}

.menores-preview-frame {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: 4px;
  background: #fff;
}

.menores-preview-open {
  justify-self: center;
  font-size: 13px;
  font-weight: 600;
}

.menores-preview-loading {
  margin: 40px 0;
  text-align: center;
  color: #516072;
  font-weight: 600;
}

.menores-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e3eaf5);
}

.menores-preview-modal.is-busy .menores-preview-actions [data-action="confirm"] {
  cursor: wait;
}

@media (max-width: 640px) {
  .menores-preview-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .menores-preview-body {
    padding: 10px;
  }

  .menores-preview-actions .btn {
    flex: 1 1 100%;
  }
}

:root[data-theme="dark"] .menores-preview-modal {
  background: #0f172a;
  color: #e2e8f0;
}

:root[data-theme="dark"] .menores-preview-head,
:root[data-theme="dark"] .menores-preview-actions,
:root[data-theme="dark"] .menores-preview-close {
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .menores-preview-head p {
  color: #8899a6;
}

:root[data-theme="dark"] .menores-preview-body {
  background: #1e293b;
}
