/* Shared styles — matches the live gettravelbuddies.com landing page brand:
   pine teal + marigold + coral, white cards, Nunito throughout. */

:root {
  /* Brand tokens, pulled from gettravelbuddies.com's own CSS */
  --teal: #0F5C5A;
  --teal-deep: #0A4341;
  --marigold: #F2A93B;
  --marigold-deep: #C97F12;
  --coral: #E4572E;
  --ink: #13312F;
  --muted: #4A5F5C;
  --mist: #EEF4F2;
  --line: #D3E2DF;

  /* App roles — same tokens, named for how this app's CSS already uses them */
  --accent: var(--teal);
  --accent-dark: var(--teal-deep);
  --bg: var(--mist);
  --surface: #ffffff;
  --surface-alt: #E3ECEA;
  --card-border: var(--line);
  --text-main: var(--ink);
  --text-sub: var(--muted);
  --text-faint: #7C928F;
  --text-body: var(--ink);
  --icon: var(--teal);
  --warn-bg: #FCEFD9;
  --warn-text: var(--marigold-deep);
  --ok-bg: #ECF6F0;
  --ok-text: #166534;
  --danger-bg: #FEE2E2;
  --danger-text: #B91C1C;
  color-scheme: light;
}

/* Dark mode — same brand hues (teal/coral/marigold untouched), just the
   surfaces/text/semantic-background roles flipped for a dark page.
   Applied either by explicit choice (data-theme="dark", set by js/theme.js
   and persisted) or, with no saved choice yet, by the system's own
   light/dark setting. */
[data-theme="dark"] {
  --accent: #19857F;
  --accent-dark: var(--teal);
  --bg: #0B211F;
  --surface: #123330;
  --surface-alt: #1A3E3B;
  --card-border: #234B46;
  --text-main: #F2F7F5;
  --text-sub: #9FC1BC;
  --text-faint: #6F928C;
  --text-body: #F2F7F5;
  --icon: #5FC9C2;
  --warn-bg: #3A2C12;
  --warn-text: #F2C879;
  --ok-bg: #16302A;
  --ok-text: #6FDB9C;
  --danger-bg: #3A1515;
  --danger-text: #F6A5A5;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --accent: #19857F;
    --accent-dark: var(--teal);
    --bg: #0B211F;
    --surface: #123330;
    --surface-alt: #1A3E3B;
    --card-border: #234B46;
    --text-main: #F2F7F5;
    --text-sub: #9FC1BC;
    --text-faint: #6F928C;
    --text-body: #F2F7F5;
    --icon: #5FC9C2;
    --warn-bg: #3A2C12;
    --warn-text: #F2C879;
    --ok-bg: #16302A;
    --ok-text: #6FDB9C;
    --danger-bg: #3A1515;
    --danger-text: #F6A5A5;
    color-scheme: dark;
  }
}

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

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--text-main);
  min-height: 100vh;
}

.page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 18px;
}
.brand-name span { color: var(--teal); }

.brand-compact { gap: 7px; }
.brand-compact .brand-mark { width: 26px; height: 26px; border-radius: 7px; }
.brand-compact .brand-mark svg { width: 16px; height: 16px; }
.brand-compact .brand-name { font-size: 14px; }

h1, h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}
h1 { font-size: 25px; line-height: 1.22; font-weight: 900; }
h2 { font-size: 18px; }

p.lead {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-sub);
}

.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-body);
  line-height: 1.4;
}
label.check input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--text-body); }
.field input, .field textarea, .field select {
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-main);
  background: var(--surface);
  font-family: 'Nunito', sans-serif;
  width: 100%;
}
.field textarea { height: 64px; padding: 10px 14px; resize: none; }
.field select { appearance: auto; cursor: pointer; }

/* Simple top-of-page back arrow, for sub-pages reached from one place
   (e.g. chat.html from mine.html) that don't carry the bottom nav. */
.back-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-row a.back-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-body);
  text-decoration: none;
  font-size: 16px;
  flex: none;
}
.back-row h2 { margin: 0; }

.row { display: flex; gap: 10px; }
.row .field { flex: 1; }

button.primary {
  height: 50px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}
button.primary:disabled { opacity: .5; cursor: default; }
button.primary:hover:not(:disabled) { background: var(--accent-dark); }

button.secondary {
  height: 50px;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}

button.small {
  height: 38px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}
button.small.outline {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.fine-print {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-faint);
  text-align: center;
}

.footer-note {
  margin-top: auto;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  padding-top: 6px;
}

