/* ===== Design tokens ===== */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --brand: #4338ca;
  --brand-600: #4f46e5;
  --brand-700: #3730a3;
  --brand-900: #1e1b4b;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --accent: #0ea5e9;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px -12px rgba(30, 27, 75, .18);
  --bs-primary: #4338ca;
  --bs-primary-rgb: 67, 56, 202;
  --bs-link-color: #4338ca;
  --bs-link-hover-color: #3730a3;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #0f172a;
}
body { background: #fff; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .display-font { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -.02em; }
a { text-underline-offset: 2px; }
.text-secondary { color: var(--muted) !important; }

/* ===== Buttons & forms ===== */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-900); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand-700);
  --bs-btn-hover-border-color: #a5b4fc; --bs-btn-active-bg: var(--brand-100); --bs-btn-active-color: var(--brand-700); }
.btn-lg { padding: .8rem 1.4rem; }
.form-control, .form-select { border-radius: 10px; border-color: #cbd5e1; padding: .65rem .85rem; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .18); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.invalid-feedback { display: block; }

/* ===== Header / footer ===== */
.demo-strip { background: var(--brand-900); color: #e0e7ff; font-size: .8rem; text-align: center; padding: .45rem 1rem; }
.demo-strip a { color: #fff; }
.site-header { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.site-header .navbar { padding: .7rem 0; }
.site-header .nav-link { font-weight: 500; color: var(--ink-2); }
.site-header .nav-link.active, .site-header .nav-link:hover { color: var(--brand); }
.brand-mark { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--brand-900); display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; transform: rotate(-8deg); }
.site-footer { background: var(--brand-900); color: #c7d2fe; padding: 3.5rem 0 1.5rem; margin-top: 5rem; }
.site-footer h6 { color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9rem; }
.site-footer a { color: #c7d2fe; text-decoration: none; line-height: 2; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2.5rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .8rem; color: #a5b4fc; }
.coin-chip { font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #e0e7ff; }

/* ===== Hero & search ===== */
.hero { position: relative; padding: 4.5rem 0 7rem; background:
  radial-gradient(1200px 400px at 85% -10%, rgba(99, 102, 241, .20), transparent 60%),
  radial-gradient(800px 380px at 0% 0%, rgba(14, 165, 233, .10), transparent 60%),
  linear-gradient(180deg, #f8faff 0%, #fff 100%); overflow: hidden; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.05; color: var(--brand-900); }
.hero .lead { color: var(--ink-2); max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand); background: var(--brand-50); border: 1px solid var(--brand-100); padding: .35rem .7rem; border-radius: 999px; }
.search-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 1.5rem; }
.search-card .trip-toggle .btn { border-radius: 999px; padding: .35rem 1rem; font-size: .85rem; }
.search-card .btn-check:checked + .btn { background: var(--brand-50); color: var(--brand-700); border-color: #c7d2fe; }
.airport-field { position: relative; }
.airport-field .form-control { padding-left: 2.4rem; font-weight: 600; }
.airport-field > i { position: absolute; left: .9rem; top: 2.35rem; color: var(--muted); }
.airport-menu { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; margin-top: 4px; display: none; }
.airport-menu.show { display: block; }
.airport-menu button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .85rem; gap: .6rem; align-items: center; }
.airport-menu button:hover, .airport-menu button.active { background: var(--brand-50); }
.airport-menu .code { font-weight: 700; color: var(--brand-700); width: 2.6rem; }
.swap-btn { position: absolute; right: -18px; top: 2rem; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--brand); }

/* ===== Sections ===== */
.section { padding: 4.5rem 0; }
.section-title { font-weight: 800; color: var(--brand-900); }
.feature-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; height: 100%; background: #fff; transition: border-color .15s; }
.feature-card:hover { border-color: #c7d2fe; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); font-size: 1.25rem; margin-bottom: 1rem; }
.route-card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; background: #fff; transition: all .15s; }
.route-card:hover { border-color: #a5b4fc; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.route-card .codes { font-weight: 800; font-size: 1.15rem; color: var(--brand-900); }
.truth-table td, .truth-table th { padding: .8rem 1rem; }
.surface { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ===== Results ===== */
.results-head { background: var(--soft); border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.filter-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: #fff; position: sticky; top: 92px; }
.filter-card h6 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 1rem 0 .6rem; }
.filter-card h6:first-child { margin-top: 0; }
.flight-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.2rem 1.3rem; margin-bottom: .9rem; transition: border-color .15s, box-shadow .15s; }
.flight-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); }
.airline-logo { background: linear-gradient(135deg, #475569, #1e293b); width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .75rem; color: #fff; flex-shrink: 0; }
.al-NWX { background: linear-gradient(135deg, #4f46e5, #312e81); } .al-SKX { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.al-CRX { background: linear-gradient(135deg, #f97316, #c2410c); } .al-MDX { background: linear-gradient(135deg, #10b981, #047857); }
.al-PLX { background: linear-gradient(135deg, #64748b, #1e293b); }
.time-big { font-size: 1.35rem; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.1; }
.route-line { position: relative; height: 2px; background: var(--line); margin: .55rem 0; }
.route-line::before, .route-line::after { content: ''; position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.route-line::before { left: 0; } .route-line::after { right: 0; }
.route-line .stop-dot { position: absolute; left: 50%; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--warning); transform: translateX(-50%); }
.price-big { font-size: 1.5rem; font-weight: 800; color: var(--brand-900); font-family: 'Plus Jakarta Sans', sans-serif; }
.date-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.date-strip a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .8rem; text-decoration: none; color: var(--ink-2); font-size: .85rem; background: #fff; text-align: center; }
.date-strip a.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.demo-pill { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: #fef3c7; color: #92400e; border-radius: 6px; padding: .15rem .45rem; }
.stepper { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.stepper .s { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
.stepper .s .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #cbd5e1; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.stepper .s.done .n { background: var(--success); border-color: var(--success); color: #fff; }
.stepper .s.active { color: var(--brand-900); font-weight: 700; }
.stepper .s.active .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .sep { color: #cbd5e1; }

/* ===== Panels ===== */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.5rem; }
.panel + .panel { margin-top: 1rem; }
.panel-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem; color: var(--brand-900); }
.fare-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .95rem; }
.fare-row.total { border-top: 1px dashed #cbd5e1; margin-top: .5rem; padding-top: .8rem; font-weight: 800; font-size: 1.15rem; color: var(--brand-900); }
.sticky-summary { position: sticky; top: 92px; }
.pay-option { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem; cursor: pointer; transition: border-color .15s; }
.pay-option:hover { border-color: #a5b4fc; }
.btn-check:checked + .pay-option, .pay-option.selected { border-color: var(--brand); background: var(--brand-50); }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.coin-grid label { border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .75rem; cursor: pointer; font-size: .88rem; font-weight: 600; }
.btn-check:checked + label.coin-label { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.simulator { border: 2px dashed #f59e0b; background: #fffbeb; border-radius: var(--radius); padding: 1.4rem; }
.status-ring { width: 74px; height: 74px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; }
.status-ring.ok { background: #d1fae5; color: var(--success); }
.status-ring.wait { background: #fef3c7; color: var(--warning); }
.status-ring.bad { background: #fee2e2; color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; word-break: break-all; }
.ref-code { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.8rem; letter-spacing: .06em; color: var(--brand-900); }
.auth-wrap { max-width: 460px; margin: 3.5rem auto; }
.auth-card { border: 1px solid var(--line); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); background: #fff; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; color: var(--brand-900); }
.prose p, .prose li { color: var(--ink-2); line-height: 1.7; }
.empty-state { text-align: center; padding: 3.5rem 1rem; border: 1px dashed #cbd5e1; border-radius: var(--radius); background: var(--soft); }
.empty-state i { font-size: 2.4rem; color: #a5b4fc; }

/* ===== Deals ===== */
.deal-badge { display: inline-block; background: #dc2626; color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .03em; border-radius: 6px; padding: .2rem .45rem; }

/* ===== Badges ===== */
.badge-status { font-weight: 600; text-transform: capitalize; border-radius: 6px; padding: .35em .6em; font-size: .74rem; }
.badge-success { background: #d1fae5; color: #065f46; } .badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; } .badge-info { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; } .badge-demo { background: #fef3c7; color: #92400e; text-transform: uppercase; }
.badge-live { background: #dcfce7; color: #166534; text-transform: uppercase; }

/* ===== Consent ===== */
.consent-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080; padding: 1rem 0; display: none; }
.consent-banner.show { display: block; }
.consent-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .35); padding: 1.1rem 1.3rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.consent-row { padding: .7rem 0 .7rem 2.8rem; border-bottom: 1px solid var(--line); }
.consent-row:last-of-type { border-bottom: 0; }
.consent-row .form-check-input { margin-left: -2.8rem; width: 2.3em; height: 1.2em; }

/* ===== Loading ===== */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 1.1rem; margin: -.55rem 0 0 -.55rem; border: 2px solid rgba(255, 255, 255, .6); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline-primary.btn-loading::after, .btn-outline-secondary.btn-loading::after { border-color: rgba(67, 56, 202, .3); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader { position: fixed; inset: 0; background: rgba(255, 255, 255, .7); display: none; align-items: center; justify-content: center; z-index: 2000; }
.page-loader.show { display: flex; }

@media (max-width: 991.98px) {
  .filter-card, .sticky-summary { position: static; }
  .swap-btn { display: none; }
  .hero { padding: 2.5rem 0 4rem; }
}
@media (max-width: 575.98px) {
  .search-card { padding: 1.1rem; border-radius: 16px; }
  .time-big { font-size: 1.1rem; }
  .price-big { font-size: 1.25rem; }
  .section { padding: 3rem 0; }
}

/* ===== Admin ===== */
.admin-body { background: #f8fafc; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 248px; background: var(--brand-900); color: #c7d2fe; flex-shrink: 0; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand-mark { color: #fff; font-size: 1.1rem; padding: 0 .6rem; }
.admin-side .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #818cf8; margin: 1.2rem .6rem .4rem; font-weight: 700; }
.admin-side a { display: flex; align-items: center; gap: .6rem; color: #c7d2fe; text-decoration: none; padding: .5rem .6rem; border-radius: 8px; font-size: .9rem; }
.admin-side a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-side a.active { background: rgba(129, 140, 248, .22); color: #fff; font-weight: 600; }
.admin-main { flex-grow: 1; min-width: 0; }
.admin-top { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.admin-content { padding: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; height: 100%; }
.kpi .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.55rem; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--brand-900); }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; overflow-x: auto; }
.table-admin td.small { min-width: 180px; }
.admin-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: .9rem; color: var(--brand-900); font-family: 'Inter', sans-serif; letter-spacing: 0; }
.table-admin { font-size: .86rem; margin-bottom: 0; }
.table-admin th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8fafc; white-space: nowrap; }
.table-admin td { vertical-align: middle; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { padding: .4rem .6rem; font-size: .85rem; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .88rem; }
.dl-grid dt { color: var(--muted); font-weight: 500; }
.dl-grid dd { margin: 0; }
.pre-json { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 1rem; font-size: .78rem; max-height: 420px; overflow: auto; }
@media (max-width: 991.98px) {
  .admin-shell { display: block; }
  .admin-side { width: auto; height: auto; position: static; }
  .admin-side nav { display: none; }
  .admin-side.open nav { display: block; }
}
