/* =========================================
   Brainstamped Screen Time Audit — Styles
   Dark premium theme
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0c0f17;
  --bg-card: #141824;
  --bg-card-hover: #1a2030;
  --bg-input: #1a1f2e;
  --primary: #d4a24e;
  --primary-dim: rgba(212,162,78,.15);
  --primary-glow: rgba(212,162,78,.35);
  --accent: #4ecdc4;
  --accent-dim: rgba(78,205,196,.12);
  --text: #e8e6e1;
  --text-muted: #8a8d98;
  --text-dim: #5c5f6a;
  --danger: #e74c5e;
  --warning: #f0a830;
  --success: #4ecdc4;
  --border: rgba(255,255,255,.06);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* --- Utility --- */
.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.container--wide { max-width: 960px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.hidden { display: none !important; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.25rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding: 14px 32px; border-radius: 50px; border: none;
  cursor: pointer; transition: var(--transition);
  text-align: center; justify-content: center;
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary), #c48b2e);
  color: #0c0f17;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--primary-glow); }
.btn--secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn--secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn--accent {
  background: linear-gradient(135deg, var(--accent), #36b5ad);
  color: #0c0f17;
}
.btn--sm { padding: 10px 22px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--primary-dim) 0%, transparent 70%);
  pointer-events: none;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-dim); color: var(--primary);
  font-size: .85rem; font-weight: 600;
  padding: 6px 16px; border-radius: 50px;
  margin-bottom: 24px;
}
.hero__title { margin-bottom: 18px; }
.hero__title span { color: var(--primary); }
.hero__subtitle {
  font-size: 1.15rem; color: var(--text-muted);
  max-width: 560px; margin: 0 auto 32px;
}

/* --- Stat Cards --- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 48px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-card__icon { margin: 0 auto 10px; color: var(--primary); }
.stat-card__value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.stat-card__label { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

/* --- How It Works --- */
.how-it-works { padding: 40px 0; }
.how-it-works h2 { text-align: center; margin-bottom: 32px; }
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.step-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
}
.step-item__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-dim); color: var(--primary);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 12px;
}
.step-item h3 { margin-bottom: 6px; }
.step-item p { font-size: .9rem; color: var(--text-muted); }

/* --- FAQ --- */
.faq { padding: 48px 0 60px; }
.faq h2 { text-align: center; margin-bottom: 28px; }
.faq-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden;
}
.faq-item__q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; color: var(--text);
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  padding: 16px 20px; cursor: pointer; text-align: left;
}
.faq-item__q svg { flex-shrink: 0; transition: var(--transition); }
.faq-item.open .faq-item__q svg { transform: rotate(180deg); }
.faq-item__a {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.faq-item__a p { padding: 0 20px 16px; color: var(--text-muted); font-size: .95rem; line-height: 1.6; }
.faq-item.open .faq-item__a { max-height: 300px; }

/* --- Progress Bar --- */
.progress-wrap {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
}
.progress-bar {
  height: 6px; border-radius: 3px;
  background: var(--bg-input); overflow: hidden;
}
.progress-bar__fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .4s ease;
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--text-muted); margin-top: 6px;
}

/* --- Scan Card --- */
.scan-section { padding: 20px 0 80px; min-height: 60vh; }
.scan-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 32px;
  box-shadow: var(--shadow);
}
.scan-card__title { margin-bottom: 6px; }
.scan-card__desc { color: var(--text-muted); font-size: .95rem; margin-bottom: 28px; }

/* --- Form Elements --- */
.option-grid {
  display: grid; gap: 12px;
}
.option-grid--2 { grid-template-columns: 1fr 1fr; }
.option-grid--3 { grid-template-columns: repeat(3, 1fr); }

.option-btn {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-input); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  cursor: pointer; transition: var(--transition);
  color: var(--text); font-size: .95rem;
}
.option-btn:hover { border-color: rgba(212,162,78,.3); background: var(--bg-card-hover); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-dim); }
.option-btn svg { flex-shrink: 0; color: var(--text-muted); }
.option-btn.selected svg { color: var(--primary); }

.option-btn--multi.selected { border-color: var(--accent); background: var(--accent-dim); }
.option-btn--multi.selected svg { color: var(--accent); }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block; font-weight: 600; font-size: .9rem;
  margin-bottom: 8px; color: var(--text);
}
.form-group label .optional { color: var(--text-dim); font-weight: 400; }

select, input[type="email"], input[type="text"] {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input); border: 2px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: .95rem;
  transition: var(--transition);
  -webkit-appearance: none;
}
select:focus, input:focus { outline: none; border-color: var(--primary); }

/* --- Navigation Buttons --- */
.nav-buttons {
  display: flex; gap: 12px; margin-top: 32px;
}
.nav-buttons .btn { flex: 1; }

/* --- Results --- */
.results-section { padding: 20px 0 80px; }

.score-ring-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 36px;
}
.score-ring { position: relative; width: 180px; height: 180px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle {
  fill: none; stroke-width: 10; stroke-linecap: round;
}
.score-ring__bg { stroke: var(--bg-input); }
.score-ring__fill {
  stroke: var(--primary);
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.5s ease;
}
.score-ring__label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring__num {
  font-family: var(--font-display); font-size: 3rem; font-weight: 700;
  line-height: 1;
}
.score-ring__text { font-size: .85rem; color: var(--text-muted); }

.risk-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 50px;
  font-weight: 700; font-size: .95rem;
  margin-top: 12px;
}
.risk-badge--low { background: rgba(78,205,196,.15); color: var(--accent); }
.risk-badge--moderate { background: rgba(240,168,48,.15); color: var(--warning); }
.risk-badge--high { background: rgba(231,76,94,.15); color: var(--danger); }
.risk-badge--critical { background: rgba(231,76,94,.25); color: var(--danger); }

