/* ============================================================
   SafarBudget — single shared stylesheet
   One design system for every page. No page-specific CSS files.
   ============================================================ */

:root {
  --ink:     #0F172A;   /* Slate 900 — headings/text */
  --blue:    #3B82F6;   /* Blue 500 — accent/buttons/links */
  --blue-d:  #2563EB;   /* Blue 600 — hover */
  --bg:      #FFFFFF;
  --surface: #F8FAFC;   /* Slate 50 — cards */
  --muted:   #64748B;   /* Slate 500 */
  --border:  #E2E8F0;   /* Slate 200 */
  --red:     #DC2626;
  --green:   #16A34A;
  --amber:   #D97706;
  --radius:  12px;
  --radius-s: 8px;
  --maxw:    1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- Typography ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; color: var(--ink); }
h1 { font-size: 48px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
p  { margin: 0; }
.small, small { font-size: 14px; }
.muted { color: var(--muted); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}

/* ---------- Layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section   { padding: 80px 0; }
.section-sm { padding: 48px 0; }
@media (max-width: 700px) { .section { padding: 48px 0; } }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo { font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--ink); font-size: 15px; font-weight: 500;
  white-space: nowrap; padding: 4px 0; text-decoration: none;
}
.nav-links a:hover { color: var(--blue); }
.nav-links a.active { color: var(--blue); font-weight: 600; }
@media (max-width: 700px) { .nav-links { gap: 16px; } .nav-links a { font-size: 14px; } }

/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: 14px; color: var(--muted);
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--blue); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-s);
  padding: 12px 24px;
  font-family: inherit; font-size: 16px; font-weight: 500;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s ease;
}
.btn:hover { background: var(--blue-d); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

.btn-outline {
  display: inline-block;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 11px 23px;
  font-family: inherit; font-size: 16px; font-weight: 500;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: border-color .15s ease;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

.btn-text-danger {
  background: none; border: none; padding: 4px 8px;
  color: var(--red); font-family: inherit; font-size: 14px; cursor: pointer;
}
.btn-text-danger:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card + .card { margin-top: 16px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--ink); }
.helper { font-size: 13px; color: var(--muted); margin-top: 4px; }
.field-error { font-size: 13px; color: var(--red); margin-top: 4px; }

input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
input.invalid, select.invalid { border-color: var(--red); }
input[type="date"] { min-height: 46px; -webkit-appearance: none; appearance: none; }
input[type="checkbox"] { accent-color: var(--blue); width: 16px; height: 16px; }

.form-row { margin-bottom: 16px; }
/* minmax(0,1fr) + min-width:0 stops native date inputs from overflowing
   their column (default min-width:auto lets them push past the edge). */
.form-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-grid-2 > div { min-width: 0; }
.form-grid-2 input, .form-grid-2 select { min-width: 0; }
@media (max-width: 480px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* Toggle group (Who's travelling?) */
.toggle-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.toggle-group button {
  padding: 10px 4px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.toggle-group button:hover { border-color: var(--blue); }
.toggle-group button.active {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}

/* ---------- Hero (index) ---------- */
.hero { min-height: 80vh; display: flex; align-items: center; padding: 48px 0; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.hero-copy h1 { margin-bottom: 16px; }
.hero-copy p { font-size: 18px; color: var(--muted); max-width: 30rem; }
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Steps (How It Works) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { text-align: center; }
.step .icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--blue); }
.step h3 { margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--muted); }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }

/* Stacked version (how-it-works page) */
.hiw-list { max-width: 800px; margin: 0 auto; }
.hiw-item { text-align: center; padding: 40px 0; border-bottom: 1px solid var(--border); }
.hiw-item:last-of-type { border-bottom: none; }
.hiw-item .icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--blue); }
.hiw-item p { color: var(--muted); max-width: 34rem; margin: 8px auto 0; }

/* ---------- Tabs (My Trips) ---------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin: 24px 0; }
.tabs button {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 500;
  color: var(--muted);
  padding: 10px 2px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }
.tabs button:hover { color: var(--ink); }

/* ---------- Trip cards ---------- */
.trip-card { display: flex; flex-direction: column; gap: 10px; }
.trip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.trip-meta { font-size: 14px; color: var(--muted); }
.trip-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.trip-details { border-top: 1px solid var(--border); padding-top: 12px; font-size: 14px; color: var(--muted); }
.trip-details strong { color: var(--ink); }

