/* =========================================================================
   Yatra Booking — Passenger portal styles
   Navy + gold theme (matches the passenger mockups). Structural patterns
   (badges, modal, toast, forms, skeletons) mirror ../operator/css/operator.css
   and ../admin/css/admin.css so class names behave the same way for the
   shared/js helpers (toast(), openModal(), badge(), skeletonRows()).
   ========================================================================= */

:root {
  --navy-900: #081733;
  --navy-800: #0b2149;
  --navy-700: #0f2f63;
  --navy-600: #163b7a;
  --gold-500: #f5a623;
  --gold-600: #dd8f10;
  --gold-50: #fff6e6;

  --tx-strong: #111827;
  --tx: #33405a;
  --tx-mut: #6b7280;
  --tx-inv: #eef2fb;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface2: #f1f4fa;
  --border: #e4e8f1;
  --border2: #dbe1ee;

  --ok: #059669;
  --ok-bg: #d1fae5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #e11d48;
  --bad-bg: #ffe4e6;
  --info: #0369a1;
  --info-bg: #e0f2fe;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --sh: 0 1px 2px rgba(10, 20, 50, 0.06), 0 1px 3px rgba(10, 20, 50, 0.08);
  --sh-lg: 0 18px 40px rgba(8, 23, 51, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 0.94rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--tx-strong);
  margin: 0 0 0.4rem;
  line-height: 1.25;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 0.6rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 640px; }
.muted { color: var(--tx-mut); }
.strong { font-weight: 600; color: var(--tx-strong); }
.center { text-align: center; }
.spacer { height: 2.2rem; }
.hide { display: none !important; }
.gold { color: var(--gold-500); }

/* ---------- topbar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 2rem; height: 68px;
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.15rem; color: var(--navy-800); margin-right: auto; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-500); font-weight: 800; font-size: 1rem; flex: none;
}
.nav-links { display: flex; gap: 1.7rem; }
.nav-links a { color: var(--tx); font-weight: 600; font-size: 0.88rem; }
.nav-links a.active { color: var(--navy-800); }
.nav-links a.active { border-bottom: 2px solid var(--gold-500); padding-bottom: 4px; }
.topbar-right { display: flex; align-items: center; gap: 0.9rem; }
.user-chip { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; padding: 0.3rem 0.5rem; border-radius: 99px; }
.user-chip:hover { background: var(--surface2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy-700); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex: none;
  object-fit: cover;
}
.user-meta { line-height: 1.15; }
.user-meta .name { font-weight: 700; font-size: 0.84rem; color: var(--tx-strong); }
.user-meta .sub { font-size: 0.72rem; color: var(--tx-mut); }
.bell { position: relative; color: var(--tx-mut); }
.verify-banner {
  background: var(--warn-bg); color: var(--warn); font-size: 0.83rem; font-weight: 600;
  padding: 0.6rem 1.5rem; text-align: center;
}
.verify-banner a, .verify-banner button.link-btn { color: var(--warn); text-decoration: underline; font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.7rem 1.3rem; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 0.87rem; cursor: pointer; transition: 0.15s; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-900); }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover:not(:disabled) { background: var(--gold-600); }
.btn-outline { background: #fff; border-color: var(--border2); color: var(--tx-strong); }
.btn-outline:hover:not(:disabled) { background: var(--surface2); }
.btn-danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad-bg); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn-google { background: #fff; border-color: var(--border2); color: var(--tx-strong); }
.link-btn { background: none; border: none; color: var(--navy-700); font-weight: 700; cursor: pointer; padding: 0; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- hero / search ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, #2e6fb8 100%);
  color: #fff; padding: 3.4rem 0 4.6rem; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 260px at 85% 20%, rgba(245, 166, 35, 0.18), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 460px; gap: 3rem; align-items: start; position: relative; }
.hero h1 { color: #fff; font-size: 2.5rem; font-weight: 800; margin-bottom: 0.9rem; }
.hero p.lead { color: #cfe0f5; max-width: 480px; font-size: 1rem; margin-bottom: 1.1rem; }
.hero .trust { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: #cfe0f5; }

.search-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: 1.4rem 1.5rem; color: var(--tx); }
.trip-toggle { display: inline-flex; gap: 1.4rem; margin-bottom: 1rem; font-weight: 700; font-size: 0.86rem; color: var(--tx-mut); }
.trip-toggle span.active { color: var(--navy-800); border-bottom: 2px solid var(--gold-500); padding-bottom: 6px; }
.search-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 0.8rem; }

/* ---------- forms ---------- */
.fg { margin-bottom: 1rem; }
.fl { display: block; font-size: 0.8rem; font-weight: 700; color: var(--tx-strong); margin-bottom: 0.35rem; }
.fc {
  width: 100%; padding: 0.68rem 0.85rem; background: #fff; border: 1px solid var(--border2);
  border-radius: var(--r-sm); font-size: 0.87rem; font-family: inherit; transition: 0.15s;
}
.fc:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(15, 47, 99, 0.12); }
select.fc { cursor: pointer; }
.fc-icon-wrap { position: relative; }
.fc-icon-wrap .fc { padding-left: 2.3rem; }
.fc-icon-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--tx-mut); pointer-events: none; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.hint { font-size: 0.75rem; color: var(--tx-mut); margin-top: 0.35rem; }
.err-text { font-size: 0.78rem; color: var(--bad); margin-top: 0.35rem; font-weight: 600; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.82rem; color: var(--tx-mut); }
.checkbox-row input { margin-top: 0.2rem; }
.pw-meter { display: flex; gap: 4px; margin-top: 0.4rem; }
.pw-meter span { flex: 1; height: 4px; border-radius: 3px; background: var(--border2); }
.pw-meter span.on { background: var(--ok); }
.otp-input { letter-spacing: 0.5rem; text-align: center; font-size: 1.2rem; font-weight: 700; }
.divider-or { display: flex; align-items: center; gap: 0.8rem; color: var(--tx-mut); font-size: 0.72rem; font-weight: 700; margin: 1rem 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border2); }

