:root {
  --red: #e94560;
  --red-dark: #c92f4b;
  --dark: #0d0d1a;
  --navy: #0f1a2e;
  --navy-2: #14264a;
  --purple: #6366f1;
  --gold: #f59e0b;
  --green: #16a34a;
  --blue: #185fa5;
  --ink: #1e293b;
  --muted: #64748b;
  --soft: #f8fafc;
  --paper: #ffffff;
  --line: #e2e8f0;
  --cream: #f5f3ea;
  --shadow: 0 22px 70px rgba(13, 13, 26, 0.16);
  --radius: 18px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 26, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav {
  width: min(var(--max), calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  min-width: max-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--red), var(--gold));
  box-shadow: 0 12px 30px rgba(233, 69, 96, 0.35);
}

.brand-text {
  display: grid;
  line-height: 1.05;
  letter-spacing: 0.08em;
}

.brand-text strong {
  font-size: 17px;
}

.brand-text span {
  color: #aab6cd;
  font-size: 10px;
  font-weight: 800;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: #dbe4f0;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 11px;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.menu-lines {
  position: relative;
}

.menu-lines::before,
.menu-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-lines::before {
  top: -6px;
}

.menu-lines::after {
  top: 6px;
}

.mobile-panel {
  display: none;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel.is-open {
  display: grid;
}

.mobile-panel a {
  color: #e6edf7;
  padding: 13px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.3);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-light {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(15, 26, 46, 0.08);
}

.section {
  padding: 76px 0;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 88px 0 74px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(233, 69, 96, 0.24), transparent 28rem),
    radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.18), transparent 30rem),
    linear-gradient(135deg, var(--dark), var(--navy));
}

.hero-grid {
  display: grid;
  gap: 36px;
  align-items: center;
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  color: #f0f4ff;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.28);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 18px 0 0;
  max-width: 760px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead {
  max-width: 670px;
  margin: 22px 0 0;
  color: #cbd5e1;
  font-size: clamp(18px, 2.2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.stat-tile {
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.stat-tile strong {
  display: block;
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.stat-tile span {
  display: block;
  margin-top: 7px;
  color: #aab6cd;
  font-size: 13px;
  font-weight: 700;
}

.section-head {
  max-width: 780px;
  margin-bottom: 30px;
}

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.role-grid {
  display: grid;
  gap: 16px;
}

.role-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(15, 26, 46, 0.07);
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--role-color, var(--red));
}

.role-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.role-card p {
  margin: 0;
  color: var(--muted);
}

.role-card .text-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--role-color, var(--red));
  font-weight: 850;
}

.product-stage {
  display: grid;
  gap: 28px;
  align-items: center;
}

.phone-shell {
  width: min(100%, 374px);
  margin: 0 auto;
  padding: 10px;
  border-radius: 32px;
  background: #121a2a;
  border: 1px solid #2e3a53;
  box-shadow: var(--shadow);
}

.phone-screen {
  overflow: hidden;
  min-height: 650px;
  border-radius: 25px;
  background: #fff;
}

.phone-top {
  position: relative;
  padding: 18px 18px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 87% 73%, rgba(99, 102, 241, 0.32), transparent 5.5rem),
    linear-gradient(135deg, #11182f, #12345e);
}

.phone-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.phone-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.phone-brand strong {
  display: block;
  letter-spacing: 0.08em;
}

.phone-brand span {
  color: #aab6cd;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.season-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #ffd6dd;
  background: rgba(233, 69, 96, 0.22);
  border: 1px solid rgba(233, 69, 96, 0.56);
  font-size: 12px;
  font-weight: 850;
}

.phone-top h3 {
  margin: 12px 0 0;
  font-size: 22px;
  line-height: 1.05;
}

.phone-top p {
  margin: 3px 0 0;
  color: #b7c4d8;
  font-size: 13px;
}

.phone-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--cream);
  border-bottom: 1px solid #d6d3c8;
}

