/* Cóndor Blanco · pré-check-in e "Mi ficha"
   Mobile-first. Sem fontes externas (CSP style-src 'self'). Contrastes conferidos para WCAG AA. */

:root {
  --bg: #FFFFFF;
  --surface: #FAF7EF;
  --gold: #A8822E;          /* decorativo / elementos de UI (>= 3:1 sobre branco) */
  --gold-dark: #7A5C17;     /* texto dourado (>= 5:1 sobre branco) */
  --gold-soft: #F3E9D2;
  --green: #3F6B4F;         /* botão primário, texto branco = 6:1 */
  --green-dark: #2F4A38;
  --green-soft: #E4EEE6;
  --text: #2B2B26;
  --muted: #5E5E55;
  --border: #E2DCCB;        /* divisórias suaves (não usar em controles) */
  --border-control: #8A8670; /* bordas de campos (>= 3:1) */
  --error: #A33A2A;
  --error-soft: #FBEAE6;
  --footer: #2F4A38;
  --focus: #2F4A38;
  --radius: 10px;
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.cargando main, body.cargando .pie { visibility: hidden; }

.contenedor { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding-bottom: 40px; }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.saltar {
  position: absolute; left: 8px; top: -60px; background: var(--green-dark); color: #fff;
  padding: 10px 14px; border-radius: 0 0 var(--radius) var(--radius); z-index: 10;
}
.saltar:focus { top: 0; }

/* Foco visível em tudo que é interativo */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
.btn-archivo:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Cabeçalho ---------- */
.cabecera { padding: 20px 0 8px; text-align: center; }
.cabecera .contenedor { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo { width: 160px; height: auto; display: block; }
.idiomas { display: flex; gap: 6px; }
.idiomas button {
  min-width: var(--tap); min-height: 44px; padding: 0 12px;
  border: 1px solid var(--border-control); background: #fff; color: var(--text);
  border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
}
.idiomas button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Tipografia ---------- */
h1 { font-size: 1.5rem; line-height: 1.25; margin: 16px 0 8px; font-weight: 650; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 8px 0 12px; font-weight: 650; }
h3 { font-size: 1.1rem; line-height: 1.35; margin: 20px 0 8px; font-weight: 650; }
h4 { font-size: 1rem; margin: 14px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--green-dark); text-underline-offset: 2px; }
.intro { color: var(--muted); }

/* ---------- Progresso ---------- */
.progreso { margin: 12px 0 20px; }
.progreso progress {
  width: 100%; height: 8px; display: block; border: 0; border-radius: 4px;
  background: var(--gold-soft); appearance: none; -webkit-appearance: none; overflow: hidden;
}
.progreso progress::-webkit-progress-bar { background: var(--gold-soft); }
.progreso progress::-webkit-progress-value { background: var(--green); }
.progreso progress::-moz-progress-bar { background: var(--green); }
.progreso ol { list-style: none; display: flex; gap: 4px; margin: 10px 0 0; padding: 0; }
.progreso li { flex: 1; text-align: center; font-size: 0.8125rem; color: var(--muted); min-width: 0; }
.progreso .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-control);
  background: #fff; font-weight: 700; color: var(--text);
}
.progreso .nombre { display: none; margin-top: 4px; overflow-wrap: anywhere; }
.progreso li[aria-current="step"] .nombre { display: block; color: var(--text); font-weight: 650; }
.progreso li[aria-current="step"] .num { background: var(--green); border-color: var(--green); color: #fff; }
.progreso li.hecho .num { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.progreso .paso-actual { text-align: center; margin: 8px 0 0; font-weight: 650; }
@media (min-width: 640px) {
  .progreso .nombre { display: block; }
  .progreso .paso-actual { display: none; }
}

/* ---------- Campos ---------- */
.campo, fieldset.campo { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.campo > label, fieldset.campo > legend, .etiqueta {
  display: block; font-weight: 650; margin-bottom: 6px; padding: 0;
}
fieldset.campo > legend { float: left; width: 100%; }
fieldset.campo > legend + * { clear: both; }
.req { color: var(--error); margin-left: 2px; }
.ayuda { color: var(--muted); font-size: 0.9375rem; margin: 0 0 8px; }

input[type="text"], input[type="email"], input[type="date"], input[type="tel"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  font: inherit; color: var(--text); background: #fff;
  border: 1.5px solid var(--border-control); border-radius: var(--radius);
}
textarea { min-height: 96px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--error); border-width: 2px;
}
input[readonly] { background: var(--surface); }

.opciones { display: flex; flex-direction: column; gap: 8px; }
.opcion {
  display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap);
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fff; cursor: pointer; font-weight: 400;
}
.opcion:hover { background: var(--surface); }
.opcion:has(input:checked) { background: var(--green-soft); border-color: var(--green); }
.opcion input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--green); }
.opcion .detalle { display: block; color: var(--muted); font-size: 0.9375rem; }
.opcion-caja { background: var(--surface); }
.outra { margin: 8px 0 0 4px; }