.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s ease; }
.progress-fill.over { background: var(--red); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 64px 24px; }
.empty .icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--muted); }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Members / chips ---------- */
.member-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.member-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 8px 6px 14px; font-size: 14px;
}
.member-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; line-height: 1; padding: 2px 6px;
}
.member-chip button:hover { color: var(--red); }

.check-list { display: flex; flex-wrap: wrap; gap: 12px; }
.check-list label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 400; font-size: 14px; margin: 0; cursor: pointer;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
td .btn-text-danger { padding: 0; }

/* ---------- Settlement ---------- */
.settle-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.settle-row:last-child { border-bottom: none; }
.owes { color: var(--red); }
.owed { color: var(--green); }

/* ---------- Planner results ---------- */
.status-box { border-radius: var(--radius); padding: 20px 24px; }
.status-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.status-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }

.spinner {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cost-chips { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.cost-chip {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 10px 16px;
}
.cost-chip .v { font-weight: 600; font-size: 18px; }
.cost-chip .k { font-size: 12px; color: var(--muted); }

.legs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.leg-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 14px 16px; }
.leg-card .route { font-weight: 600; font-size: 15px; }
.leg-card .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* AI itinerary output: the model emits plain HTML; style it here since
   there is no utility framework on the page. Scoped to #itinerary. */
#itinerary h1 { font-size: 26px; margin: 24px 0 10px; }
#itinerary h2 { font-size: 22px; margin: 24px 0 10px; }
#itinerary h3 { font-size: 18px; margin: 18px 0 8px; }
#itinerary p  { margin: 8px 0; color: #334155; }
#itinerary ul, #itinerary ol { padding-left: 22px; margin: 8px 0; }
#itinerary li { margin: 5px 0; color: #334155; }
#itinerary strong { color: var(--ink); }
#itinerary table { margin: 12px 0; background: var(--bg); }
#itinerary th { background: var(--surface); color: var(--ink); }

/* ---------- Logo ---------- */
.nav-logo { display: inline-flex; align-items: center; gap: 8px; }
.nav-logo svg { flex-shrink: 0; }

/* ---------- Intro band ---------- */
.intro { padding: 40px 0; }
.intro h1 { font-size: 30px; }
.intro-sub { color: var(--muted); margin-top: 10px; max-width: 34rem; font-size: 15px; }

/* Heading + description tinted to the SafarBudget logo palette.
   Capped width keeps the text over the strong left scrim, and the soft
   white text-shadow guarantees legibility over the bright hero photo. */
.brand-heading {
  color: #1E3A8A;
  max-width: 15ch;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .7);
}
.brand-heading .brand-accent { color: #2563EB; }
.brand-sub {
  color: #1E3A8A; opacity: .82;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .7);
}
@media (min-width: 768px) {
  .intro { padding: 56px 0; }
  .intro h1 { font-size: 44px; }
  .intro-sub { font-size: 18px; }
}

/* ---------- App grid (12-col) ---------- */
.app-grid {
  display: grid; grid-template-columns: 1fr; gap: 24px;
  padding-top: 24px; padding-bottom: 24px;
}
@media (min-width: 1024px) {
  .app-grid { grid-template-columns: repeat(12, 1fr); gap: 32px; padding-bottom: 48px; }
  .app-sidebar { grid-column: span 4; }
  .app-content { grid-column: span 8; }
  /* Sticky form: adjust inputs without losing sight of results */
  .app-sidebar .form-card { position: sticky; top: 84px; }
}
.app-content > * + * { margin-top: 24px; }
.card-title { font-size: 20px; margin-bottom: 16px; }
.form-card .form-row { margin-bottom: 14px; }

/* Fluid padding on cards + form controls */
.card { padding: 16px; }
@media (min-width: 768px) { .card { padding: 24px; } }

/* ---------- Hero background (Taj Mahal) ----------
   White gradient keeps the left copy and the form card fully readable. */
.hero-bg {
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.99) 0%, rgba(255,255,255,.97) 32%, rgba(255,255,255,.80) 62%, rgba(255,255,255,.45) 100%),
    url('assets/hero-india.jpg');
  background-size: cover;
  background-position: center 60%;
}
.hero-bg .card { background: #fff; box-shadow: 0 8px 30px rgba(15,23,42,.08); }
@media (max-width: 900px) {
  .hero-bg {
    background-image:
      linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.90) 100%),
      url('assets/hero-india.jpg');
  }
}

