/* LabelMyTrip site styles.
   Logical properties (margin-inline-*, text-align: start, etc.) so RTL
   mostly falls out of <html dir="rtl"> automatically — see CLAUDE.md's
   i18n notes. Palette matches the official logo package (see
   labelmytrip-logo-*.png / LabelMyTrip-Logo-Package/README.txt): navy +
   orange + blue on a cream background. Layout: a card floating on a
   dotted cream page — no gradients, no glassmorphism, no centered
   glowing hero. */

:root {
  --color-primary: #1b3a5c;       /* brand navy */
  --color-primary-dark: #142c46;  /* hover/pressed state */
  --color-accent: #e8734a;        /* brand orange — used sparingly */
  --color-accent-soft: #fbdccf;   /* light orange for focus rings/badges */
  --color-accent-blue: #3e7cb8;   /* brand blue — secondary accent */
  --color-bg: #f5f3ef;            /* brand cream */
  --color-surface: #ffffff;       /* card + inputs against the cream bg */
  --color-text: #1b3a5c;          /* = primary, one ink color for brand + text */
  --color-text-muted: #6b7680;    /* navy-tinted gray, stays in-family */
  --color-border: #e3ded4;        /* warm light gray, matches bg */
  --color-success: #2e7d5b;
  --color-success-bg: #e8f3ee;
  --color-success-border: #a9cfbe;
  --color-danger: #c14a2e;
  --color-danger-bg: #fbece8;
  --color-danger-border: #e3ab9a;

  --font-display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-card: 18px;
  --radius-control: 10px;
  --shadow-card: 0 1px 2px rgba(27, 58, 92, 0.05), 0 12px 32px -8px rgba(27, 58, 92, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(27, 58, 92, 0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

.topbar {
  height: 6px;
  background: var(--color-accent);
}

.page-wide {
  max-width: 95vw !important;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: block;
  height: 52px;
  width: auto;
}

.brand-tagline {
  /* Two-color gradient treatment (works regardless of language/word
     boundaries, unlike splitting the string into two colored spans) —
     also bumped up from a small caption to a real, noticeable slogan. */
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  max-width: 420px;
  display: none;
}

@media (min-width: 640px) {
  .brand-tagline {
    display: block;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px clamp(20px, 5vw, 44px);
}

.requirements-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 16px 20px;
  margin: 20px 0;
}

.requirements-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.requirements-box ul {
  margin: 0;
  padding-inline-start: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.requirements-box li {
  margin: 4px 0;
}

/* Trip info / contact info boxes on the customer dashboard (DSH02) —
   same visual treatment as .requirements-box, with bold labels on each
   row so "Trip name:", "Email:" etc. read as labels, not run-on text. */
.info-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 16px 20px;
  margin: 20px 0;
}

.info-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.info-box + .info-box {
  margin-top: -8px;
}

.info-row {
  font-size: 14px;
  color: var(--color-text);
  margin: 4px 0;
}

.info-row strong {
  font-weight: 700;
}

.info-box .info-group {
  padding: 8px 0;
  border-block-start: 1px solid var(--color-border);
}

.info-box .info-group:first-of-type {
  border-block-start: none;
  padding-block-start: 0;
}

.lang-switcher select {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: var(--radius-control);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.01em;
  color: var(--color-primary);
  margin: 0 0 20px;
  padding-block-end: 14px;
  border-block-end: 3px solid var(--color-accent-soft);
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--color-primary);
  margin: 30px 0 10px;
}

p {
  color: var(--color-text);
}

label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin: 20px 0 7px;
}

/* Radio option labels ("same contact" / "different contact") stay
   inline and sentence-case — the uppercase block treatment above is
   for field labels only. */
label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: normal;
  color: var(--color-text);
  margin: 8px 16px 8px 0;
}

textarea, input[type=text], input[type=email], input[type=tel], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

input[type=file] {
  font-size: 14px;
  color: var(--color-text-muted);
}

button, .btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 13px 26px;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover, .btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(26, 26, 46, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg);
  box-shadow: none;
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}

.stat-tile {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 14px 16px;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-primary);
  line-height: 1.3;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.text-muted {
  color: var(--color-text-muted);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}

.filter-form input[type=text] {
  width: auto;
  flex: 1 1 120px;
  min-width: 90px;
  padding: 7px 10px;
  margin: 0;
  font-size: 13px;
}