.grupo-exp { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.grupo-exp > legend { font-weight: 650; color: var(--gold-dark); padding: 0; margin: 0 0 8px; }

.error {
  color: var(--error); font-weight: 600; font-size: 0.9375rem; margin: 6px 0 0;
}
.error::before { content: "\26A0\FE0E  "; }

.aviso {
  background: var(--gold-soft); border-left: 4px solid var(--gold);
  padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 20px;
  font-size: 0.9688rem;
}
.aviso.info { background: var(--green-soft); border-left-color: var(--green); }
.aviso.peligro { background: var(--error-soft); border-left-color: var(--error); }
.aviso p:last-child { margin-bottom: 0; }

.fecha-calculada {
  margin: 0; padding: 10px 12px; background: var(--surface);
  border: 1.5px dashed var(--border-control); border-radius: var(--radius);
}
.fecha-calculada strong { font-size: 1.125rem; }

.texto-scroll {
  max-height: 280px; overflow-y: auto; padding: 12px 14px; margin: 0 0 12px;
  background: var(--surface); border: 1.5px solid var(--border-control); border-radius: var(--radius);
  font-size: 0.9688rem;
}
.texto-scroll.libre { max-height: none; overflow: visible; }
.texto-scroll ol, .texto-scroll ul { padding-left: 22px; margin: 0 0 12px; }
.texto-scroll h3, .texto-scroll h4 { margin-top: 12px; }
.doc-titulo { margin-top: 24px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px; font: inherit; font-weight: 650;
  border-radius: var(--radius); border: 2px solid var(--green);
  background: var(--green); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--green-dark); }
.btn.sec:hover { background: var(--green-soft); }
.btn.peligro { background: #fff; color: var(--error); border-color: var(--error); }
.btn.peligro:hover { background: var(--error-soft); }
.btn.enlace {
  background: none; border: 0; color: var(--green-dark); text-decoration: underline;
  min-height: 44px; padding: 8px 4px; font-weight: 600;
}
.btn-archivo { position: relative; }
.btn-archivo input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.navegacion {
  display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 28px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.navegacion .btn { width: 100%; }
@media (min-width: 480px) {
  .navegacion { flex-direction: row; justify-content: space-between; }
  .navegacion .btn { width: auto; min-width: 140px; }
}

/* ---------- Mensagens globais ---------- */
.mensaje { margin: 0 0 16px; }
.mensaje:empty { display: none; }
.mensaje .aviso { margin-bottom: 0; }

/* ---------- Resumo ---------- */
.resumen-seccion { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 14px; background: #fff; }
.resumen-seccion header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 12px; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
}
.resumen-seccion h3 { margin: 8px 0; font-size: 1.0rem; }
.resumen-seccion dl { margin: 0; padding: 8px 12px 12px; }
.resumen-seccion dt { font-weight: 650; font-size: 0.9375rem; color: var(--muted); margin-top: 10px; }
.resumen-seccion dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.turnstile { margin: 16px 0; min-height: 65px; }

/* ---------- Sucesso / portal ---------- */
.exito { text-align: center; padding: 24px 0; }
.exito .marca {
  display: inline-flex; width: 56px; height: 56px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--green-dark); font-size: 1.75rem; font-weight: 700; margin-bottom: 8px;
}
.ref { display: inline-block; padding: 4px 12px; background: var(--gold-soft); border-radius: var(--radius); font-weight: 700; letter-spacing: 0.04em; }

.tarjetas { display: grid; gap: 12px; margin: 16px 0; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tarjetas { grid-template-columns: 1fr 1fr; } }
.tarjeta { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fff; }
.tarjeta.ancha { grid-column: 1 / -1; }
.tarjeta h3 { margin: 0 0 6px; font-size: 1rem; }
.tarjeta p { margin: 0 0 8px; }
.estado { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.875rem; font-weight: 700; }
.estado.ok { background: var(--green-soft); color: var(--green-dark); }
.estado.pendiente { background: var(--gold-soft); color: var(--gold-dark); }
.estado.error { background: var(--error-soft); color: var(--error); }
.tarjeta progress { width: 100%; height: 10px; }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }

dialog {
  max-width: 520px; width: calc(100% - 32px); border: 0; border-radius: var(--radius);
  padding: 20px; color: var(--text); background: #fff;
}
dialog::backdrop { background: rgba(43, 43, 38, 0.55); }
dialog .acciones { justify-content: flex-end; }

/* ---------- Rodapé (única cor forte) ---------- */
.pie { background: var(--footer); color: #fff; padding: 24px 0; font-size: 0.9375rem; }
.pie a { color: #fff; }
.pie p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

fieldset.invalido { border-left: 4px solid var(--error); padding-left: 10px; }