.phone-tabs button {
  min-height: 54px;
  border: 0;
  border-right: 1px solid #c8c4b8;
  background: transparent;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.phone-tabs button:last-child {
  border-right: 0;
}

.phone-tabs button[aria-selected="true"] {
  color: var(--red);
  background: #fff;
}

.phone-content {
  padding: 18px;
}

.team-card {
  padding: 18px;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 91% 10%, rgba(99, 102, 241, 0.3), transparent 5rem),
    linear-gradient(135deg, #16203f, #0f3764);
}

.team-card h4 {
  margin: 0;
  font-size: 17px;
}

.team-card p {
  margin: 4px 0 0;
  color: #aebbd0;
  font-size: 12px;
  font-weight: 700;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

.mini-metrics strong {
  display: block;
  font-size: 20px;
}

.mini-metrics span {
  display: block;
  color: #aebbd0;
  font-size: 11px;
  font-weight: 750;
}

.progress-block,
.challenge-card,
.leader-card,
.member-card {
  border: 1px solid #dddfe7;
  border-radius: 13px;
  background: #fff;
}

.progress-block {
  margin-top: 18px;
  padding: 14px;
  background: #f4f2eb;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dad7ce;
}

.progress-line span {
  display: block;
  width: 60%;
  height: 100%;
  background: var(--red);
}

.small-note {
  margin-top: 10px;
  color: #111827;
  font-size: 12px;
  font-weight: 750;
}

.list-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.leader-card,
.challenge-card,
.member-card {
  padding: 13px;
}

.leader-card {
  display: grid;
  grid-template-columns: auto 42px 1fr auto;
  gap: 11px;
  align-items: center;
}

.leader-card.is-current {
  border-color: rgba(233, 69, 96, 0.65);
  background: #fff0f3;
}

.rank-number {
  color: var(--gold);
  font-weight: 850;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.leader-card p,
.challenge-card p,
.member-card p {
  margin: 0;
}

.leader-card small,
.challenge-card small,
.member-card small {
  color: var(--muted);
  font-weight: 700;
}

.leader-points {
  text-align: right;
  font-weight: 900;
}

.leader-points small {
  display: block;
  color: var(--green);
}

.feature-grid {
  display: grid;
  gap: 16px;
}

.feature-card {
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: 76px 0 60px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 18%, rgba(233, 69, 96, 0.22), transparent 28rem),
    linear-gradient(135deg, var(--dark), var(--navy));
}

.page-grid {
  display: grid;
  gap: 30px;
  align-items: center;
}

.dashboard-preview {
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.browser-panel {
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.browser-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.dot:nth-child(1) {
  background: var(--red);
}

.dot:nth-child(2) {
  background: var(--gold);
}

.dot:nth-child(3) {
  background: var(--green);
}

.browser-body {
  padding: 18px;
}

.admin-grid {
  display: grid;
  gap: 14px;
}

.admin-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-card h4 {
  margin: 0 0 10px;
  color: var(--navy);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #edf2f7;
}

.score-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--red);
  background: #fff0f3;
  font-size: 12px;
  font-weight: 850;
}

.status-pill.is-green {
  color: var(--green);
  background: #eaf8ef;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  padding: 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.timeline-dot {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.timeline-item h3 {
  margin: 0 0 4px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  padding: 52px 0;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--dark));
}

.cta-box {
  display: grid;
  gap: 22px;
  align-items: center;
}

.cta-box h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

.cta-box p {
  margin: 10px 0 0;
  color: #cbd5e1;
}

.site-footer {
  padding: 34px 0;
  color: #9aa8bd;
  background: var(--dark);
}

.footer-grid {
  display: grid;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: #dce5f2;
  font-weight: 700;
}

.tabs-panel {
  display: none;
}

.tabs-panel.is-active {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 760px) {
  .nav-links {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .hero-grid,
  .product-stage,
  .page-grid,
  .cta-box {
    grid-template-columns: 1fr 0.92fr;
  }

  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .role-grid,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .desktop-only {
    display: block;
  }
}

@media (min-width: 1040px) {
  .role-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-grid.feature-grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 520px) {
  .nav {
    width: min(100% - 20px, var(--max));
  }

  .brand-text strong {
    font-size: 15px;
  }

  .nav-actions .btn {
    display: none;
  }

  .hero,
  .page-hero {
    padding-top: 54px;
  }

  .section {
    padding: 56px 0;
  }

  .phone-shell {
    padding: 7px;
    border-radius: 27px;
  }

  .phone-screen {
    min-height: 590px;
    border-radius: 22px;
  }

  .phone-tabs button {
    min-height: 50px;
    font-size: 13px;
  }
}

/* Google login/public landing additions */
.public-shell .hero { min-height: calc(100vh - 72px); }
.hero-public { align-items: center; }
.login-panel { width: 100%; display: flex; justify-content: center; }
.login-card { width: min(100%, 430px); padding: 28px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); color: var(--ink); }
.login-card h1, .login-card h2 { margin: 12px 0 8px; color: var(--ink); }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.status-dot { display: inline-flex; width: 12px; height: 12px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 6px rgba(22,163,74,.12); }
.status-dot-danger { background: var(--red); box-shadow: 0 0 0 6px rgba(233,69,96,.12); }
.access-list { display: grid; gap: 10px; margin-top: 18px; }
.access-list span { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-weight: 800; }
.user-chip { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 800; }
.auth-error { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(233,69,96,.16), transparent 34%), var(--soft); }
.auth-error .login-card { background: #fff; }
@media (max-width: 760px) { .public-shell .hero { min-height: auto; } .login-card { padding: 22px; } .user-chip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
