/* Pitstop design system - warm road-trip aesthetic
   Fonts: Anton (display), Archivo (UI), Permanent Marker (accent)
   Accent: Highway Red #E23B26 */

:root {
  --ink: #1C1815;
  --paper: #EFE6D6;
  --on-dark: #F4ECDD;
  --muted-dark: #B7A98F;
  --muted-dark-2: #CBBDA2;
  --muted-light: #8C7E68;
  --muted-light-2: #9A8868;
  --accent: #E23B26;
  --amber: #F4B528;
  --green: #2F8F5B;
  --red: #E23B26;
}

/* Per-trip accent themes (all share the Pitstop look, just a different accent) */
[data-theme="red"] { --accent: #E23B26; }
[data-theme="blue"] { --accent: #2D6CA2; }
[data-theme="green"] { --accent: #2F8F5B; }
[data-theme="purple"] { --accent: #7A4FB5; }
[data-theme="orange"] { --accent: #C8741C; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #EFE6D6;
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea { font-family: inherit; }
input:focus, textarea:focus { outline: none; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(24px, -30px); } }
::selection { background: var(--amber); }

/* Animated background blobs */
.bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(165deg, #F3EBD9, #E9DDC6);
}
.blob { position: absolute; border-radius: 50%; }
.blob.b1 { width: 460px; height: 460px; left: -120px; top: -140px; background: radial-gradient(circle, rgba(242,138,76,.55), transparent 68%); filter: blur(34px); animation: floaty 17s ease-in-out infinite; }
.blob.b2 { width: 520px; height: 520px; right: -160px; top: 40px; background: radial-gradient(circle, rgba(96,156,204,.5), transparent 68%); filter: blur(40px); animation: floaty 21s ease-in-out infinite reverse; }
.blob.b3 { width: 480px; height: 480px; left: 20%; bottom: -200px; background: radial-gradient(circle, rgba(120,178,118,.5), transparent 68%); filter: blur(40px); animation: floaty 25s ease-in-out infinite; }
.blob.b4 { width: 300px; height: 300px; right: 18%; bottom: 8%; background: radial-gradient(circle, rgba(226,59,38,.4), transparent 70%); filter: blur(36px); animation: floaty 19s ease-in-out infinite reverse; }

.stage { position: relative; z-index: 1; min-height: 100vh; }

/* Logo lockup */
.logo { display: flex; align-items: center; gap: 12px; }
.logo__mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(28,23,18,.85); border: 1px solid rgba(255,255,255,.18);
  color: var(--on-dark); display: flex; align-items: center; justify-content: center;
  font-size: 25px; transform: rotate(-4deg); flex: none;
}
.logo__name { font-family: "Anton", sans-serif; font-size: 23px; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
.logo__tag { font-family: "Permanent Marker", cursive; font-size: 12px; color: var(--muted-light-2); margin-top: 3px; }

/* Cards */
.card-dark {
  background: linear-gradient(155deg, rgba(28,23,18,.86), rgba(28,23,18,.72));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 24px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); color: var(--on-dark);
}
.card-light {
  background: rgba(255,255,255,.49);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,.6); border-radius: 20px;
  box-shadow: 0 22px 48px -32px rgba(40,28,16,.55);
}

/* Type helpers */
.kicker { font-family: "Permanent Marker", cursive; font-size: 14px; color: var(--amber); }
.display { font-family: "Anton", sans-serif; text-transform: uppercase; line-height: .95; }
.flabel { font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); }

/* Tab switcher */
.switch { display: flex; background: rgba(244,236,221,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 30px; padding: 4px; }
.switch button {
  flex: 1; font-family: "Anton", sans-serif; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; border: none; cursor: pointer; border-radius: 30px; padding: 10px 0;
  background: transparent; color: rgba(244,236,221,.55); transition: background .15s, color .15s;
}
.switch button.active { background: rgba(244,236,221,.92); color: var(--ink); }

/* Inputs (on dark) */
.in-dark {
  width: 100%; font-size: 15px; padding: 13px 14px;
  border: 1px solid rgba(244,236,221,.2); border-radius: 13px;
  background: rgba(244,236,221,.08); color: var(--on-dark);
}
.in-dark::placeholder { color: rgba(244,236,221,.4); }
.in-dark:focus { border-color: rgba(244,236,221,.55); }

/* Buttons */
.btn-accent {
  font-family: "Anton", sans-serif; font-size: 17px; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--accent); border: none; border-radius: 14px; padding: 15px 0;
  cursor: pointer; width: 100%; box-shadow: 0 14px 30px -14px var(--accent);
  transition: opacity .15s, transform .15s;
}
.btn-accent:hover { transform: translateY(-1px); }
.btn-accent:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-light {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--ink); background: rgba(244,236,221,.92);
  border: none; border-radius: 13px; padding: 11px 16px; cursor: pointer;
}
.btn-pill {
  font-family: "Anton", sans-serif; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(28,23,18,.06); color: var(--ink); border: 1px solid rgba(28,23,18,.14);
  border-radius: 30px; padding: 8px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s;
}
.btn-pill:hover { background: rgba(28,23,18,.12); }

