/* ============================================
   MHI Travel Companion — Design Tokens
   Primary:   #004aad (brand blue)
   Ink:       #0b1d3a (deep navy text)
   Accent:    #ffcc33 (warmer, richer gold than stock yellow)
   Surface:   #f7f8fb (app background)
   Card:      #ffffff
   Line:      #e3e7f0
   Success:   #1a8a5f (checklist / confirmations)
   Display font: Fraunces (headlines, stamps, numerals)
   Body font:    Inter (UI, body copy)
   ============================================ */

:root {
  --brand: #004aad;
  --brand-dark: #00347d;
  --ink: #0b1d3a;
  --accent: #ffcc33;
  --accent-ink: #4a3600;
  --surface: #f7f8fb;
  --card: #ffffff;
  --line: #e3e7f0;
  --muted: #5b6b8c;
  --success: #1a8a5f;
  --success-bg: #e9f7f1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11,29,58,0.04), 0 6px 20px rgba(11,29,58,0.06);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --ink: #e8ecf4;
  --accent: #ffcc33;
  --accent-ink: #4a3600;
  --surface: #0f1420;
  --card: #171d2c;
  --line: #2a3244;
  --muted: #93a1bd;
  --success: #34c98d;
  --success-bg: #12291f;
}

[data-theme="dark"] body { background-color: var(--surface); color: var(--ink); }
[data-theme="dark"] .disclosure-banner { background: #2b2410; border-color: #4a3f1a; color: #f0d878; }
[data-theme="dark"] .locked-card { background: var(--card); }

.theme-toggle-btn {
  background: none;
  border: 1.5px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.theme-toggle-btn:hover { background: var(--surface); }

* { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  background-color: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Splash Screen ---------- */
#splashScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, var(--brand-dark), #001d4d 75%);
  color: #fff;
  gap: 6px;
  animation: fadeIn 0.4s ease;
}
.splash-logo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  margin-bottom: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  animation: stampIn 0.6s cubic-bezier(.2,.9,.3,1.3);
}
.splash-stamp {
  color: var(--accent);
  margin-bottom: 18px;
  animation: stampIn 0.6s cubic-bezier(.2,.9,.3,1.3);
}
#splashScreen h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0;
  letter-spacing: 0.3px;
}
.splash-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  opacity: 0.75;
  margin: 4px 0 0;
  font-size: 15px;
}
@keyframes stampIn {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.hidden { display: none !important; }

/* ---------- App Header ---------- */
#appHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.brand-stamp { font-size: 20px; color: var(--brand); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
}
.upgrade-pill {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.upgrade-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,204,51,0.4); }

/* ---------- Navigation ---------- */
#mainNav {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  background: var(--brand);
  padding: 0 12px;
  scrollbar-width: none;
}
#mainNav::-webkit-scrollbar { display: none; }
#mainNav button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  padding: 14px 14px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
#mainNav button:hover { color: #fff; }
#mainNav button.nav-active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ---------- Panels ---------- */
main#panelWrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.panel { display: none; padding: 24px 0 0; }
.panel.active { display: block; animation: fadeIn 0.25s ease; }

.panel-header { margin-bottom: 22px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 20px;
  background: #fff;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.back-link:hover {
  background: var(--brand);
  color: #fff;
  transform: translateX(-2px);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 6px;
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.panel-header p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  max-width: 60ch;
}

/* ---------- Cards / Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}
.card p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.5; }
.card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,74,173,0.12);
  border-color: var(--brand);
}

/* ---------- Trip Cards ---------- */
.trip-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}
.trip-card-main { display: flex; align-items: center; gap: 14px; }
.trip-stamp {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px dashed var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.trip-info h4 { margin: 0 0 3px; font-size: 15px; font-weight: 700; }
.trip-info span { color: var(--muted); font-size: 13px; }
.trip-remove {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; text-decoration: underline;
  padding: 6px;
}
.trip-remove:hover { color: #b3261e; }

.empty-state {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
}
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* ---------------- Credential status ---------------- */
.cred-expired { color: #b3261e; font-weight: 700; }
.cred-soon { color: #a15c00; font-weight: 700; }
.cred-valid { color: var(--success); font-weight: 600; }
.cred-neutral { color: var(--muted); }

/* ---------- Forms ---------- */
.field-group { margin-bottom: 16px; }
.field-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--ink);
}
select, input[type="text"], input[type="date"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- Checklist ---------- */
#dynamicChecklist ul { list-style: none; padding-left: 0; margin-top: 16px; }
#dynamicChecklist li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
#dynamicChecklist li input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ---------- Locked / Premium gating ---------- */
.locked-card {
  position: relative;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
}
.locked-card .lock-icon { font-size: 22px; margin-bottom: 8px; display: block; }
.locked-card strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.locked-card .btn-primary { margin-top: 14px; }

/* ---------- Premium Hub ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.price-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,204,51,0.25), var(--shadow);
  position: relative;
}
.price-card.featured::before {
  content: "MOST POPULAR";
  position: absolute; top: -11px; left: 20px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px;
  padding: 4px 10px; border-radius: 999px;
}
.price-card h3 { font-family: var(--font-display); font-size: 20px; margin: 6px 0 2px; }
.price-amount { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--brand); margin: 8px 0; }
.price-amount span { font-size: 14px; font-weight: 500; color: var(--muted); font-family: var(--font-body); }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 20px; }
.price-card li { padding: 7px 0; font-size: 14px; color: var(--ink); display: flex; gap: 8px; }
.price-card li::before { content: "✓"; color: var(--success); font-weight: 700; }
.price-card .btn-primary, .price-card .btn-secondary { width: 100%; }

/* ---------- Marketplace / Affiliate ---------- */
.disclosure-banner {
  background: #fff8e6;
  border: 1px solid #f2d788;
  color: #6b5300;
  font-size: 13px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  line-height: 1.5;
}
.booking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.booking-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.booking-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.booking-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--brand); text-transform: uppercase; margin-bottom: 6px;
}
.booking-card h4 { margin: 0 0 6px; font-size: 15.5px; font-family: var(--font-display); }
.booking-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; flex: 1; }
.booking-card a.btn-secondary { text-align: center; text-decoration: none; display: block; }

/* ---------- Coming Soon ---------- */
.coming-soon {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.coming-soon .stamp-badge {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px dashed var(--brand); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
.coming-soon h3 { color: var(--ink); font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; }

/* ---------- Auth Screen ---------- */
#authScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 20%, var(--brand-dark), #001d4d 80%);
  padding: 24px;
}
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  text-align: center;
}
.auth-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 2px solid var(--line);
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.auth-card > p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}
.auth-card .field-group { text-align: left; }
.auth-error {
  background: #fdeceb;
  border: 1px solid #f2b8b3;
  color: #7a2620;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: left;
}
.auth-notice {
  background: #eef3ff;
  border: 1px solid #c7d7fb;
  color: #1d3d8f;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: left;
}
.auth-toggle {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-toggle-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  font-size: 13.5px;
  padding: 0;
  margin-left: 4px;
  text-decoration: underline;
}

/* ---------- Includes / See Details ---------- */
.includes-details {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--surface);
}
.includes-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.includes-details summary::-webkit-details-marker { display: none; }
.includes-details summary::before {
  content: "▸";
  transition: transform 0.15s ease;
  font-size: 11px;
}
.includes-details[open] summary::before { transform: rotate(90deg); }
.includes-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.includes-list li {
  font-size: 13.5px;
  color: var(--ink);
  padding: 6px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}
.includes-list li::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  .panel-header h2 { font-size: 24px; }
  main#panelWrap { padding: 0 14px 50px; }
}
