/* ==========================================================================
   My Bookings · peacock hero, the "next journey" ticket, tabs, booking
   cards (tear-off date + perforation), PNR lookup and the logged-out gate.
   Builds on tokens.css + app.css + account.css.
   ========================================================================== */

/* ---- Hero ----------------------------------------------------------------- */
.bk-hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background:
    radial-gradient(55% 90% at 92% 10%, rgb(244 163 0 / .22), transparent 60%),
    radial-gradient(90% 140% at 8% 0%, var(--peacock-700), var(--peacock-950) 72%);
  padding-block: var(--s-5) calc(var(--s-9) + var(--s-5));
}
.bk-hero > .kolam { background: rgb(212 168 74 / .08); }
.bk-hero .container { position: relative; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); color: #cfe7f1; margin-bottom: var(--s-3); }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .icon { width: 12px; height: 12px; opacity: .7; }
.bk-hero h1 { font-size: var(--fs-3xl); }
:root:lang(ta) .bk-hero h1 { font-size: var(--fs-2xl); }
@media (min-width: 768px) { .bk-hero h1 { font-size: var(--fs-4xl); } :root:lang(ta) .bk-hero h1 { font-size: var(--fs-3xl); } }
.bk-echo { margin-top: 2px; font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-lg); color: var(--marigold-300); }
.bk-hello { margin-top: var(--s-3); color: #e3f0f5; font-size: var(--fs-md); max-width: 56ch; }
.bk-stats { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.bk-stats li {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 var(--s-3); border-radius: var(--r-pill);
  background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .18); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.bk-stats .icon { color: var(--marigold-300); }
.bk-stats li.warm { background: rgb(244 163 0 / .2); border-color: rgb(244 163 0 / .45); }

.bk-body { position: relative; margin-top: calc(var(--s-9) * -1); padding-bottom: var(--s-8); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.bk-body > * { min-width: 0; }
.bk-body > [data-auth] { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.bk-body > [data-auth] > *, .bk-list > *, .bk-cards > * { min-width: 0; }

/* ---- Banner (arrived from a homepage quick action) ------------------------------ */
.bk-banner {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-2) var(--s-3) var(--s-3);
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cta); box-shadow: var(--sh-2);
}
.bk-banner[data-kind="cancel"] { border-left-color: var(--festive); }
.bk-banner-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); }
.bk-banner[data-kind="cancel"] .bk-banner-ic { background: var(--festive-soft); color: var(--festive); }
.bk-banner p { flex: 1; font-size: var(--fs-sm); font-weight: var(--fw-medium); }

