/* =========================================================
   Apostilla / Legalización
   ========================================================= */

:root {
  --azul: #004884;
  --azul-titulo: #0b3f73;
  --azul-label: #1d4f7c;
  --azul-link: #3366cc;
  --texto: #18375a;
  --gris: #5a6b7d;
  --select-bg: #e5eefb;
  --borde: #d9d9d9;
  --rojo: #d40000;
  --verde: #068460;
  --amarillo-co: #fcd116;
  --azul-co: #003893;
  --rojo-co: #ce1126;
  --boton: linear-gradient(135deg, #0b7cf2 0%, #0559c4 55%, #003c7e 100%);
  --fuente: "Work Sans", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--azul-link); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid rgba(51, 102, 204, .55); outline-offset: 2px; }

/* ---------- Cabecera ---------- */
.cabecera { position: sticky; top: 0; z-index: 30; }

.topbar {
  background: linear-gradient(90deg, #fff 0%, #fff 50%, #ededed 100%);
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .22);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 40px 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
}

.marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}

.escudo { width: 30px; height: 36px; margin-bottom: 1px; }

.wordmark {
  font-size: 19px;
  font-weight: 600;
  color: #21364f;
  letter-spacing: -.2px;
  line-height: 1.05;
}

.tricolor { display: flex; width: 30px; height: 3px; margin-top: 4px; margin-left: 6px; }
.tricolor i { flex: 2; background: var(--amarillo-co); }
.tricolor i:nth-child(2) { flex: 1; background: var(--azul-co); }
.tricolor i:nth-child(3) { flex: 1; background: var(--rojo-co); }

.app-title {
  grid-column: 1 / -1;
  margin: 6px 0 0 92px;
  font-size: 15px;
  font-weight: 700;
  color: var(--azul-titulo);
  line-height: 1.55;
  letter-spacing: .2px;
}

@media (min-width: 720px) {
  .app-title {
    grid-column: 2;
    margin: 0 0 6px 22px;
    padding-left: 20px;
    border-left: 1px solid #d5d5d5;
    font-size: 18px;
  }
  .app-title br { display: none; }
}

/* ---------- Contenido ---------- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px 40px;
}

.page-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  font-size: 27px;
  color: #14365a;
  margin: 10px 0 4px;
  outline: none;
}
.page-title.centrado { text-align: center; }

.page-sub {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--azul);
  letter-spacing: .3px;
}

.obligatorios {
  margin: 2px 0 10px;
  text-align: right;
  font-size: 13px;
  color: #555;
}
.obligatorios span, .req { color: var(--rojo); }

.sep { border: 0; border-top: 2px solid #cfcfcf; margin: 0 0 22px; }
.sep-claro { border-top-width: 1px; border-color: #dcdcdc; margin: 26px 0 22px; }

.info-box {
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  padding: 16px 22px 16px 30px;
  margin: 18px 0;
  font-size: 15px;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
}
.info-box p { margin: 0; }
.info-box p + p { margin-top: 18px; }

.url-larga { display: block; font-weight: 700; word-break: break-all; text-decoration: none; text-align: left; }

.section-title {
  margin: 30px 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--azul-titulo);
}
.section-title.grande { font-size: 23px; margin-top: 18px; }

/* ---------- Campos ---------- */
.field { margin: 0 0 14px; scroll-margin-top: 150px; }

.field label,
.field .label {
  display: block;
  margin: 14px 0 8px;
  font-size: 15.5px;
  color: var(--azul-label);
  letter-spacing: .3px;
}

.select-wrap { position: relative; width: 100%; max-width: 620px; }
.select-wrap.corto { max-width: 370px; flex: 1; }

.select-wrap select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 46px;
  padding: 0 54px 0 14px;
  border: 0;
  border-bottom: 2.5px solid var(--azul);
  border-radius: 6px 6px 3px 3px;
  background: var(--select-bg);
  color: #0f2c4f;
  font: inherit;
  font-size: 15.5px;
  letter-spacing: .4px;
  cursor: pointer;
  text-overflow: ellipsis;
}
.select-wrap.negrita select { font-weight: 700; }