/* ---------- Destination guide ---------- */
.guide-head { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .guide-head { grid-template-columns: 1fr; } }
.guide-img {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, #E2E8F0, #CBD5E1);   /* holds shape while loading */
}
.guide-img img { width: 100%; height: 100%; object-fit: cover; }

.places-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .places-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .places-grid { grid-template-columns: 1fr; } }
.place-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 16px;
}
.badge-tag {
  font-size: 11px; font-weight: 600; color: var(--blue);
  border: 1px solid var(--blue); border-radius: 999px;
  padding: 2px 10px; white-space: nowrap; flex-shrink: 0;
}
.tip { color: var(--muted); border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }

/* ---------- Booking links & stay tiers ---------- */
.book-link { font-size: 14px; font-weight: 500; color: var(--blue); display: inline-block; margin-top: 8px; }
.leg-card .book-link { margin-top: 10px; }

.stay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 800px) { .stay-grid { grid-template-columns: 1fr; } }
.stay-card {
  display: block; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 16px; color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.stay-card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(59,130,246,.12); text-decoration: none; }
.stay-card.fits { border-color: var(--green); }
.badge-fit {
  font-size: 11px; font-weight: 600; color: var(--green);
  border: 1px solid var(--green); border-radius: 999px;
  padding: 2px 10px; white-space: nowrap;
}

/* ---------- Budget bars (2x2) ---------- */
.bars-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .bars-grid { grid-template-columns: 1fr 1fr; } }
.bar-item .bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bar-item .bar-name { font-size: 14px; font-weight: 500; }
.bar-item .bar-name .em { margin-right: 6px; }
.bar-item .bar-amt { font-size: 15px; font-weight: 600; }
.bar-track { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; width: 0; transition: width .6s cubic-bezier(.22,1,.36,1); }
.bar-fill.c-transit { background: #3B82F6; }
.bar-fill.c-stay    { background: #10B981; }
.bar-fill.c-food    { background: #F59E0B; }
.bar-fill.c-act     { background: #A855F7; }
.bar-item .bar-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- CTA row (affiliate) ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta {
  flex: 1 1 160px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-s);
  font-size: 14px; font-weight: 600; text-decoration: none; text-align: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.cta:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(59,130,246,.12); text-decoration: none; }
.cta.cta-wa { background: #25D366; border-color: #25D366; color: #fff; }
.cta.cta-wa:hover { background: #1EBE5A; box-shadow: 0 4px 14px rgba(37,211,102,.28); }

.btn-wa { background: #25D366; }
.btn-wa:hover { background: #1EBE5A; }

.summary-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* ---------- Feasibility warnings ---------- */
.warn-banner {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #92400E;
  border-radius: var(--radius-s);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}
.warn-banner .btn { display: block; margin-top: 10px; }
.field-warn { font-size: 13px; color: #B45309; margin-top: 4px; }

/* ---------- Day-by-day accordion ---------- */
.acc-item { border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; }
.acc-item + .acc-item { margin-top: 10px; }
.acc-head {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: none;
  padding: 14px 16px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.acc-head:hover { background: #F1F5F9; }
.acc-head .chev { transition: transform .2s ease; color: var(--muted); flex-shrink: 0; }
.acc-item.open .acc-head .chev { transform: rotate(180deg); }
.acc-body { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.acc-item.open .acc-body { padding: 8px 16px 16px; max-height: 1400px; }
.acc-body p, .acc-body li { color: #334155; }

/* When the accordion is used, hide the raw dump; otherwise show it */
.itinerary-full.dupe { display: none; }

/* ---------- Sticky mobile bar ---------- */
.mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(15, 23, 42, .94);
  backdrop-filter: blur(8px);
  border-top: 1px solid #1E293B;
}
.mobile-bar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mobile-bar-label { font-size: 11px; color: #94A3B8; }
.mobile-bar-total { font-size: 20px; font-weight: 600; color: #fff; }
.mobile-bar .btn { padding: 10px 16px; font-size: 14px; }
@media (min-width: 1024px) { .mobile-bar { display: none !important; } }
/* Keep content clear of the fixed bar on mobile */
body.has-mobile-bar { padding-bottom: 76px; }
@media (min-width: 1024px) { body.has-mobile-bar { padding-bottom: 0; } }

/* ---------- Utility ---------- */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