/* ---------- auth split-screen layout ---------- */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side {
  background: linear-gradient(165deg, var(--navy-900), var(--navy-700) 70%, #2c6db6);
  color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative;
}
.auth-side h1 { color: #fff; font-size: 2.3rem; margin-bottom: 1rem; }
.auth-side p { color: #d6e3f5; max-width: 400px; }
.auth-checks { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
.auth-checks .item { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.9rem; }
.auth-checks .dot { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: #7ee2b8; flex: none; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 1.7rem; }
.auth-card .sub { color: var(--tx-mut); margin-bottom: 1.6rem; }
@media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh); }
.card-pad { padding: 1.4rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 2.4rem 0 1.1rem; }
.section-title h2 { font-size: 1.5rem; }

/* ---------- trip result card ---------- */
.trip-card { display: grid; grid-template-columns: 220px 1fr 220px; gap: 1.4rem; padding: 1.2rem; align-items: center; }
.trip-thumb { width: 100%; height: 100px; border-radius: var(--r); object-fit: cover; background: var(--surface2); }
.trip-operator { font-size: 0.78rem; color: var(--tx-mut); font-weight: 600; display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; }
.trip-op-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--navy-700); color: #fff; font-size: 0.62rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.trip-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem; margin: 0.5rem 0; }
.trip-route .time { font-size: 1.15rem; font-weight: 800; color: var(--tx-strong); }
.trip-route .place { font-size: 0.76rem; color: var(--tx-mut); }
.trip-route .mid { text-align: center; }
.trip-route .duration { font-size: 0.72rem; color: var(--tx-mut); margin-bottom: 3px; }
.trip-line { height: 2px; background: var(--border2); position: relative; }
.trip-line .dot { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.trip-line .dot:first-child { left: 0; } .trip-line .dot:last-child { right: 0; }
.trip-stop { font-size: 0.68rem; color: var(--ok); font-weight: 700; margin-top: 3px; }
.trip-amenities { display: flex; gap: 0.6rem; font-size: 0.72rem; color: var(--tx-mut); margin-top: 0.4rem; flex-wrap: wrap; }
.trip-price { text-align: right; }
.trip-price .from { font-size: 0.68rem; color: var(--tx-mut); }
.trip-price .amt { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); }
.trip-price .seats-left { font-size: 0.74rem; font-weight: 700; color: var(--ok); margin: 0.3rem 0 0.8rem; }
.trip-price .seats-low { color: var(--warn); }
.rating-inline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; color: var(--tx-strong); }
.rating-inline .star { color: var(--gold-500); }
@media (max-width: 820px) { .trip-card { grid-template-columns: 1fr; } .trip-thumb { display: none; } .trip-price { text-align: left; } }

/* ---------- filters ---------- */
.filter-bar { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.9rem 0; }
.filter-chip {
  padding: 0.5rem 0.9rem; border-radius: 99px; border: 1px solid var(--border2); background: #fff;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--tx);
}
.filter-chip.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- seat map ---------- */
.seat-grid { display: inline-grid; gap: 10px; }
.seat {
  width: 42px; height: 42px; border-radius: 9px; border: 1.5px solid var(--border2); background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700;
  cursor: pointer; color: var(--tx); position: relative; transition: 0.12s;
}
.seat.aisle { visibility: hidden; }
.seat.AVAILABLE:hover { border-color: var(--navy-600); }
.seat.SELECTED { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.seat.LOCKED_BY_ME { background: var(--gold-50); border-color: var(--gold-500); color: var(--gold-600); }
.seat.LOCKED, .seat.BOOKED { background: var(--surface2); color: var(--tx-mut); border-color: var(--border); cursor: not-allowed; text-decoration: line-through; }
.seat.BLOCKED { background: var(--surface2); color: var(--border2); cursor: not-allowed; }
.seat-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--tx-mut); margin-top: 1rem; }
.seat-legend .item { display: flex; align-items: center; gap: 0.4rem; }
.seat-legend .swatch { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border2); }
.deck-label { font-weight: 700; font-size: 0.85rem; color: var(--tx-strong); margin-bottom: 0.7rem; }
.qty-stepper { display: flex; align-items: center; gap: 0.9rem; }
.qty-stepper button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border2); background: #fff; font-size: 1.1rem; cursor: pointer; }
.qty-stepper .n { font-size: 1.3rem; font-weight: 800; min-width: 24px; text-align: center; }