/* ---- Next journey ticket -------------------------------------------------------- */
.nx {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-3);
}
@media (min-width: 768px) { .nx { grid-template-columns: minmax(0, 1fr) 220px; } }
.nx-main { position: relative; overflow: hidden; padding: var(--s-5); border-radius: var(--r-xl) var(--r-xl) 0 0; }
@media (min-width: 768px) { .nx-main { padding: var(--s-6); border-radius: var(--r-xl) 0 0 var(--r-xl); } }
.nx-main > .kolam { opacity: .6; -webkit-mask-size: 40px 40px; mask-size: 40px 40px; }
.nx-main > *:not(.kolam) { position: relative; }
.nx-main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: url("../assets/zari.svg") repeat-x 0 0 / 22px 8px; z-index: 1; }
.nx-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.nx-count {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s-3); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); font-weight: var(--fw-bold);
}
.nx-live { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s-3); border-radius: var(--r-pill); background: var(--festive-soft); color: var(--festive); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .06em; }
:root:lang(en) .nx-live { text-transform: uppercase; }
.nx-live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: live 1.6s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.nx-k { margin-top: var(--s-4); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--zari-text); letter-spacing: .08em; }
:root:lang(en) .nx-k { text-transform: uppercase; }
.nx-fest { display: inline-flex; align-items: center; gap: 4px; color: var(--festive); }
.nx-fest .icon { width: 13px; height: 13px; }
.nx-route { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-3); margin-top: 2px; font-size: var(--fs-3xl); line-height: 1.1; }
:root:lang(ta) .nx-route { font-size: var(--fs-2xl); }
@media (min-width: 768px) { .nx-route { font-size: var(--fs-4xl); } :root:lang(ta) .nx-route { font-size: var(--fs-3xl); } }
.nx-route .icon { width: .7em; height: .7em; color: var(--festive); stroke-width: 2.5; }
.nx-when { margin-top: var(--s-2); color: var(--text-2); font-size: var(--fs-base); }
.nx-when b { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text); }
.nx-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-5); margin: var(--s-5) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line); }
.nx-facts .wide { grid-column: 1 / -1; }
.nx-facts dt { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-semibold); letter-spacing: .04em; }
.nx-facts dd { margin: 2px 0 0; font-weight: var(--fw-semibold); line-height: 1.4; }
.nx-facts dd small { display: block; font-weight: var(--fw-regular); font-size: var(--fs-xs); color: var(--text-muted); }
.plate {
  display: inline-block; padding: 0 6px; border-radius: 4px; border: 1.5px solid #1f1a15; background: #ffd23f; color: #1f1a15;
  font-family: var(--font-mono); font-weight: 600; font-size: max(13px, .86em); letter-spacing: .06em; white-space: nowrap; line-height: 1.5;
}
.nx-track { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--brand-soft); }
.nx-track p { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.nx-track[data-phase="assigned"] .nx-bar { opacity: .6; }
.nx-bar { position: relative; display: block; height: 6px; margin: 14px 10px 0; border-radius: 6px; background: var(--brand-soft-2); }
.nx-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--cta); transition: width 1.2s var(--ease); }
.nx-bar::after { content: ""; position: absolute; right: -6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--festive); box-shadow: 0 0 0 3px var(--surface); }
.nx-bar b { position: absolute; top: 50%; display: grid; place-items: center; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 3px var(--surface), var(--sh-2); transition: left 1.2s var(--ease); }
.nx-track[data-phase="coming"] .nx-bar b { animation: bob 1.4s ease-in-out infinite; }
.nx-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.nx-actions .btn { flex: 1 1 auto; }
@media (min-width: 768px) { .nx-actions .btn { flex: 0 0 auto; } }

/* stub: perforated edge + QR */
.nx-stub {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; padding: var(--s-5) var(--s-4);
  border: 0; border-top: 0; background: var(--surface-2); color: var(--text); border-radius: 0 0 var(--r-xl) var(--r-xl); text-align: center;
}
@media (min-width: 768px) { .nx-stub { border-radius: 0 var(--r-xl) var(--r-xl) 0; } }
.nx-stub::before { content: ""; position: absolute; left: 22px; right: 22px; top: -2px; height: 4px; background: radial-gradient(circle, var(--line-strong) 1.7px, transparent 2.1px) 0 50% / 10px 4px repeat-x; }
@media (min-width: 768px) { .nx-stub::before { left: -2px; right: auto; top: 22px; bottom: 22px; width: 4px; height: auto; background: radial-gradient(circle, var(--line-strong) 1.7px, transparent 2.1px) 50% 0 / 4px 10px repeat-y; } }
.nx-stub .notch { position: absolute; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.nx-stub .n1 { left: -12px; top: -12px; clip-path: inset(0 0 0 50%); margin-left: -1px; }
.nx-stub .n2 { right: -12px; top: -12px; clip-path: inset(0 50% 0 0); margin-right: -1px; }
@media (min-width: 768px) {
  .nx-stub .n1 { clip-path: inset(50% 0 0 0); margin: -1px 0 0; }
  .nx-stub .n2 { right: auto; left: -12px; top: auto; bottom: -12px; clip-path: inset(0 0 50% 0); margin: 0 0 -1px; }
}
.nx-stub img { width: 120px; height: 120px; padding: 6px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: var(--s-2); transition: transform 260ms var(--spring); }
.nx-stub:hover img { transform: scale(1.04); }
.nx-stub small { font-size: 13px; font-weight: var(--fw-semibold); letter-spacing: .14em; color: var(--text-muted); }
.nx-stub b { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-lg); letter-spacing: .12em; }
.nx-stub span { font-size: var(--fs-xs); color: var(--link); font-weight: var(--fw-semibold); }

