/* ============================================================
   AEROLÍNEA — sistema visual neumórfico
   Paleta: fondo blanco/nube, relieves suaves, sin iconografía.
   Tipografía: Space Grotesk (display) + Inter (texto).
   Mobile-first, escalable a escritorio.
   ============================================================ */

:root {
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --shadow-light: #FFFFFF;
  --shadow-dark: #C9D6E3;
  --text: #1F2A37;
  --text-muted: #5B6B7C;
  --accent: #163B54;
  --accent-soft: #3E7C94;
  --accent-contrast: #FFFFFF;
  --danger: #A3312A;
  --success: #1E6B4C;
  --border-radius-lg: 22px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--accent);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.8rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-2); color: var(--text-muted); }

a { color: var(--accent-soft); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

img, svg { max-width: 100%; display: block; }

/* --- Foco visible para accesibilidad de teclado --- */
:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

/* --- Layout general --- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

/* --- Barra superior --- */
.topbar {
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(22, 59, 84, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  margin-right: 8px;
  vertical-align: middle;
}

nav.main-nav { display: none; }
nav.main-nav.open { display: block; }

@media (min-width: 860px) {
  nav.main-nav { display: flex; gap: var(--space-3); align-items: center; }
}

.nav-toggle {
  display: inline-flex;
  background: var(--surface);
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
@media (min-width: 860px) { .nav-toggle { display: none; } }

.nav-link {
  display: block;
  padding: var(--space-1) 0;
  color: var(--text);
  font-weight: 500;
}
.nav-link.current { color: var(--accent-soft); font-weight: 700; }

/* --- Superficies neumórficas --- */
.card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
  padding: var(--space-3);
}

.card-inset {
  background: var(--bg);
  border-radius: var(--border-radius-md);
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  padding: var(--space-2);
}

.panel-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .panel-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .panel-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- Botones --- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
  transition: box-shadow 0.15s ease, transform 0.05s ease;
  width: 100%;
}
@media (min-width: 540px) { .btn { width: auto; } }

.btn:hover { box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light); }
.btn:active { box-shadow: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light); transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 6px 6px 14px rgba(22,59,84,0.35), -6px -6px 14px rgba(255,255,255,0.4); }
.btn-primary:hover { box-shadow: 3px 3px 8px rgba(22,59,84,0.35), -3px -3px 8px rgba(255,255,255,0.4); }

.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

/* --- Formularios --- */
.field { margin-bottom: var(--space-2); }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text);
}
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="tel"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--border-radius-md);
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); outline-offset: 1px; }

fieldset { border: none; padding: 0; margin: 0 0 var(--space-2); }
legend { font-family: var(--font-display); font-weight: 700; color: var(--accent); margin-bottom: var(--space-1); padding: 0; }

/* --- Mensajes / alertas --- */
.alert {
  border-radius: var(--border-radius-md);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  font-weight: 500;
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}
.alert-error { background: #FBEAE9; color: var(--danger); }
.alert-success { background: #E7F5EE; color: var(--success); }
.alert-info { background: #EAF2F7; color: var(--accent); }

/* --- Tablas responsivas (para admin e historial) --- */
.table-wrap { overflow-x: auto; border-radius: var(--border-radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid #E3EAF1; font-size: 0.9rem; }
th { color: var(--accent); font-family: var(--font-display); font-weight: 700; }

/* --- Insignias de estado --- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-scheduled { background: #EAF2F7; color: var(--accent-soft); }
.badge-confirmed { background: #E7F5EE; color: var(--success); }
.badge-cancelled { background: #FBEAE9; color: var(--danger); }
.badge-pending { background: #FFF4E0; color: #8A5A00; }

/* --- Elemento firma: línea de ruta de vuelo (divisor minimalista) --- */
.flight-path-divider {
  width: 100%;
  height: 28px;
  margin: var(--space-3) 0;
  opacity: 0.55;
}

/* --- Hero de inicio --- */
.hero {
  padding: var(--space-4) 0 var(--space-3);
  text-align: left;
}
.hero .lead { font-size: 1.05rem; max-width: 46ch; }

/* --- Footer --- */
footer.site-footer {
  margin-top: auto;
  padding: var(--space-3) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* --- Utilidades --- */
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); }
.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --- Modo alto contraste opcional (accesibilidad) --- */
body.high-contrast {
  --bg: #FFFFFF; --surface: #FFFFFF; --text: #000000; --text-muted: #222222;
  --shadow-dark: #999999; --shadow-light: #FFFFFF; --accent: #001F33;
}
body.large-text { font-size: 19px; }

/* --- Aviso de expiración de sesión --- */
#session-warning {
  position: fixed; bottom: var(--space-2); right: var(--space-2); left: var(--space-2);
  max-width: 420px; margin: 0 auto; z-index: 200; display: none;
}
@media (min-width: 540px) { #session-warning { left: auto; } }