.sel-arrow {
  position: absolute;
  right: 5px; top: 50%;
  width: 36px; height: 36px;
  transform: translateY(-50%);
  background: var(--azul);
  border-radius: 4px;
  pointer-events: none;
}
.sel-arrow::after {
  content: "";
  position: absolute;
  left: 50%; top: 42%;
  width: 12px; height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.input {
  display: block;
  width: 100%;
  max-width: 660px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #b9cbe6;
  border-bottom: 2.5px solid var(--azul);
  border-radius: 10px 10px 4px 4px;
  background: var(--select-bg);
  color: #0f2c4f;
  font: inherit;
  font-size: 16px;
}

.fila-pais { display: flex; align-items: center; gap: clamp(16px, 8vw, 44px); }
.fila-dos { display: flex; flex-wrap: wrap; gap: 0 26px; }
.fila-dos .field { flex: 1 1 150px; }
.fila-dos .input { max-width: none; }

.btn-info {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2.5px solid var(--azul-titulo);
  background: #fff;
  color: var(--azul-titulo);
  font: italic 700 22px/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.btn-info:hover { background: #eef4fd; }

.campo-tramite .label { margin-top: 4px; }
.tramite-valor {
  min-height: 28px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--azul-titulo);
  letter-spacing: .6px;
}
.tramite-nota { margin: 0; font-size: 13.5px; color: var(--gris); }

.campo-ayuda { margin: 6px 2px 0; font-size: 13px; color: var(--gris); }

/* Errores */
.error-msg {
  display: none;
  margin: 7px 0 0;
  font-size: 14px;
  color: #c40000;
}
.error-msg::before { content: "⚠ "; }
.field.invalido .error-msg { display: block; }
.field.invalido .select-wrap select,
.field.invalido .input { background: #fdecec; border-bottom-color: #c40000; }
.field.invalido .check .box { border-color: #c40000; box-shadow: 0 0 0 4px rgba(196, 0, 0, .15); }

/* ---------- Aviso de privacidad ---------- */
.privacidad {
  font-size: 14.5px;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
  color: #1f2f40;
}
.privacidad p { margin: 0 0 10px; }
.nota-sim { font-style: italic; color: var(--gris); }

.check { display: block; margin: 26px 0 0; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  position: relative;
  display: block;
  width: 26px; height: 26px;
  margin-bottom: 18px;
  border: 3px solid var(--azul);
  border-radius: 7px;
  transition: background .15s;
}
.check input:checked + .box { background: var(--azul); }
.check input:checked + .box::after {
  content: "";
  position: absolute;
  left: 6px; top: 1px;
  width: 7px; height: 13px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.check input:focus-visible + .box { outline: 3px solid rgba(51, 102, 204, .55); outline-offset: 3px; }
.check .txt {
  display: block;
  font-size: 17px;
  line-height: 1.65;
  color: var(--azul-label);
  letter-spacing: .2px;
}

/* ---------- Botones ---------- */
.acciones { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 110px;
  padding: 13px 24px;
  border: 0;
  border-radius: 12px;
  background: var(--boton);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { color: #4f8ee8; cursor: not-allowed; filter: none; transform: none; }
.btn.cargando:disabled { color: #fff; opacity: .85; cursor: progress; }
.btn.pequeno { font-size: 15px; padding: 10px 16px; min-width: 0; }
.btn.secundario { background: #fff; color: var(--azul); box-shadow: inset 0 0 0 2px var(--azul); }

.btn-link {
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--azul-link);
  font: inherit;
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.enlace-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--azul-link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.spinner {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Carga de archivo ---------- */
.upload-box {
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  padding: 18px 14px 20px;
  margin: 22px 0;
}
.upload-box h4 {
  margin: 4px 0 22px 0;
  font-size: 17px;
  font-weight: 400;
  color: var(--azul-label);
  letter-spacing: .3px;
}

.file-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b7cf2 0%, #0559c4 55%, #003c7e 100%);
  overflow: hidden;
}
.file-btn {
  flex: none;
  padding: 7px 14px;
  border: 1px solid #c9c9c9;
  border-radius: 999px;
  background: #f3f3f3;
  color: #111;
  font: 700 15.5px/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.file-btn:hover { background: #fff; }
.file-pill:focus-within .file-btn { outline: 3px solid #fff; outline-offset: 2px; }
.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2a74e6;
  font: 15px Arial, Helvetica, sans-serif;
}
.file-pill.con-archivo .file-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}

@media (max-width: 480px) {
  .file-pill { padding: 6px 12px 6px 10px; gap: 10px; }
  .file-btn { padding: 7px 11px; font-size: 14.5px; }
}

.ayuda-ejemplo { margin: 12px 2px 0; font-size: 14px; color: var(--gris); }
.btn-agregar { margin-top: 20px; }

/* ---------- Tablas de documentos ---------- */
.tabla-docs {
  width: 100%;
  margin: 6px 0 10px;
  border-collapse: collapse;
  font-size: 14px;
}
.tabla-docs th {
  padding: 9px 10px;
  background: var(--azul);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.tabla-docs th:first-child { border-top-left-radius: 8px; }
.tabla-docs th:last-child { border-top-right-radius: 8px; }
.tabla-docs td {
  padding: 9px 10px;
  border-bottom: 1px solid #e1e6ec;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.tabla-docs tbody tr:nth-child(even) { background: #f5f8fc; }
.tabla-docs .peso { color: var(--gris); font-size: 12.5px; white-space: nowrap; }
.tabla-docs .valor { white-space: nowrap; font-weight: 600; }

.btn-eliminar {
  padding: 4px 10px;
  border: 1.5px solid #c40000;
  border-radius: 8px;
  background: #fff;
  color: #c40000;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-eliminar:hover { background: #fdecec; }

@media (max-width: 680px) {
  .tabla-docs thead { display: none; }
  .tabla-docs, .tabla-docs tbody, .tabla-docs tr, .tabla-docs td { display: block; width: 100%; }
  .tabla-docs tr {
    margin-bottom: 12px;
    padding: 6px 2px;
    border: 1.5px solid var(--borde);
    border-radius: 12px;
    background: #fff !important;
  }
  .tabla-docs td { display: flex; gap: 10px; padding: 4px 10px; border: 0; }
  .tabla-docs td::before {
    content: attr(data-label);
    flex: 0 0 100px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--azul-titulo);
  }
  .tabla-docs td[data-label=""]::before { content: none; }
}

/* ---------- Resumen y totales ---------- */
.resumen-datos {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 18px;
  font-size: 15px;
}
.resumen-datos dt { font-weight: 600; color: var(--azul-titulo); }
.resumen-datos dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 420px) {
  .resumen-datos { grid-template-columns: 1fr; gap: 2px; }
  .resumen-datos dd { margin-bottom: 8px; }
}

.total-box {
  margin: 14px 0 6px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--select-bg);
  font-size: 15px;
}
.total-box .linea { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.total-box .total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1.5px solid #c3d6ef;
  font-size: 19px;
  font-weight: 700;
  color: var(--azul-titulo);
}

/* ---------- Pago ---------- */
.pago-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--azul);
  color: #fff;
}
.pago-total span { font-size: 15px; }
.pago-total strong { font-size: 24px; }
.pago-desglose { margin: 8px 2px 0; font-size: 13.5px; color: var(--gris); }

.aviso-tarjeta {
  margin: 20px 0 6px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff7e6;
  border: 1.5px solid #f0d58a;
  font-size: 14.5px;
  line-height: 1.55;
}
.aviso-tarjeta div { margin-top: 12px; }

/* ---------- Confirmación ---------- */
.confirmacion { text-align: center; padding-top: 10px; }
.confirmacion p { margin: 6px 0; }
.check-ok {
  display: grid;
  place-items: center;
  width: 86px; height: 86px;
  margin: 10px auto 10px;
  border-radius: 50%;
  background: #e3f4ec;
}
.numero {
  display: inline-block;
  padding: 10px 18px;
  border: 2px dashed var(--azul);
  border-radius: 12px;
  background: var(--select-bg);
  color: var(--azul-titulo);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.c-detalle { color: var(--gris); font-size: 14px; }
.c-pago { font-size: 14.5px; color: var(--verde); font-weight: 600; }
.siguientes { margin: 8px 0 0; padding-left: 20px; text-align: left; }
.siguientes li { margin: 4px 0; }
#paso-6 .acciones { justify-content: center; }

/* ---------- Pie ---------- */
.pie {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px 40px;
  border-top: 1px solid #e3e3e3;
  font-size: 13px;
  color: var(--gris);
  text-align: center;
}

/* ---------- Ventana emergente ---------- */
dialog.modal {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--texto);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
dialog.modal::backdrop { background: rgba(10, 30, 60, .45); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 22px;
  background: var(--azul);
  color: #fff;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 22px 4px; font-size: 15px; line-height: 1.6; }
.modal-body p { margin: 0 0 10px; }
.modal-body ul, .modal-body ol { margin: 0 0 10px; padding-left: 20px; }
.modal-body li { margin: 5px 0; }
.modal-body .pequena { font-size: 13px; color: var(--gris); }
.modal-pie { padding: 10px 22px 20px; text-align: right; }

/* ---------- Mensaje flotante ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--azul-titulo);
  color: #fff;
  font-size: 14.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Confeti (colores de la bandera) ---------- */
.confeti { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.confeti i {
  position: absolute;
  top: -16px;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: caer linear forwards;
}
@keyframes caer { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Enlace volver al inicio ---------- */
.volver-inicio {
  display: inline-block;
  margin: 10px 0 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--azul-link);
  text-decoration: none;
}
.volver-inicio:hover { text-decoration: underline; }

/* ---------- Páginas de información (Pasaportes / Visas) ---------- */
.intro-serv {
  font-size: 15.5px;
  line-height: 1.65;
  color: #28415a;
  margin: 10px 0 4px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--select-bg);
  border: 1px solid #c3d6ef;
  color: var(--azul-titulo);
  font-size: 13.5px;
  font-weight: 600;
}

.tarjeta {
  border: 1.5px solid var(--borde);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 16px 0;
  background: #fff;
}
.tarjeta-cab {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tarjeta h3 {
  margin: 0;
  font-size: 19px;
  color: var(--azul-titulo);
}
.tarjeta .sub { margin: 2px 0 0; font-size: 13.5px; color: var(--gris); }
.tarjeta > p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.6; }

.precio-badge {
  flex: none;
  padding: 7px 13px;
  border-radius: 10px;
  background: #e3f4ec;
  color: #06663f;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.precio-badge.alt { background: var(--select-bg); color: var(--azul-titulo); }

.lista-req {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.lista-req li {
  position: relative;
  padding: 5px 0 5px 30px;
  font-size: 14.5px;
  line-height: 1.55;
  border-bottom: 1px solid #eef2f6;
}
.lista-req li:last-child { border-bottom: 0; }
.lista-req li::before {
  content: "";
  position: absolute;
  left: 4px; top: 10px;
  width: 11px; height: 7px;
  border: solid var(--verde);
  border-width: 0 0 3px 3px;
  transform: rotate(-45deg);
}

.acordeon {
  margin: 14px 0 0;
  border-top: 1px solid #e6ebf1;
  padding-top: 10px;
}
.acordeon summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--azul-link);
  list-style: none;
  padding: 4px 0;
}
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon summary::before { content: "▸ "; }
.acordeon[open] summary::before { content: "▾ "; }

.aviso {
  border: 1.5px solid #f0d58a;
  background: #fff7e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 24px 0 10px;
  font-size: 14px;
  line-height: 1.6;
}
.aviso strong { color: #8a6400; }

.cta-serv { margin: 22px 0 6px; }

/* ---------- Accesibilidad e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .acciones, .toast, .pie { display: none !important; }
  .cabecera { position: static; }
}
