/* ===== CleanDriver — festival / neon design system ===== */
:root {
  --bg: #07040f;
  --bg-2: #0d0820;
  --panel: rgba(22, 14, 44, 0.72);
  --panel-solid: #160e2c;
  --line: rgba(157, 78, 255, 0.22);
  --text: #f3efff;
  --muted: #a99fd0;
  --pink: #ff2e9a;
  --cyan: #00e5ff;
  --purple: #9d4eff;
  --lime: #b6ff3c;
  --brand-green: #3ee87f;
  --brand-green-2: #86efac;
  --radius: 18px;
  --shadow-pink: 0 0 24px rgba(255, 46, 154, 0.55);
  --shadow-cyan: 0 0 24px rgba(0, 229, 255, 0.45);
  --font: "Sora", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* glowing ambient background */
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(157, 78, 255, 0.30), transparent 70%),
    radial-gradient(55% 45% at 90% 15%, rgba(0, 229, 255, 0.22), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(255, 46, 154, 0.28), transparent 70%),
    var(--bg);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(157,78,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157,78,255,0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
}

/* layout */
.wrap { width: min(1120px, 92vw); margin: 0 auto; }
.app-screen { display: none; }
.app-screen.active { display: block; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 4, 15, 0.55);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; cursor: pointer; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand-green); box-shadow: 0 0 8px rgba(62,232,127,.95), 0 0 18px rgba(62,232,127,.65), 0 0 34px rgba(62,232,127,.4); animation: pulse 2.4s infinite; }
.brand .neon { color: #fff; }
.brand .neon b { background: linear-gradient(100deg, var(--brand-green), var(--brand-green-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: 0.7; } }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a, .nav-links button.linkish {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 8px 12px; border-radius: 10px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav-links a:hover, .nav-links button.linkish:hover { color: #fff; background: rgba(157,78,255,0.12); }

/* buttons */
.btn {
  font-family: inherit; font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
  padding: 14px 26px; border-radius: 999px; color: #fff; transition: transform .12s ease, box-shadow .2s ease, filter .2s;
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-pink { background: linear-gradient(100deg, var(--pink), #ff6dc0); box-shadow: var(--shadow-pink); }
.btn-pink:hover { filter: brightness(1.08); box-shadow: 0 0 34px rgba(255,46,154,0.8); }
.btn-cyan { background: linear-gradient(100deg, var(--cyan), #6df3ff); color: #06141a; box-shadow: var(--shadow-cyan); }
.btn-cyan:hover { filter: brightness(1.06); box-shadow: 0 0 34px rgba(0,229,255,0.75); }
.btn-ghost { background: rgba(157,78,255,0.10); border: 1px solid var(--line); color: #fff; box-shadow: none; }
.btn-ghost:hover { background: rgba(157,78,255,0.20); }
.btn-google { background: #fff; color: #1f1f1f; box-shadow: 0 8px 30px rgba(0,0,0,0.4); font-weight: 700; }
.btn-google:hover { filter: brightness(0.97); }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }

/* hero */
.hero { padding: 76px 0 60px; text-align: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; background: rgba(0,229,255,0.06); margin-bottom: 26px;
}
.eyebrow .live { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 1.6s infinite; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 22px;
}
.hero h1 .g1 { background: linear-gradient(100deg, var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .g2 { color: #fff; text-shadow: 0 0 30px rgba(0,229,255,0.4); }
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.35rem); color: var(--muted); max-width: 640px; margin: 0 auto 38px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* trust row */
.trust { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 44px; color: var(--muted); font-size: 0.92rem; }
.trust .item { display: flex; align-items: center; gap: 9px; }
.trust .ic { color: var(--lime); font-size: 1.1rem; }

/* how it works */
.section { padding: 70px 0; }
.section h2 { text-align: center; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.section .sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 50px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  backdrop-filter: blur(8px); position: relative; overflow: hidden;
}
.card .num {
  font-size: 0.85rem; font-weight: 800; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(157,78,255,0.18); color: var(--purple); margin-bottom: 18px; border: 1px solid var(--line);
}
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.97rem; }
.card.cyan .num { background: rgba(0,229,255,0.16); color: var(--cyan); }
.card.pink .num { background: rgba(255,46,154,0.16); color: var(--pink); }

/* footer */
.footer { padding: 40px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; text-align: center; margin-top: 30px; }

/* generic app pieces (used later) */
.page-head { padding: 40px 0 10px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--panel-solid); border: 1px solid var(--line); color: #fff; padding: 14px 22px; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); z-index: 200; transition: transform .35s cubic-bezier(.2,.9,.3,1.2); max-width: 88vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== app: nav actions / avatar ===== */
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); object-fit: cover; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 46px; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px; min-width: 180px; box-shadow: 0 16px 40px rgba(0,0,0,0.55); display: none; z-index: 60;
}
.menu.open { display: block; }
.menu .me { padding: 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .me b { display: block; font-size: 0.95rem; }
.menu .me span { font-size: 0.8rem; color: var(--muted); }
.menu button { width: 100%; text-align: left; background: none; border: none; color: var(--text); font-family: inherit; font-size: 0.92rem; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.menu button:hover { background: rgba(157,78,255,0.14); }
.tab { color: var(--muted); background: none; border: none; font-family: inherit; font-size: 0.95rem; padding: 8px 12px; border-radius: 10px; cursor: pointer; position: relative; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--cyan); box-shadow: var(--shadow-cyan); }
.tab .badge { position: absolute; top: 0; right: 2px; background: var(--pink); color: #fff; font-size: 0.65rem; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

/* ===== filter chips ===== */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 22px 0 28px; }
.browse-add { display: flex; gap: 8px; align-items: center; }
.browse-add .input { min-width: 200px; }
.chip {
  background: rgba(157,78,255,0.08); border: 1px solid var(--line); color: var(--muted); font-family: inherit;
  font-size: 0.9rem; padding: 9px 16px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.chip:hover { color: #fff; }
.chip.active { background: linear-gradient(100deg, rgba(0,229,255,0.2), rgba(157,78,255,0.2)); color: #fff; border-color: var(--cyan); }

/* ===== driver cards grid ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.driver-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 14px; transition: transform .15s, border-color .2s;
}
.driver-card:hover { transform: translateY(-4px); border-color: rgba(0,229,255,0.4); }
.dc-top { display: flex; align-items: center; gap: 12px; }
.dc-ava { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #06141a; background: linear-gradient(135deg, var(--cyan), var(--purple)); flex: none; }
.dc-name { font-weight: 700; font-size: 1.05rem; }
.dc-sub { font-size: 0.82rem; color: var(--muted); }
.dc-row { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.dc-row .k { color: var(--muted); width: 78px; flex: none; }
.dc-row .v { color: #fff; font-weight: 600; }
.dc-price { font-size: 1.5rem; font-weight: 800; color: var(--lime); }
.dc-price small { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: rgba(0,229,255,0.1); border: 1px solid var(--line); color: var(--cyan); }
.tag.pink { background: rgba(255,46,154,0.12); color: var(--pink); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 2.4rem; margin-bottom: 10px; }

/* ===== forms ===== */
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; max-width: 540px; margin-top: 22px;
  backdrop-filter: blur(8px);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; background: rgba(7,4,15,0.6); border: 1px solid var(--line); border-radius: 12px; color: #fff;
  font-family: inherit; font-size: 1rem; padding: 13px 15px; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.15); }
.textarea { resize: vertical; min-height: 88px; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a99fd0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.select option, .select optgroup { background: #160e2c; color: #f3efff; }
.select optgroup { font-weight: 700; }
.filter-select { display: inline-flex; flex-direction: column; gap: 7px; }
.filter-select > span { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.filter-select .select { min-width: 280px; }
.input::placeholder, .textarea::placeholder { color: #6a6090; }
.price-input { position: relative; }
.price-input .cur { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--lime); font-weight: 700; }
.price-input .input { padding-left: 34px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* ===== messages ===== */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; margin-top: 22px; min-height: 560px; }
.convo-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.convo {
  display: flex; gap: 12px; align-items: center; padding: 16px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .15s;
}
.convo:hover { background: rgba(157,78,255,0.08); }
.convo.active { background: rgba(0,229,255,0.08); }
.convo .meta { min-width: 0; flex: 1; }
.convo .meta b { display: block; font-size: 0.95rem; }
.convo .meta span { font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.thread { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 560px; }
.thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.thread-body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 460px; }
.bubble { max-width: 74%; padding: 11px 15px; border-radius: 16px; font-size: 0.95rem; line-height: 1.4; }
.bubble.them { align-self: flex-start; background: rgba(157,78,255,0.16); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: linear-gradient(100deg, var(--cyan), #6df3ff); color: #06141a; border-bottom-right-radius: 4px; font-weight: 500; }
.bubble .t { font-size: 0.68rem; opacity: 0.6; margin-top: 4px; display: block; }
.thread-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.thread-input .input { flex: 1; }
.thread-empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 30px; }

.add-fest-btn {
  margin-top: 10px; background: rgba(0,229,255,0.08); border: 1px dashed var(--line); color: var(--cyan);
  font-family: inherit; font-size: 0.9rem; font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.add-fest-btn:hover { background: rgba(0,229,255,0.15); border-color: var(--cyan); }

.fee-note {
  display: flex; gap: 13px; align-items: flex-start; margin: 4px 0 22px; padding: 15px 16px;
  background: rgba(0,229,255,0.06); border: 1px solid var(--line); border-radius: 14px;
}
.fee-note .fee-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #06141a; background: linear-gradient(135deg, var(--cyan), var(--lime)); }
.fee-note b { display: block; font-size: 0.95rem; margin-bottom: 3px; }
.fee-note span { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }

.join-link {
  background: none; border: none; font-family: inherit; cursor: pointer;
  color: var(--cyan); font-size: 1rem; font-weight: 600; padding: 6px 4px; letter-spacing: 0.01em;
  transition: text-shadow .2s, transform .12s;
}
.join-link:hover { text-shadow: var(--shadow-cyan); transform: translateX(2px); }

/* ===== paywall / membership ===== */
.pay-wrap { max-width: 460px; margin: 40px auto 0; }
.price-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 36px 30px; text-align: center;
  backdrop-filter: blur(10px); position: relative; overflow: hidden;
}
.price-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, var(--cyan), var(--purple), var(--pink));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.55;
}
.price-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.price-big { font-size: 3.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.price-big .cur { color: var(--cyan); }
.price-per { color: var(--muted); font-size: 1rem; margin-top: 6px; }
.price-list { text-align: left; margin: 26px 0; display: flex; flex-direction: column; gap: 13px; }
.price-list li { list-style: none; display: flex; gap: 11px; align-items: flex-start; color: var(--text); font-size: 0.98rem; }
.price-list .ck { color: var(--lime); font-weight: 800; flex: none; }
.price-fine { font-size: 0.82rem; color: var(--muted); margin-top: 16px; }
.pay-methods { margin-top: 14px; font-size: 0.85rem; color: var(--text); font-weight: 500; letter-spacing: 0.01em; }

.member-status { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-weight: 600; }
.pill { font-size: 0.75rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; letter-spacing: 0.04em; }
.pill.on { background: rgba(182,255,60,0.16); color: var(--lime); border: 1px solid rgba(182,255,60,0.3); }
.pill.off { background: rgba(255,46,154,0.14); color: var(--pink); border: 1px solid rgba(255,46,154,0.3); }
.pill.ending { background: rgba(255,200,60,0.14); color: #ffd23c; border: 1px solid rgba(255,200,60,0.3); }
.member-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.member-row .k { color: var(--muted); }
.btn-danger { background: rgba(255,46,154,0.12); border: 1px solid rgba(255,46,154,0.35); color: var(--pink); box-shadow: none; }
.btn-danger:hover { background: rgba(255,46,154,0.2); }

/* bottom tab bar (mobile) */
.bottom-nav { display: none; }
.bottom-nav button {
  flex: 1; background: none; border: none; color: var(--muted); font-family: inherit; font-size: 0.7rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); cursor: pointer; position: relative;
}
.bottom-nav button .bi { font-size: 1.25rem; line-height: 1; }
.bottom-nav button.active { color: #fff; }
.bottom-nav button.active .bi { filter: drop-shadow(0 0 8px var(--cyan)); }
.bottom-nav button.active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: 2px; background: var(--cyan); box-shadow: var(--shadow-cyan); }

/* responsive */
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .nav-links .hide-mobile { display: none; }
  .hero { padding: 54px 0 40px; }
  .msg-layout { grid-template-columns: 1fr; min-height: auto; }
  .convo-list.hide-on-thread { display: none; }
  .thread, .msg-layout { min-height: 64vh; }
  .brand { font-size: 1.1rem; }
  /* top-nav tabs move into the bottom bar on mobile */
  #nav-actions .tab { display: none; }
  body.signed-in .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    background: rgba(7,4,15,0.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  body.signed-in { padding-bottom: 74px; }
}
