/* FlightBro — public/css/app.css
 * Ported from Claude Design globals.css. Every class used anywhere in
 * the app is defined here; no Tailwind, no preprocessor.
 */

/* ─── Web fonts (Google Fonts) ─────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ─── Tokens ───────────────────────────────────────────────── */
:root {
  /* Sky / atmosphere */
  --sky-50: #F0F7FF;
  --sky-100: #DCEBFB;
  --sky-200: #BDD9F7;
  --sky-300: #8CBEF1;
  --sky-500: #3B82F6;
  --sky-600: #2563EB;

  /* Navy */
  --navy-900: #0B1B3B;
  --navy-700: #243B6B;
  --navy-500: #3F5A92;

  /* Surface */
  --cloud: #FAFBFD;
  --white: #FFFFFF;

  /* Accent (logo + severity) */
  --mustard: #F5C518;
  --tomato: #E84A3A;
  --tomato-dark: #C2382B;
  --runway-green: #22A06B;
  --runway-green-dark: #167A50;
  --amber: #F59E0B;

  /* Neutrals */
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-pill: 9999px;

  /* Shadows */
  --shadow-card:    0 1px 2px rgba(11,27,59,0.04), 0 4px 12px rgba(11,27,59,0.06);
  --shadow-card-hi: 0 2px 4px rgba(11,27,59,0.06), 0 12px 32px rgba(11,27,59,0.10);
  --shadow-board:   0 1px 0 rgba(11,27,59,0.04), 0 10px 30px rgba(11,27,59,0.10);
  --shadow-focus:   0 0 0 3px rgba(59,130,246,0.32);

  /* Type */
  --font-display: "Space Grotesk", "Inter", -apple-system, system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--cloud);
  color: var(--navy-900);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ─── Type utilities ───────────────────────────────────────── */
.tabular, .mono, .flight-num, .time { font-variant-numeric: tabular-nums; }
.mono    { font-family: var(--font-mono); }
.display { font-family: var(--font-display); letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
  font-weight: 500;
}

.text-slate  { color: var(--slate-500); }
.text-navy   { color: var(--navy-900); }
.text-tomato { color: var(--tomato); }
.text-green  { color: var(--runway-green); }
.text-amber  { color: var(--amber); }

/* ─── Status pill ──────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  line-height: 1;
  white-space: nowrap;
}
.pill--scheduled { background: var(--slate-500);    color: white; }
.pill--ontime    { background: var(--runway-green); color: white; }
.pill--delayed   { background: var(--amber);        color: var(--navy-900); }
.pill--boarding  { background: var(--sky-500);      color: white; }
.pill--active    { background: var(--navy-700);     color: white; }
.pill--diverted  { background: var(--tomato);       color: white; }
.pill--cancelled { background: var(--tomato);       color: white; }
.pill--landed    { background: var(--runway-green); color: white; }
.pill--pending   { background: var(--slate-200);    color: var(--navy-900); }
.pill--confirmed { background: #DCFCE7;             color: var(--runway-green-dark); }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0 16px;
  height: 44px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }

.btn--primary   { background: var(--navy-900);     color: white; }
.btn--primary:hover   { background: #061232; }
.btn--secondary { background: var(--cloud);        color: var(--navy-900); border-color: var(--navy-900); }
.btn--success   { background: var(--runway-green); color: white; }
.btn--danger    { background: var(--tomato);       color: white; }
.btn--ghost     { background: transparent;         color: var(--navy-700); }
.btn--ghost:hover { text-decoration: underline; }
.btn--sky       { background: var(--sky-500);      color: white; }
.btn--sky:hover { background: var(--sky-600); }

.btn--sm    { height: 36px; font-size: 14px; padding: 0 12px; }
.btn--block { width: 100%; }

/* ─── Form fields ──────────────────────────────────────────── */
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
  display: block;
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  background: var(--sky-50);
  color: var(--navy-900);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  height: 44px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 100ms ease, box-shadow 100ms ease;
}
.field-input:focus { border-color: var(--navy-700); box-shadow: var(--shadow-focus); }
.field-input::placeholder { color: var(--slate-400); }
.field-input--textarea { height: auto; padding-top: 10px; padding-bottom: 10px; resize: vertical; min-height: 88px; }
.field-input--error { border-color: var(--tomato); }