.export-links {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

tr.row-selected {
  background: var(--color-accent-soft);
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.page-code {
  /* Small reference code stamped on every page/popup (e.g. "PAY01") so
     a support conversation can just say "check PAY01" instead of
     describing which screen is meant — see templates.py's page() and
     modal.js's showModal(). A background chip (not just bare colored
     text) keeps it legible regardless of whether it lands over the
     cream page background or the white card underneath it. */
  position: fixed;
  bottom: 6px;
  inset-inline-end: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #000;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
  user-select: all;
  z-index: 500;
  pointer-events: none;
}

.modal-code {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #000;
  letter-spacing: 0.5px;
  text-align: end;
  margin: 0 0 4px;
  user-select: all;
}

.review-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-inline-end: 8px;
  vertical-align: -3px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: review-spin 0.8s linear infinite;
}

@keyframes review-spin {
  to { transform: rotate(360deg); }
}

.luggage-contact-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  margin: 10px 0;
}

.luggage-contact-block h4 {
  margin: 0 0 8px;
  color: var(--color-primary);
}

table th a {
  color: inherit;
  text-decoration: none;
}

table th a:hover {
  color: var(--color-accent);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 14px;
}

th {
  text-align: start;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 6px 8px;
  border-block-end: 2px solid var(--color-border);
  white-space: nowrap;
}

td {
  padding: 6px 8px;
  border-block-end: 1px solid var(--color-border);
  /* Admin dashboard tables (the only <table>s in the app) are dense and
     scroll horizontally (see the overflow-x:auto wrapper around each
     one) — every column stays narrow AND single-line rather than
     wrapping text and inflating row height, which made a wide table
     with many columns harder to scan, not easier. */
  white-space: nowrap;
}

/* Sticky header + frozen id/trip-name columns for every wide, scrollable
   admin table (.scroll-x) -- a long trip list otherwise loses its column
   headings while scrolling down, and loses track of WHICH trip a row is
   once scrolled sideways past a dense table. `th` already has no
   horizontal scroll ancestor of its own (.scroll-x only sets
   overflow-x), so `top: 0` sticks it to the page's own vertical scroll
   as intended.

   The two frozen columns (see admin.py's _cell_class) need FIXED widths
   -- col-frozen-name's `left` has to equal col-frozen-id's actual
   rendered width for them to sit flush without gapping or overlapping,
   which an auto/content-based width can't guarantee. A long trip name
   is truncated with an ellipsis here; its full value is still one
   double-click away via the row's own event-history popup. Both need an
   opaque background (table rows would otherwise show through underneath
   while scrolling sideways) and a visible edge so they read as
   "pinned," not misaligned. */
.scroll-x thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 2;
}

.scroll-x .col-frozen-id,
.scroll-x .col-frozen-name {
  position: sticky;
  background: var(--color-bg);
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scroll-x .col-frozen-id {
  left: 0;
  width: 56px;
  max-width: 56px;
  box-shadow: 1px 0 0 var(--color-border);
}

.scroll-x .col-frozen-name {
  left: 56px;
  width: 160px;
  max-width: 160px;
  box-shadow: 1px 0 0 var(--color-border);
}

.scroll-x thead th.col-frozen-id,
.scroll-x thead th.col-frozen-name {
  z-index: 3;
}

/* Click-to-highlight rows (see static/js/admin_row_highlight.js). */
tr.row-highlight > td,
.scroll-x tr.row-highlight > td.col-frozen-id,
.scroll-x tr.row-highlight > td.col-frozen-name {
  background: var(--color-accent-soft, rgba(255, 200, 0, 0.18));
}

/* Admin dashboard's date/time columns — kept on one line (a formatted
   "2026-09-25 16:45" wrapping onto two lines threw off row height and
   made the now-adjacent block of date/time columns harder to scan). */
.col-datetime {
  white-space: nowrap;
}

/* Paddle reference ids (txn_/ctm_/evt_/ntf_...) on the admin invoices
   table -- monospace makes the shared prefix/length easier to scan and
   compare than proportional text would. */
.mono-cell {
  font-family: monospace;
  white-space: nowrap;
  font-size: 0.9em;
}

/* Floating horizontal scrollbar for wide admin tables (see
   static/js/floating_scrollbar.js) -- pinned to the viewport bottom,
   positioned/sized in JS to match the .scroll-x wrapper it mirrors. */
.floating-scrollbar {
  display: none;
  position: fixed;
  bottom: 0;
  height: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  z-index: 50;
}

.floating-scrollbar > div {
  height: 1px;
}

.issue, .ok {
  border-radius: var(--radius-control);
  padding: 14px 16px;
  margin: 14px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.issue {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger);
}

.ok {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success);
}

.issue::before, .ok::before {
  flex-shrink: 0;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  margin-block-start: 1px;
}

.issue::before {
  content: "!";
  background: var(--color-danger);
}

