/* =================================================================
   Safiri Trails — Design System
   Palette:  forest #1B4332 · sand #E8DCC4 · coral #E76F51
             ink #16202A · cream #FBF8F3 · teal #2A6F77
   Type:     Fraunces (display) · Inter (body/UI) · JetBrains Mono (data)
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --forest: #1B4332;
  --forest-dark: #123024;
  --sand: #E8DCC4;
  --coral: #E76F51;
  --coral-dark: #d15a3c;
  --ink: #16202A;
  --cream: #FBF8F3;
  --teal: #2A6F77;
  --line: #E4DED0;
  --muted: #6b7280;
  --white: #ffffff;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(22, 32, 42, 0.18);
  --shadow-sm: 0 4px 12px -4px rgba(22, 32, 42, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }

a { color: inherit; }

button { font-family: var(--font-body); cursor: pointer; }

::selection { background: var(--coral); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

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

/* ---------------------------------------------------------------
   AUTH PAGES (login / register)
   --------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-brand {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(232, 220, 196, 0.14), transparent 45%),
    linear-gradient(160deg, var(--forest) 0%, var(--forest-dark) 100%);
  color: var(--sand);
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-brand svg.route-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
}

.brand-mark { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }

.brand-stamp {
  width: 44px; height: 44px;
  border: 2px dashed var(--sand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-brand-copy { position: relative; z-index: 1; max-width: 440px; }

.auth-brand-copy .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 18px;
  display: block;
}

.auth-brand-copy h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 500;
  color: var(--white);
}

.auth-brand-copy p {
  margin-top: 18px;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(232, 220, 196, 0.85);
}

.auth-stats {
  position: relative; z-index: 1;
  display: flex; gap: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(232, 220, 196, 0.25);
}

.auth-stats .stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--white);
}
.auth-stats .stat span {
  font-size: 12.5px;
  color: rgba(232, 220, 196, 0.7);
}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  background: var(--cream);
}

.auth-card { width: 100%; max-width: 400px; }

.auth-card .mobile-brand { display: none; }

.auth-card h2 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 30px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 111, 119, 0.14);
}

.field.has-error input { border-color: var(--coral); }
.field .error-msg {
  display: none;
  color: var(--coral-dark);
  font-size: 12.5px;
  margin-top: 5px;
}
.field.has-error .error-msg { display: block; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 13px; color: var(--muted);
  padding: 4px 6px;
}

.pw-strength {
  height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden;
}
.pw-strength-fill {
  height: 100%; width: 0%; background: var(--coral); transition: width 0.2s, background 0.2s;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--forest);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--forest-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.form-note {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}
.form-note a { color: var(--teal); font-weight: 600; text-decoration: none; }
.form-note a:hover { text-decoration: underline; }

.banner {
  display: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  align-items: center; gap: 8px;
}
.banner.show { display: flex; }
.banner.error { background: #fdeceae6; color: #a4382a; border: 1px solid #f4c7bd; }
.banner.success { background: #e7f3ea; color: #1e5e39; border: 1px solid #bfe2cb; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.spinner.show { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card .mobile-brand {
    display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
  }
  .auth-card .mobile-brand .brand-stamp {
    border-color: var(--forest); color: var(--forest);
  }
  .auth-card .mobile-brand .brand-name { color: var(--forest); }
}

/* ---------------------------------------------------------------
   DASHBOARD SHELL
   --------------------------------------------------------------- */
.dash-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--forest);
  color: var(--sand);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand-mark { padding: 0 8px 26px; border-bottom: 1px solid rgba(232,220,196,0.18); margin-bottom: 18px; }
.sidebar .brand-name { color: var(--white); font-size: 18px; }
.sidebar .brand-stamp { width: 36px; height: 36px; font-size: 16px; }

.nav-list { list-style: none; padding: 0; margin: 0; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 500;
  color: rgba(232,220,196,0.8);
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.15s, color 0.15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item .icon { font-size: 17px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active { background: var(--coral); color: var(--white); }

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.28); }

.sidebar-footer {
  border-top: 1px solid rgba(232,220,196,0.18);
  padding-top: 14px;
}

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  background: none; border: 1px solid rgba(232,220,196,0.3);
  border-radius: var(--radius-sm);
  color: var(--sand); font-size: 14px; font-weight: 500;
}
.logout-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* Main column */
.dash-main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}

.hamburger {
  display: none;
  background: none; border: none; font-size: 22px; color: var(--ink);
}

.topbar-search {
  flex: 1; max-width: 420px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  background: var(--cream);
}
.topbar-search input:focus { outline: none; border-color: var(--teal); background: var(--white); }
.topbar-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.icon-btn:hover { background: var(--cream); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--coral);
  border: 1.5px solid var(--white);
  display: none;
}
.icon-btn .dot.show { display: block; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--forest));
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; font-family: var(--font-display);
}
.user-chip .name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.user-chip .role { font-size: 11.5px; color: var(--muted); }

.dash-content { padding: 26px 28px 60px; flex: 1; }