/* ---- Toolbar: tabs + search -------------------------------------------------------- */
.bk-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.bk-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.bk-tabs { display: flex; padding: 4px; gap: 2px; border-radius: var(--r-md); background: var(--surface-sunk); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.bk-tabs::-webkit-scrollbar { display: none; }
.bk-tabs button {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-3); white-space: nowrap;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.bk-tabs button b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface); font-size: 13px; color: var(--text-2); }
.bk-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.bk-tabs button[aria-selected="true"] b { background: var(--brand); color: var(--brand-ink); }
.bk-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.bk-search .icon { position: absolute; left: 14px; top: 50%; margin-top: -8px; color: var(--text-muted); pointer-events: none; }
.bk-search input {
  width: 100%; min-height: 48px; padding: 0 var(--s-4) 0 40px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: var(--fs-sm); outline: 0; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.bk-search input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
@media (max-width: 639px) {
  .bk-tabs { width: 100%; } .bk-tabs button { flex: 1; justify-content: center; } .bk-search { max-width: none; }
  :root:lang(ta) .bk-tabs button { gap: 4px; padding: 0 6px; font-size: var(--fs-xs); }
  :root:lang(ta) .bk-tabs button b { min-width: 20px; height: 20px; padding: 0 5px; }
}
.bk-panel { outline: 0; }

/* ---- Booking cards --------------------------------------------------------------- */
.bk-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.bk-card {
  position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "date body" "side side" "acts acts";
  gap: 0 var(--s-4); padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 260ms var(--spring);
  animation: card-rise 420ms var(--ease) both;
}
.bk-card:nth-child(2) { animation-delay: 50ms; } .bk-card:nth-child(3) { animation-delay: 100ms; } .bk-card:nth-child(4) { animation-delay: 150ms; }
@keyframes card-rise { from { opacity: 0; transform: translateY(10px); } }
.bk-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
@media (min-width: 768px) {
  .bk-card { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "date body side" "date body acts"; gap: var(--s-2) var(--s-5); padding: var(--s-4) var(--s-5); }
}
.bc-date {
  grid-area: date; align-self: start; display: grid; justify-items: center; align-content: center; height: 76px; border-radius: var(--r-md);
  background: var(--brand-soft); border-top: 4px solid var(--cta); color: var(--text); line-height: 1.05; overflow: hidden; position: relative;
}
@media (min-width: 768px) { .bc-date { height: 88px; } }
.bc-date b { font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-2xl); }
.bc-date small { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; color: var(--link); }
.bc-date span { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.bc-date.is-tour { background: linear-gradient(rgb(4 32 46 / .35), rgb(4 32 46 / .75)), var(--poster) center / cover; border-top-color: var(--festive); color: #fff; }
.bc-date.is-tour small, .bc-date.is-tour span { color: #fff; }
.bk-card[data-status="completed"] .bc-date { background: var(--surface-sunk); border-top-color: var(--zari); }
.bk-card[data-status="completed"] .bc-date small { color: var(--zari-text); }
.bk-card[data-status="cancelled"] .bc-date { background: var(--festive-soft); border-top-color: var(--festive); }
.bk-card[data-status="cancelled"] .bc-date small { color: var(--festive); }
.bk-card[data-status="cancelled"] .bc-route { color: var(--text-2); }

.bc-body { grid-area: body; min-width: 0; display: grid; gap: 4px; align-content: start; }
.bc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bc-tags .icon { width: 12px; height: 12px; }
.bc-route { display: flex; flex-wrap: wrap; align-items: center; font-size: var(--fs-xl); margin-top: 2px; }
.bc-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); color: inherit; text-decoration: none; }
.bc-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.bc-link:hover { color: var(--link); }
.bc-link:focus-visible { outline: 0; }
.bc-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.bc-route .icon { width: 18px; height: 18px; color: var(--festive); }
.bc-meta { font-size: var(--fs-sm); color: var(--text-2); }
.bc-meta .num { font-weight: var(--fw-semibold); color: var(--text); }
.bc-pax { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }

.bc-side {
  grid-area: side; position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin-top: var(--s-3); padding-top: var(--s-3);
}
.bc-side::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 4px; background: radial-gradient(circle, var(--line-strong) 1.6px, transparent 2px) 0 50% / 9px 4px repeat-x; }
@media (min-width: 768px) {
  .bc-side { display: grid; justify-items: end; align-content: start; margin: 0; padding: 0; text-align: right; }
  .bc-side::before { display: none; }
}
.bc-pnr small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .1em; color: var(--text-muted); }
.bc-pnr b { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-base); letter-spacing: .1em; }
@media (max-width: 767px) { .bc-pnr { display: flex; align-items: baseline; gap: var(--s-2); } }
.bc-amt { font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-xl); }
.bc-actions { grid-area: acts; position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.bc-actions .btn { min-height: 40px; padding: 0 var(--s-3); flex: 1 1 auto; }
@media (min-width: 768px) { .bc-actions { justify-content: flex-end; align-self: end; margin-top: 0; } .bc-actions .btn { flex: 0 0 auto; } }
.bc-stars { display: inline-flex; gap: 2px; align-items: center; padding: 0 var(--s-2); min-height: 40px; }
.bc-stars .icon { color: var(--line-strong); }
.bc-stars .icon.on { color: var(--cta-hover); fill: var(--cta); }
.bk-empty { border-style: solid; }

/* ---- Find by PNR ----------------------------------------------------------------- */
.bk-find { overflow: hidden; }
.bk-find summary {
  display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-2) var(--s-4); cursor: pointer; list-style: none;
  font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.bk-find summary::-webkit-details-marker { display: none; }
.bk-find summary .qa-icon::after { display: none; }
.bk-find summary > span:nth-child(2) { flex: 1; }
.bk-find summary .chev { color: var(--text-muted); transition: transform var(--dur) var(--ease); }
.bk-find[open] summary .chev { transform: rotate(180deg); }
.bk-find-body { padding: 0 var(--s-4) var(--s-5); }
@media (min-width: 768px) { .bk-find-body { padding: 0 var(--s-5) var(--s-5) calc(var(--s-4) + 40px + var(--s-3)); } }
.find-b { color: var(--text-2); font-size: var(--fs-sm); max-width: 60ch; }
.find-grid { display: grid; gap: 0 var(--s-3); }
@media (min-width: 640px) { .find-grid { grid-template-columns: 1fr 1fr; } }
.find-pnr { font-family: var(--font-mono) !important; letter-spacing: .14em; text-transform: uppercase; }
.find-mob { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.find .lg-submit { margin-top: var(--s-4); }
@media (min-width: 640px) { .bk-find .find .lg-submit { width: auto; } }
.find-hint { display: flex; align-items: center; gap: 6px; margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }

.bk-reset { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }

/* ---- Logged-out gate ------------------------------------------------------------- */
.bk-body > .bk-gate { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .bk-body > .bk-gate { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.gate-login { position: relative; overflow: hidden; padding: calc(var(--s-5) + 8px) var(--s-5) var(--s-5); box-shadow: var(--sh-3); }
@media (min-width: 768px) { .gate-login { padding: calc(var(--s-6) + 8px) var(--s-6) var(--s-6); } }
.gate-login > .zari-band { position: absolute; left: 0; right: 0; top: 0; height: 8px; background-size: 22px 8px; }
.gate-art { width: 220px; max-width: 70%; height: auto; margin-bottom: var(--s-4); }
.gate-login h2, .gate-pnr h2 { font-size: var(--fs-2xl); }
.gate-login > p { margin-top: var(--s-2); color: var(--text-2); max-width: 46ch; }
.gate-list { display: grid; gap: var(--s-2); margin: var(--s-4) 0 var(--s-5); }
.gate-list li { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.gate-list .icon { flex: none; width: 32px; height: 32px; padding: 8px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--link); }
.gate-pnr { padding: var(--s-5); }
@media (min-width: 768px) { .gate-pnr { padding: var(--s-6); } }
.gate-pnr .find-b { margin-top: var(--s-2); }
.gate-pnr .find .lg-submit { width: 100%; }

/* ---- Footer ----------------------------------------------------------------------- */
.sub-foot { margin-top: 0; padding-bottom: var(--s-5); }
.sub-foot > .container { padding-top: var(--s-5); }
.sub-foot .footer-bottom { margin-top: 0; border-top: 0; padding-top: 0; }