.ok::before {
  content: "\2713";
  background: var(--color-success);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: modal-fade 0.12s ease;
}

.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 30px 28px;
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  animation: modal-pop 0.15s ease;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--color-primary);
  margin: 0 0 10px;
}

.modal-message {
  color: var(--color-text);
  margin: 0 0 22px;
  line-height: 1.5;
}

.modal-ok {
  min-width: 110px;
}

.modal-box-wide {
  max-width: 560px;
  text-align: left;
}

.modal-box-wide textarea {
  width: 100%;
  min-height: 90px;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  resize: vertical;
  box-sizing: border-box;
}

.diagnose-result {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #f7f8fa;
}

.diagnose-result h4 {
  margin: 0 0 4px;
  color: var(--color-primary);
}

.diagnose-result p {
  margin: 0 0 12px;
  line-height: 1.5;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Upload page's pipeline-stage tracker (see trip_flow.py's upload_form
   and static/js/upload.js's setPipelineStep()) -- a simple horizontal
   row of dots/labels, each in one of three states driven by a class on
   the <li> itself: default (pending, muted), .done (filled success
   color), .active (brand color, pulsing). "Processing"/"Ready" are
   always shown as upcoming context -- this page can't track them live
   since the customer has normally left by the time they happen. */
#pipeline-tracker {
  display: flex;
  /* flex-wrap used to be "wrap" -- with 13 steps, that wrapped mid-row
     into ragged, disconnected-looking lines on narrower viewports
     (confirmed on mobile Safari: a dangling connector at the end of one
     row, a new row starting with no leading connector). A single
     horizontally-scrollable row is the standard pattern for a stepper
     with more steps than fit a phone's width (mirrors iOS/e-commerce
     order trackers) -- setPipelineStep() in upload.js scrolls the
     active step into view so nothing needs manual scrolling to see
     current progress. */
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  list-style: none;
  margin: 0 0 24px;
  padding: 0 0 4px;
  gap: 4px;
  /* The scrollbar itself is hidden above (::-webkit-scrollbar below,
     scrollbar-width:none here) for a cleaner look, which also means
     there's otherwise NO visual cue this row scrolls at all -- it just
     looks hard-cut at the card's edge (confirmed: that's exactly what
     the "fixed" version looked like on a phone before this). A fade at
     the trailing edge is the standard affordance for a scrollable row
     (mirrors iOS's own horizontal lists) -- mask-image, not a solid
     overlay, so it fades the real dots/connectors themselves rather
     than painting over them. -webkit-mask-image is required, not just a
     prefix nicety -- Safari's unprefixed `mask-image` support has been
     unreliable, and Safari is exactly where this needed to work. */
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
}
#pipeline-tracker::-webkit-scrollbar {
  display: none;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.pipeline-step:not(:last-child)::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--color-border);
  margin-inline: 4px;
}

.pipeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
}

.pipeline-step.done {
  color: var(--color-success);
}
.pipeline-step.done .pipeline-dot {
  background: var(--color-success);
}

.pipeline-step.active {
  color: var(--color-primary);
  font-weight: 600;
}
.pipeline-step.active .pipeline-dot {
  background: var(--color-accent);
  animation: pipeline-pulse 1.4s ease-in-out infinite;
}

@keyframes pipeline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 4px transparent; }
}

@media (max-width: 480px) {
  #pipeline-tracker {
    gap: 2px 0;
  }
  .pipeline-step {
    font-size: 11px;
  }
  .pipeline-label {
    display: none;
  }
  .pipeline-step.active .pipeline-label,
  .pipeline-step.done:last-of-type .pipeline-label {
    display: inline;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 28px 20px;
    border-radius: 14px;
  }
  .brand-logo {
    height: 38px;
  }
  .brand-tagline {
    display: none;
  }
}

/* ---------- Payment page ---------- */
.pay-card {
  max-width: 420px;
  margin: 24px auto;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}
.pay-greeting {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-primary);
}
.pay-wish {
  margin: 0 0 20px;
  color: var(--color-text-muted);
  font-size: 13.5px;
}
.pay-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13.5px;
}
.pay-row span {
  color: var(--color-text-muted);
}
.pay-row strong {
  text-align: right;
}
.pay-amount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 0 20px;
  padding-top: 14px;
  border-top: 2px solid var(--color-primary);
}
.pay-amount span {
  color: var(--color-text-muted);
  font-size: 13.5px;
}
.pay-amount strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.pay-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
}
.pay-cancel-btn {
  width: 100%;
  margin-top: 10px;
}
.pay-mock-input {
  width: 100%;
  margin-bottom: 10px;
}
.pay-footnote {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}