.field-helper { font-size: 12px; color: var(--slate-500); margin-top: 6px; }
.field-error  { font-size: 12px; color: var(--tomato); margin-top: 6px; }

/* Native toggle (use <input type="checkbox" class="toggle"> + <label>) */
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.toggle-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.toggle {
  position: relative;
  width: 36px; height: 20px;
  background: var(--slate-300);
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 2px;
  transition: background 120ms ease;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left 120ms ease;
}
input:checked + .toggle { background: var(--sky-500); }
input:checked + .toggle::after { left: 18px; }

.toggle-label-main { display: block; font-size: 14px; color: var(--navy-900); font-weight: 500; }
.toggle-label-sub  { display: block; font-size: 12px; color: var(--slate-500); margin-top: 2px; }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}

/* ─── Boarding-pass perforation ────────────────────────────── */
.perforation {
  position: relative;
  height: 1px;
  background-image: linear-gradient(to right, var(--slate-300) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}
.perforation::before,
.perforation::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  background: var(--cloud);
  border-radius: 50%;
  transform: translateY(-50%);
}
.perforation::before { left: -9px; }
.perforation::after  { right: -9px; }

/* ─── Sky gradient + clouds (hero) ─────────────────────────── */
.sky-gradient {
  background: linear-gradient(180deg, #6EB4F9 0%, #B5D7F8 38%, #E6F1FC 72%, #F0F7FF 100%);
}
.cloud-shape {
  position: absolute;
  background: rgba(255,255,255,0.65);
  border-radius: 50%;
  filter: blur(0.5px);
  pointer-events: none;
}

/* ─── Animations ───────────────────────────────────────────── */
@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-6px); }
}
.float-y { animation: float-y 3.2s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.4); opacity: 0.6; }
}
.pulse-dot { animation: pulse-dot 1.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .float-y, .pulse-dot { animation: none; }
}

/* ─── Misc ─────────────────────────────────────────────────── */
.dashed-divider { border: 0; border-top: 1px dashed var(--slate-300); margin: 0; }

.h-screen-bezel {
  border-radius: 28px;
  overflow: hidden;
  background: var(--cloud);
  position: relative;
}

.status-bar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--navy-900);
  background: var(--cloud);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--cloud);
  border-bottom: 1px solid var(--slate-200);
}
.nav-bar--dark { background: var(--navy-900); color: white; border-bottom: 0; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: inherit;
}

.nav-item-active {
  border-left: 3px solid var(--sky-500);
  background: var(--sky-50);
}

/* Toast (rendered server-side after redirects via ?flash= query) */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(11,27,59,0.18);
}
.toast--success { background: var(--runway-green); }
.toast--error   { background: var(--tomato); }
.toast--info    { background: var(--navy-700); }

/* ─── Layout containers ─────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 640px; }

main.container { padding-top: 24px; padding-bottom: 64px; }

/* ─── Header / brand / nav (real chrome of the live app) ───── */
.site-header {
  background: var(--cloud);
  border-bottom: 1px solid var(--slate-200);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand .wordmark { color: var(--navy-900); }

.site-footer { padding: 32px 0; color: var(--slate-500); font-size: 12px; text-align: center; }

.nav { display: inline-flex; align-items: center; }
.nav a { color: var(--navy-700); font-weight: 500; margin-left: 18px; }
.nav a:hover { color: var(--navy-900); }
.nav form.inline { display: inline; margin-left: 18px; }
.nav .link { background: none; border: 0; padding: 0; color: var(--navy-700); font-weight: 500; cursor: pointer; }

@media (max-width: 768px) {
  .nav { gap: 12px; }
  .nav a, .nav .link { margin-left: 0; font-size: 14px; }
}

/* ─── Flash messages (rendered above main on redirect) ──────── */
.flash { margin: 12px auto; max-width: 720px; padding: 10px 14px; border-radius: var(--r-md); }
.flash-info    { background: var(--sky-50);  color: var(--navy-900); border: 1px solid var(--sky-200); }
.flash-success { background: #DCFCE7;        color: var(--runway-green-dark); border: 1px solid #BBF7D0; }
.flash-error   { background: #FEE2E2;        color: var(--tomato-dark); border: 1px solid #FECACA; }