/* Error / hint */
.err-msg { color: #ffb3a8; font-size: 13px; min-height: 0; margin: 0; display: none; }
.err-msg.show { display: block; margin-top: 12px; }

/* Section label row */
.sec-row { display: flex; align-items: center; gap: 12px; margin: 26px 2px 14px; }
.sec-row__label { font-family: "Anton", sans-serif; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.sec-row__rule { flex: 1; height: 2px; background: rgba(28,23,18,.14); }
.sec-row__count { font-family: "Permanent Marker", cursive; font-size: 14px; color: var(--accent); }

/* Trip grid + cards */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.trip {
  display: block; text-decoration: none; color: inherit; overflow: hidden; border-radius: 20px;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s;
}
.trip:hover { transform: translateY(-5px) rotate(0deg) !important; box-shadow: 0 28px 54px -26px rgba(40,28,16,.6); }
.trip__head {
  background: linear-gradient(150deg, rgba(24,20,16,.9), rgba(24,20,16,.8));
  color: var(--on-dark); padding: 16px 16px 18px; position: relative;
}
.trip__count {
  position: absolute; top: 14px; right: 14px; font-family: "Anton", sans-serif;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 30px;
}
.trip__count.soon { background: var(--amber); color: var(--ink); }
.trip__count.today { background: var(--red); color: #fff; }
.trip__count.past { background: rgba(244,236,221,.18); color: var(--muted-dark-2); }
.trip__emoji { font-size: 34px; line-height: 1; }
.trip__name { font-family: "Anton", sans-serif; font-size: 30px; text-transform: uppercase; line-height: 1; margin-top: 8px; }
.trip__date { font-weight: 700; font-size: 11px; letter-spacing: .07em; color: var(--muted-dark); margin-top: 8px; text-transform: uppercase; }
.trip__body { padding: 14px 16px 16px; }
.trip__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font-weight: 700; font-size: 10.5px; background: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.7); border-radius: 7px; padding: 4px 9px; color: var(--ink);
}
.trip__open { font-family: "Anton", sans-serif; font-size: 14px; text-transform: uppercase; color: var(--accent); }

/* Add card */
.add-card {
  border: 2px dashed rgba(28,23,18,.25); border-radius: 20px; background: rgba(255,255,255,.25);
  min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; text-decoration: none; color: var(--muted-light); transition: border-color .15s, color .15s;
}
.add-card:hover { border-color: var(--ink); color: var(--ink); }
.add-card__plus { width: 46px; height: 46px; border-radius: 50%; border: 2px dashed currentColor; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.add-card__title { font-family: "Anton", sans-serif; font-size: 17px; text-transform: uppercase; }
.add-card__sub { font-family: "Permanent Marker", cursive; font-size: 12px; }

/* Avatar stack */
.crew { display: flex; align-items: center; gap: 8px; }
.crew__stack { display: flex; }
.crew__face {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: #fff; margin-left: -9px;
}
.crew__face:first-child { margin-left: 0; }
.crew__count { font-weight: 700; font-size: 12px; color: var(--muted-light); }

/* Header bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 24px 0 8px; }
.topbar__spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink); }
.who__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* Hero banner */
.hero { padding: 28px 26px; margin-top: 6px; }
.hero__title { font-family: "Anton", sans-serif; text-transform: uppercase; line-height: .95; font-size: clamp(36px, 9vw, 58px); margin: 8px 0 10px; }
.hero__body { color: var(--muted-dark-2); font-size: 14px; max-width: 46ch; }
.route { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.route__line { flex: 1; height: 0; border-top: 2px dashed rgba(244,236,221,.3); }
.route__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--muted-light); }
.empty .big { font-size: 48px; }
.empty h3 { font-family: "Anton", sans-serif; text-transform: uppercase; color: var(--ink); margin: 10px 0 6px; }

/* Footer note */
.foot-note { text-align: center; font-size: 12px; color: var(--muted-light); line-height: 1.7; margin-top: 40px; }

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

.wrap-narrow { width: 100%; max-width: 420px; margin: 0 auto; padding: 28px 16px; }
.wrap-board { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 70px; }

/* =========================================================================
   Shared site chrome + admin console (Pitstop theme)
   ========================================================================= */
a { color: inherit; text-decoration: none; }
.mono { font-family: "Archivo", monospace; }
.muted { color: var(--muted-light); }
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s cubic-bezier(.2,.7,.3,1) forwards; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } .trip { transition: none; } }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 8px 18px 80px; position: relative; z-index: 1; }

/* App header bar */
.app-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; background: rgba(243,235,217,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28,23,18,.1);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__logo {
  width: 44px; height: 44px; border-radius: 14px; background: rgba(28,23,18,.88);
  color: var(--on-dark); display: flex; align-items: center; justify-content: center;
  font-size: 22px; transform: rotate(-4deg); flex: none;
}
.brand__name { font-family: "Anton", sans-serif; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; display: block; }
.brand__sub { font-family: "Permanent Marker", cursive; font-size: 11px; color: var(--muted-light-2); margin-top: 3px; display: block; }
.header-spacer { flex: 1; }

