:root {
  --bg: #f7f4ee;
  --bg-2: #fffdf9;
  --text: #1f2430;
  --muted: #6d7485;
  --line: rgba(49, 66, 101, 0.12);
  --line-strong: rgba(49, 66, 101, 0.22);
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 255, 255, 0.92);
  --gold: #ffbe44;
  --gold-2: #ffe08a;
  --accent: #7ea8ff;
  --accent-2: #d8c4ff;
  --good: #35b36d;
  --bad: #e96969;
  --shadow: 0 24px 60px rgba(33, 43, 70, 0.12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 123, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(126, 168, 255, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  overflow-x: hidden;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.app-shell {
  min-height: 100vh;
  padding: 28px 0 64px;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ambient-svg {
  width: 100%;
  height: 100%;
}

.ambient-svg path {
  fill: none;
  stroke: rgba(73, 94, 137, 0.14);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 12 18;
  animation: ambientLine 22s linear infinite;
}

.ambient-svg path.accent {
  stroke: rgba(255, 190, 68, 0.18);
  stroke-dasharray: 10 16;
  animation-duration: 28s;
  animation-direction: reverse;
}

.hero-stage,
.dashboard-deck,
.view-panel {
  transition: opacity .55s ease, transform .7s cubic-bezier(.2,.8,.2,1), filter .55s ease;
}

.hero-stage {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card,
.card,
.feature-card,
.pass-tile,
.question-frame {
  background: var(--card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  width: min(560px, 100%);
  padding: 34px 32px 28px;
  border-radius: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.feature-card::before,
.question-frame::before,
.card::before {
  content: '';
  position: absolute;
  inset: auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(126, 168, 255, 0.12);
  right: -100px;
  top: -110px;
  pointer-events: none;
}

.hero-card::after,
.feature-card::after,
.question-frame::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  left: -180px;
  bottom: -220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 190, 68, 0.12);
  pointer-events: none;
}

.hero-badge,
.card-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9b6a08;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.hero-card h1,
.hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-caption,
.feature-copy,
.question-text,
.muted,
.note,
.micro-info {
  color: var(--muted);
}

.hero-caption,
.feature-copy {
  font-size: 16px;
  line-height: 1.75;
}

.micro-info {
  font-size: 13px;
  line-height: 1.6;
}

.hero-actions,
.main-actions,
.inline-actions,
.answer-actions,
.panel-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.main-actions {
  justify-content: center;
  margin: 24px 0 14px;
}

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

button {
  border: 0;
  border-radius: 18px;
  padding: 13px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, opacity .2s ease, background .2s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.primary-cta {
  background: linear-gradient(135deg, #171f2f 0%, #253756 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(32, 40, 61, 0.22);
  position: relative;
  overflow: hidden;
}

.primary-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.2) 50%, transparent 100%);
  transform: translateX(-120%);
  animation: buttonSweep 4.6s ease-in-out infinite;
}

.primary-cta.alt {
  background: linear-gradient(135deg, #fff5d8 0%, #ffd978 100%);
  color: #312200;
  box-shadow: 0 20px 40px rgba(255, 190, 68, 0.24);
}

.ghost,
.subtle-btn,
.back-btn {
  background: rgba(255,255,255,.78);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.dashboard-deck,
.view-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(22px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 18px;
  width: 100%;
}

.feature-card,
.card,
.question-frame,
.pass-tile {
  border-radius: 28px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.feature-card h2,
.card h2,
.view-panel h2 {
  margin: 10px 0 10px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.metric-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 20px;
  line-height: 1.45;
  word-break: break-word;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.pass-tile.active { border-color: rgba(255, 190, 68, 0.36); }
.tile-meta { font-size: 13px; color: var(--muted); margin: 8px 0 16px; }
.empty-state { padding: 24px; border-radius: 24px; }

.panel-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.question-frame {
  max-width: 900px;
}

.progress-wrap { margin-bottom: 20px; }
.progress-bar {
  height: 18px;
  background: rgba(63, 84, 125, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar > div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ff8b82 55%, #c095ff 100%);
  transition: width .25s ease;
}

.question-frame h3 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.question-text {
  font-size: 18px;
  line-height: 1.8;
  max-width: 720px;
  margin: 0 0 20px;
}

.answer-actions { margin-top: 22px; }
.answer {
  min-width: 130px;
  border-radius: 16px;
}
.answer.yes {
  background: linear-gradient(135deg, #7ce1a0 0%, #42bf79 100%);
  color: #062311;
}
.answer.no {
  background: linear-gradient(135deg, #ffb8b8 0%, #ea7777 100%);
  color: #390909;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

input[type="text"],
input[type="password"],
textarea,
select,
input[type="file"] {
  width: 100%;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
}

textarea {
  min-height: 280px;
  resize: vertical;
}

.form-grid { display: grid; gap: 16px; }
.status-banner {
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--line);
}
.admin-help { font-size: 14px; color: var(--muted); line-height: 1.75; }
.hero.card { margin-top: 12px; }

#experience[data-auth="connected"][data-view="dashboard"] .hero-stage {
  opacity: 0;
  transform: translateX(-180px) scale(.92);
  filter: blur(8px);
  pointer-events: none;
}

#experience[data-auth="connected"][data-view="dashboard"] .dashboard-deck {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#experience[data-auth="connected"][data-view="hub"] .survey-hub,
#experience[data-auth="connected"][data-view="survey"] .survey-view {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#experience[data-auth="connected"][data-view="hub"] .hero-stage,
#experience[data-auth="connected"][data-view="hub"] .dashboard-deck,
#experience[data-auth="connected"][data-view="survey"] .hero-stage,
#experience[data-auth="connected"][data-view="survey"] .dashboard-deck {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.question-reveal {
  animation: questionReveal .46s cubic-bezier(.2,.8,.2,1);
}

@keyframes ambientLine {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -240; }
}

@keyframes buttonSweep {
  0%, 100% { transform: translateX(-120%); }
  45%, 60% { transform: translateX(120%); }
}

@keyframes questionReveal {
  0% { opacity: .35; transform: translateY(14px) scale(.985); filter: blur(7px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 62vh; }
  .panel-head { align-items: flex-start; }
}

@media (max-width: 780px) {
  .app-shell { padding-top: 18px; }
  .shell { width: min(100%, calc(100% - 20px)); }
  .hero-card,
  .feature-card,
  .card,
  .question-frame,
  .pass-tile { padding: 20px; border-radius: 24px; }
  .main-actions { justify-content: stretch; }
  .main-actions button { width: 100%; }
  .panel-head { gap: 10px; }
}