.view { display: none; animation: fadeUp 0.35s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.view-header { margin-bottom: 22px; }
.view-header h1 { font-size: 24px; font-weight: 500; }
.view-header p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Notification dropdown */
.dropdown-panel {
  position: absolute; top: 54px; right: 28px;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 40; display: none;
}
.dropdown-panel.show { display: block; }
.dropdown-panel .dp-head { padding: 14px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item .t { font-weight: 600; margin-bottom: 2px; }
.notif-item .d { color: var(--muted); font-size: 12px; }
.dp-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------
   OVERVIEW — stat cards + route line signature
   --------------------------------------------------------------- */
.route-strip { position: relative; margin-bottom: 30px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  position: relative;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--coral);
}
.stat-card .icon { font-size: 20px; margin-bottom: 10px; display: block; }
.stat-card .value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--forest); }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.route-line {
  display: none;
}
@media (min-width: 901px) {
  .route-line {
    display: block;
    position: absolute;
    top: -12px; left: 6%; right: 6%;
    height: 12px;
    border-top: 2px dashed var(--sand);
    z-index: -1;
  }
}

.section-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.section-block h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.section-block h3 .see-all { font-size: 12.5px; font-weight: 500; color: var(--teal); cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }

.mini-booking-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.mini-booking-row:last-child { border-bottom: none; }
.mini-emoji { font-size: 22px; }
.mini-booking-row .info { flex: 1; min-width: 0; }
.mini-booking-row .info .n { font-weight: 600; font-size: 13.5px; }
.mini-booking-row .info .d { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------
   DESTINATION CARDS (Explore + Wishlist)
   --------------------------------------------------------------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 13px; font-weight: 500;
  color: var(--ink);
}
.chip.active { background: var(--forest); color: var(--white); border-color: var(--forest); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.dest-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.dest-media {
  height: 130px;
  background: linear-gradient(135deg, var(--teal), var(--forest));
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  position: relative;
}
.dest-media .wish-btn {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.dest-media .wish-btn.active { background: var(--coral); color: var(--white); }
.dest-media .cat-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(22,32,42,0.55); color: var(--white);
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}

.dest-body { padding: 15px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.dest-body h4 { font-size: 15.5px; font-weight: 600; margin-bottom: 3px; }
.dest-body .loc { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.dest-body .desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; flex: 1; }

.dest-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dest-price { font-family: var(--font-mono); font-weight: 600; color: var(--forest); font-size: 15px; }
.dest-price span { font-size: 11px; color: var(--muted); font-family: var(--font-body); }
.dest-rating { font-size: 12.5px; color: var(--muted); }

.btn-book {
  width: 100%; padding: 10px;
  background: var(--coral); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px;
}
.btn-book:hover { background: var(--coral-dark); }

.btn-remove {
  width: 100%; padding: 10px;
  background: none; color: var(--coral-dark);
  border: 1.5px solid var(--coral); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px;
}
.btn-remove:hover { background: #fdeceae6; }

/* ---------------------------------------------------------------
   BOOKINGS LIST + STATUS STAMPS
   --------------------------------------------------------------- */
.booking-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.booking-card .mini-emoji { font-size: 30px; }
.booking-card .info { flex: 1; min-width: 0; }
.booking-card .info h4 { font-size: 15px; font-weight: 600; }
.booking-card .info .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.booking-card .price { font-family: var(--font-mono); font-weight: 600; color: var(--forest); font-size: 14px; white-space: nowrap; }

.stamp {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1.5px dashed currentColor;
  white-space: nowrap;
}
.stamp.pending   { color: #b7791f; background: #fff8e6; }
.stamp.confirmed { color: var(--teal); background: #e7f2f2; }
.stamp.completed { color: var(--forest); background: #e7f0ea; }
.stamp.cancelled { color: var(--coral-dark); background: #fdeceae6; }

.cancel-link {
  background: none; border: none; color: var(--coral-dark);
  font-size: 12.5px; font-weight: 600; text-decoration: underline;
  white-space: nowrap;
}

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* ---------------------------------------------------------------
   PROFILE
   --------------------------------------------------------------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-head .since { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }

/* ---------------------------------------------------------------
   MODAL
   --------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,32,42,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 440px; padding: 26px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
}
.modal-box .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-box h3 { font-size: 19px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); }
.modal-box .modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-row.total { font-weight: 700; color: var(--forest); border-bottom: none; padding-top: 12px; }

/* ---------------------------------------------------------------
   TOASTS
   --------------------------------------------------------------- */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--ink); color: var(--white);
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  min-width: 240px;
  animation: toastIn 0.25s ease;
}
.toast.success { border-left: 3px solid #4ade80; }
.toast.error { border-left: 3px solid var(--coral); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -260px; top: 0; width: 240px; z-index: 90;
    transition: left 0.2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { left: 0; }
  .hamburger { display: block; }
  .topbar-search { display: none; }
  .dash-content { padding: 20px 16px 60px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .dropdown-panel { right: 16px; width: calc(100% - 32px); }
}

@media (max-width: 520px) {
  .stat-row { grid-template-columns: 1fr; }
  .user-chip .name, .user-chip .role { display: none; }
  .booking-card { flex-wrap: wrap; }
}

.sidebar-scrim {
  display: none;
  position: fixed; inset: 0; background: rgba(22,32,42,0.4); z-index: 80;
}
.sidebar-scrim.show { display: block; }