/* Generic buttons (admin reuses these class names) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: 14px; border: 1px solid rgba(28,23,18,.16);
  background: rgba(255,255,255,.6); color: var(--ink); border-radius: 11px;
  padding: 9px 15px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s, color .15s;
}
.btn:hover { background: rgba(255,255,255,.85); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-family: "Anton", sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--red); border-color: rgba(226,59,38,.4); background: rgba(226,59,38,.06); }
.btn.danger:hover { background: rgba(226,59,38,.12); }
.btn.small { font-size: 12.5px; padding: 6px 12px; border-radius: 9px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

/* Inputs on light glass */
.input {
  width: 100%; border: 1px solid rgba(28,23,18,.2); background: rgba(255,255,255,.65);
  border-radius: 11px; padding: 11px 13px; font-size: 14.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,59,38,.14); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-light); }

/* Section label (admin) */
.sec-label {
  font-family: "Anton", sans-serif; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); margin: 30px 2px 14px; display: flex; align-items: center; gap: 12px;
}
.sec-label::after { content: ""; flex: 1; height: 2px; background: rgba(28,23,18,.14); }

/* Panels */
.panel {
  background: rgba(255,255,255,.5); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,.6); border-radius: 20px;
  box-shadow: 0 22px 48px -32px rgba(40,28,16,.55); overflow: hidden; margin-bottom: 14px;
}
.panel__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid rgba(28,23,18,.1); flex-wrap: wrap; }
.panel__head h2 { font-family: "Anton", sans-serif; font-size: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
.panel__head .muted { font-family: "Permanent Marker", cursive; font-size: 12px; color: var(--muted-light-2); }
.panel__body { padding: 6px 20px 16px; }

/* Rows */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(28,23,18,.1); flex-wrap: wrap; }
.row:first-child { border-top: none; }
.row__main { flex: 1; min-width: 160px; }
.row__title { font-weight: 700; font-size: 15px; }
.row__meta { font-size: 12.5px; color: var(--muted-light); margin-top: 3px; }
.row__meta .mono { font-size: 12px; }
.row__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Badges */
.badge { font-weight: 700; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; border: 1px solid rgba(28,23,18,.16); color: var(--muted-light); }
.badge.admin { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.badge.you { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Toggle */
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted-light); user-select: none; }
.toggle input { display: none; }
.toggle .track { width: 38px; height: 22px; border-radius: 20px; background: rgba(28,23,18,.2); position: relative; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(16px); }

/* Access checkbox list */
.access { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.access label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; border: 1px solid rgba(28,23,18,.16); border-radius: 9px; padding: 6px 10px; cursor: pointer; background: rgba(255,255,255,.5); }
.access label.on { border-color: var(--accent); background: rgba(226,59,38,.08); color: var(--accent); font-weight: 700; }
.access input { accent-color: var(--accent); }
.access.disabled { opacity: .45; pointer-events: none; }

/* code chips */
code { font-family: "Archivo", monospace; font-size: 12px; background: rgba(28,23,18,.08); color: var(--accent); padding: 1px 6px; border-radius: 5px; }

/* Modal (create / edit trip, manage crew) */
.scrim {
  position: fixed; inset: 0; z-index: 80; background: rgba(28,23,18,.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.scrim[hidden] { display: none; }
.modal {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: rgba(245,238,224,.95); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,.6); border-radius: 22px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); padding: 24px; animation: rise .35s both;
}
.modal__title { font-family: "Anton", sans-serif; font-size: 26px; text-transform: uppercase; line-height: 1; }
.modal__kicker { font-family: "Permanent Marker", cursive; font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.modal__row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* Theme picker swatches */
.themes { display: flex; gap: 10px; margin-top: 8px; }
.theme-dot {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent;
  transition: transform .12s, border-color .12s;
}
.theme-dot:hover { transform: scale(1.08); }
.theme-dot.sel { border-color: var(--ink); }
.theme-dot.red { background: #E23B26; }
.theme-dot.blue { background: #2D6CA2; }
.theme-dot.green { background: #2F8F5B; }
.theme-dot.purple { background: #7A4FB5; }
.theme-dot.orange { background: #C8741C; }

/* Emoji sticker picker */
.stickers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sticker { width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(28,23,18,.16); background: rgba(255,255,255,.5); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sticker.sel { border-color: var(--accent); background: #fff; }

/* Crew management list (trip detail) */
.crew-list { display: flex; flex-direction: column; gap: 8px; }
.crew-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.6); }
.crew-item__face { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.crew-item__name { font-weight: 700; font-size: 14px; flex: 1; }
.crew-item__tag { font-family: "Permanent Marker", cursive; font-size: 11px; color: var(--muted-light-2); }
.crew-item__x { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--muted-light); padding: 4px 8px; border-radius: 8px; }
.crew-item__x:hover { background: rgba(226,59,38,.1); color: var(--red); }

/* Auth-style centered card (404) */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 18px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 420px; padding: 32px 28px; text-align: center; }