.tabs {
  display: flex;
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 4px;
}
.tabs .tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: 'Nunito', sans-serif;
}
.tabs .tab.active { background: var(--accent); color: #fff; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--text-body);
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  font-family: 'Nunito', sans-serif;
}
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.banner-warn {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 12px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--warn-text);
}
.banner-ok {
  display: flex; gap: 9px; align-items: center;
  background: var(--ok-bg);
  border-radius: 12px;
  padding: 12px;
  font-size: 12.5px;
  color: var(--ok-text);
}

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--card-border);
  border-radius: 12px; height: 46px; padding: 0 14px;
}
.search-bar input {
  border: none; outline: none; font-size: 13.5px; width: 100%;
  font-family: 'Nunito', sans-serif; background: transparent;
}

.result-card {
  background: var(--surface); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.result-card.disabled { opacity: .55; }
.result-head { display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--card-border); color: var(--text-body);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.result-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.result-sub { font-size: 11.5px; color: var(--text-faint); }
.result-detail { font-size: 12.5px; color: var(--text-sub); }

.verified-badge { color: var(--accent); }

.decl-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
.decl-photo { height: 150px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; }
.decl-rows { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.decl-row { display: flex; justify-content: space-between; font-size: 13px; }
.decl-row span:first-child { color: var(--text-sub); }
.decl-row span:last-child { color: var(--text-main); font-weight: 600; }

.step-list { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.step-text { font-size: 13.5px; color: var(--text-body); line-height: 1.4; padding-top: 2px; }

/* Profile → settings-style list rows (legal & policies links, etc.) */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  width: 100%;
  text-align: left;
}
.settings-row:not(:last-child) { border-bottom: 1px solid var(--card-border); }
.settings-row .chevron { color: var(--text-faint); font-size: 16px; flex: none; }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-faint); margin: 0; }

/* Policies page: banned-items categories */
.policy-category { display: flex; flex-direction: column; gap: 4px; }
.policy-category .cat-title { font-size: 13px; font-weight: 600; color: var(--text-main); }
.policy-category .cat-terms { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; }

.chat-log { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; padding: 4px 0; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--surface); border: 1px solid var(--card-border); color: var(--text-main); border-bottom-left-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row textarea { flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--card-border); padding: 10px 14px; font-size: 13.5px; font-family: 'Nunito', sans-serif; resize: none; }
.chat-input-row button { width: 70px; flex: none; }

.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-pill.requested, .status-pill.declared { background: var(--warn-bg); color: var(--warn-text); }
.status-pill.accepted { background: var(--ok-bg); color: var(--ok-text); }
.status-pill.delivered { background: var(--ok-bg); color: var(--ok-text); }
.status-pill.refused, .status-pill.cancelled { background: var(--danger-bg); color: var(--danger-text); }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--card-border); }
table.admin-table th { color: var(--text-sub); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }

.error-text { font-size: 12.5px; color: var(--danger-text); margin: 0; }
.link-muted {
  text-align: center; font-size: 11.5px; color: var(--text-faint);
  text-decoration: underline; cursor: pointer; background: none; border: none;
  font-family: 'Nunito', sans-serif;
}

/* Coming Soon page */
.soon-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.soon-card .soon-title { font-size: 14.5px; font-weight: 700; color: var(--text-main); }
.soon-card .soon-desc { margin: 0; font-size: 12.5px; color: var(--text-sub); line-height: 1.5; }
.soon-notify {
  align-self: flex-start;
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid var(--marigold-deep);
  background: var(--surface);
  color: var(--marigold-deep);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}
.soon-notify:hover:not(:disabled) { background: #FCEFD9; }
.soon-notify.is-notified {
  border-color: var(--ok-text);
  color: var(--ok-text);
  background: var(--ok-bg);
  cursor: default;
}

/* Dark-mode toggle row (profile.html) */
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 2px;
}
.theme-row .theme-label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: var(--text-body); }
.theme-switch {
  position: relative;
  width: 46px; height: 27px;
  border-radius: 999px;
  border: none;
  background: var(--card-border);
  cursor: pointer;
  flex: none;
  padding: 0;
}
.theme-switch .knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--surface);
  transition: left .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.theme-switch.on { background: var(--accent); }
.theme-switch.on .knob { left: 22px; }

/* Bottom nav — only on pages that set <body data-nav="..."> (js/nav.js) */
body.has-bottom-nav .page { padding-bottom: 92px; }

.tb-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--card-border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
}
.tb-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 2px;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}
.tb-nav-item.active { color: var(--accent); }
.tb-nav-item svg { color: inherit; }