.risk-explanation {
  text-align: center; color: var(--text-muted);
  font-size: .95rem; max-width: 520px;
  margin: 12px auto 0;
}

/* --- Category Breakdown --- */
.breakdown { margin: 40px 0; }
.breakdown h2 { margin-bottom: 20px; }
.breakdown-item { margin-bottom: 18px; }
.breakdown-item__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.breakdown-item__name { font-weight: 600; font-size: .95rem; }
.breakdown-item__score { font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.breakdown-bar {
  height: 8px; border-radius: 4px;
  background: var(--bg-input); overflow: hidden;
}
.breakdown-bar__fill {
  height: 100%; border-radius: 4px;
  transition: width 1s ease;
}
.breakdown-bar__fill--sleep { background: linear-gradient(90deg, var(--accent), #36b5ad); }
.breakdown-bar__fill--focus { background: linear-gradient(90deg, var(--primary), #c48b2e); }
.breakdown-bar__fill--social { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.breakdown-bar__fill--dependency { background: linear-gradient(90deg, var(--danger), #c22d3f); }

/* --- Perspective --- */
.perspective {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  margin: 36px 0;
}
.perspective h2 { margin-bottom: 20px; text-align: center; }
.perspective-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.perspective-card {
  text-align: center; padding: 18px;
  background: var(--bg-input); border-radius: var(--radius-sm);
}
.perspective-card__val {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 700; color: var(--primary);
}
.perspective-card__label { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

/* --- Recommendations --- */
.recommendations { margin: 40px 0; }
.recommendations h2 { margin-bottom: 20px; }
.rec-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
  display: flex; gap: 16px; align-items: flex-start;
}
.rec-card__num {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary);
  border-radius: 50%; font-family: var(--font-display);
  font-weight: 700; font-size: .9rem;
}
.rec-card__body { flex: 1; }
.rec-card__action { font-weight: 700; margin-bottom: 4px; }
.rec-card__detail { font-size: .9rem; color: var(--text-muted); margin-bottom: 8px; }
.rec-card__meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: .8rem;
}
.rec-card__meta span {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-dim); background: var(--bg-input);
  padding: 3px 10px; border-radius: 50px;
}
.rec-card__meta span strong { color: var(--accent); font-weight: 600; }

/* --- Detox Challenge --- */
.detox { margin: 40px 0; }
.detox h2 { margin-bottom: 20px; }
.detox-day {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px;
  margin-bottom: 10px; display: flex; gap: 14px; align-items: flex-start;
}
.detox-day__badge {
  flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary);
  border-radius: var(--radius-sm); font-family: var(--font-display);
  font-weight: 700; font-size: .8rem;
}
.detox-day__title { font-weight: 700; margin-bottom: 2px; }
.detox-day__desc { font-size: .9rem; color: var(--text-muted); }

/* --- Quick Wins --- */
.quick-wins { margin: 40px 0; }
.quick-wins h2 { margin-bottom: 20px; }
.qw-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.qw-item:last-child { border-bottom: none; }
.qw-item__check {
  flex-shrink: 0; width: 28px; height: 28px;
  border: 2px solid var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.qw-item__check.done { background: var(--accent); }
.qw-item__check.done svg { opacity: 1; }
.qw-item__check svg { opacity: 0; transition: var(--transition); }
.qw-item__text { font-size: .95rem; }
.qw-item__text.done-text { text-decoration: line-through; color: var(--text-dim); }

/* --- Upsell --- */
.upsell {
  background: linear-gradient(135deg, #1a1530 0%, #141824 100%);
  border: 1px solid rgba(212,162,78,.2);
  border-radius: var(--radius); padding: 36px 32px;
  text-align: center; margin: 48px 0;
}
.upsell__badge {
  display: inline-block;
  background: var(--primary-dim); color: var(--primary);
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  padding: 4px 14px; border-radius: 50px; margin-bottom: 16px;
  letter-spacing: .06em;
}
.upsell h2 { margin-bottom: 10px; }
.upsell__price {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  color: var(--primary); margin: 12px 0;
}
.upsell__price span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.upsell__features {
  list-style: none; text-align: left;
  max-width: 400px; margin: 20px auto 28px;
}
.upsell__features li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; color: var(--text-muted); font-size: .95rem;
}
.upsell__features li svg { flex-shrink: 0; color: var(--accent); }

/* --- Footer --- */
.footer {
  text-align: center; padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .85rem;
}
.footer a { color: var(--text-muted); }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp .5s ease forwards;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .steps-grid { grid-template-columns: 1fr; }
  .option-grid--2 { grid-template-columns: 1fr; }
  .option-grid--3 { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .perspective-grid { grid-template-columns: 1fr; }
  .scan-card { padding: 24px 18px; }
  .hero { padding: 60px 0 40px; }
  .rec-card { flex-direction: column; }
  .nav-buttons { flex-direction: column; }
}