/* ---------- passenger detail rows ---------- */
.pax-row { border: 1px solid var(--border); border-radius: var(--r); padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.pax-row .seat-tag { display: inline-block; background: var(--navy-800); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 0.15rem 0.55rem; border-radius: 6px; margin-bottom: 0.6rem; }

/* ---------- summary panel ---------- */
.summary-panel { position: sticky; top: 86px; }
.summary-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.86rem; }
.summary-row.total { border-top: 1px dashed var(--border2); margin-top: 0.5rem; padding-top: 0.8rem; font-weight: 800; font-size: 1.05rem; color: var(--navy-800); }
.timer-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--bad-bg); color: var(--bad); font-weight: 800; font-size: 0.8rem; padding: 0.4rem 0.8rem; border-radius: 99px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 0.22rem 0.6rem; border-radius: 99px; font-size: 0.7rem; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { background: var(--surface2); color: var(--tx-mut); }

/* ---------- booking / dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat-card { padding: 1.1rem 1.2rem; }
.stat-card .v { font-size: 1.6rem; font-weight: 800; color: var(--tx-strong); }
.stat-card .l { font-size: 0.78rem; color: var(--tx-mut); font-weight: 600; }
.next-trip-banner { background: var(--navy-800); color: #fff; border-radius: var(--r-lg); padding: 1.6rem 1.8rem; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.next-trip-banner .route-big { font-size: 1.4rem; font-weight: 800; }
.next-trip-banner .meta { color: #c9d6ec; font-size: 0.83rem; margin-top: 0.4rem; }
.qr-box { background: #fff; padding: 0.7rem; border-radius: var(--r); text-align: center; }
.qr-box img { width: 100px; height: 100px; }
.qr-box .label { font-size: 0.66rem; font-weight: 800; color: var(--tx-strong); margin-top: 0.3rem; letter-spacing: 0.03em; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.tbl th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--tx-mut); padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 0.85rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--tx-mut); }
.empty svg { color: var(--border2); margin-bottom: 0.8rem; }

/* ---------- stars ---------- */
.star-picker { display: flex; gap: 0.3rem; font-size: 1.8rem; }
.star-picker span { cursor: pointer; color: var(--border2); transition: 0.1s; }
.star-picker span.on { color: var(--gold-500); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 15, 33, 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 60;
}
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; animation: pop 0.2s ease; }
.modal--wide { max-width: 720px; }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--gold-50), transparent); }
.mhead h3 { font-size: 1.02rem; }
.mbody { padding: 1.2rem 1.3rem; }
.mfoot { display: flex; justify-content: flex-end; gap: 0.7rem; padding: 1rem 1.3rem; border-top: 1px solid var(--border); }
.x { background: none; border: none; color: var(--tx-mut); font-size: 1.15rem; padding: 0.2rem 0.5rem; border-radius: 8px; cursor: pointer; }
.x:hover { background: var(--surface2); color: var(--tx-strong); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ---------- toast / skeleton ---------- */
.toast-region { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 100; display: flex; flex-direction: column; gap: 0.7rem; width: 330px; max-width: calc(100vw - 2.4rem); }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--navy-700); border-radius: 12px; box-shadow: var(--sh-lg); padding: 0.85rem 1rem; font-size: 0.85rem; font-weight: 500; animation: pop 0.2s ease; transition: opacity 0.3s; }
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--bad); }
.skel { height: 13px; border-radius: 6px; background: linear-gradient(90deg, #eef0f7 25%, #e2e5f0 37%, #eef0f7 63%); background-size: 400% 100%; animation: sh 1.4s ease infinite; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-block { border-radius: var(--r); background: linear-gradient(90deg, #eef0f7 25%, #e2e5f0 37%, #eef0f7 63%); background-size: 400% 100%; animation: sh 1.4s ease infinite; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface2); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.footer-grid h4 { font-size: 0.82rem; margin-bottom: 0.8rem; }
.footer-grid a { display: block; color: var(--tx-mut); font-size: 0.83rem; margin-bottom: 0.55rem; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.2rem; text-align: center; font-size: 0.76rem; color: var(--tx-mut); }

/* ---------- page shell ---------- */
.page { min-height: calc(100vh - 68px); padding: 2rem 0 1rem; }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.split-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.6rem; align-items: start; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .search-row, .frow { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .split-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
