/* ── proMOTION Design System tokens ("Apple Glass · Dark · Red Accent") ── */
:root {
  --bg:           #060608;
  --bg-alt:       #0b0b0e;

  --s1:           rgba(255,255,255,0.038);
  --s2:           rgba(255,255,255,0.065);
  --s3:           rgba(255,255,255,0.10);

  --b1:           rgba(255,255,255,0.07);
  --b2:           rgba(255,255,255,0.13);
  --b3:           rgba(255,255,255,0.22);

  --red:          #D4111A;
  --red-2:        #E8202A;
  --red-glow:     rgba(212,17,26,0.22);
  --red-soft:     rgba(212,17,26,0.10);
  --red-softer:   rgba(212,17,26,0.06);

  --text:         #F0F0F2;
  --text-2:       rgba(240,240,242,0.50);
  --text-3:       rgba(240,240,242,0.26);

  --green:        #30D158;
  --green-soft:   rgba(48,209,88,0.10);

  --blur-sm: 16px;
  --blur-md: 28px;
  --blur-lg: 56px;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.22s;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-atmosphere {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-atmosphere::before {
  content: '';
  position: absolute; top: -40%; left: 50%; translate: -50% 0;
  width: 120vw; height: 70vh;
  background: radial-gradient(ellipse, rgba(212,17,26,0.10) 0%, transparent 70%);
  filter: blur(1px);
}
.bg-atmosphere::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black 0%, transparent 80%);
}

.glass {
  background: linear-gradient(160deg, var(--s2) 0%, var(--s1) 100%);
  backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(160%);
  border: 1px solid var(--b1);
  border-top-color: var(--b2);
  position: relative;
}
.glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255,255,255,0.055) 0%, transparent 50%);
  pointer-events: none;
}

.btn-primary {
  background: var(--red);
  color: #fff; height: 52px;
  font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--r-sm);
  box-shadow: 0 8px 32px var(--red-glow), 0 1px 0 rgba(255,255,255,0.15) inset;
  cursor: pointer; transition: all 0.22s var(--ease);
  padding: 0 28px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) {
  background: var(--red-2);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary .arrow { transition: transform var(--t) var(--ease); }
.btn-primary:hover:not(:disabled) .arrow { transform: translateX(3px); }

.btn-ghost {
  background: var(--s1); color: var(--text-2);
  border: 1px solid var(--b1); border-top-color: var(--b2);
  height: 44px; font-size: 13px; font-weight: 600;
  padding: 0 18px; border-radius: var(--r-xs);
  backdrop-filter: blur(16px); cursor: pointer;
  transition: all 0.22s var(--ease);
  font-family: inherit;
}
.btn-ghost:hover:not(:disabled) { background: var(--s2); color: var(--text); }
.btn-ghost:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.brand-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 24px 0 0;
}
.brand-logo { height: 26px; opacity: 0.9; }

.progress-track {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: rgba(255,255,255,0.06);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red), var(--red-2));
  box-shadow: 0 0 12px var(--red-glow);
  transition: width 0.5s var(--ease);
}

[hidden] { display: none !important; }

.preview-banner {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 59;
  text-align: center; font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; color: #FFC93C;
  background: rgba(255,201,60,0.12); border-bottom: 1px solid rgba(255,201,60,0.25);
  padding: 8px 12px;
}

.stage {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 100px 20px 90px;
}

.step {
  display: none;
  width: 100%;
  max-width: 560px;
}
.step.active { display: block; animation: step-in 0.5s var(--ease); }
.step.leaving { animation: step-out 0.32s var(--ease) forwards; }

@keyframes step-in {
  from { opacity: 0; transform: translateY(24px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes step-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-18px) scale(0.985); }
}

.card {
  border-radius: var(--r-xl);
  padding: 44px 40px;
  text-align: left;
}

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--red-2); margin: 0 0 14px;
}
h1 {
  font-size: 26px; font-weight: 700; line-height: 1.35;
  margin: 0 0 12px; letter-spacing: -0.01em;
}
.muted { color: var(--text-2); font-size: 15px; line-height: 1.6; margin: 0 0 28px; }

.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 32px; gap: 12px;
}
.nav-row .btn-primary { margin-left: auto; }

/* ── Emoji / Star scale ─────────────────────────────────────────────── */
.scale-row {
  display: flex; gap: 10px; justify-content: space-between; margin-bottom: 8px;
}
.scale-option {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 6px 14px;
  background: var(--s1); border: 1px solid var(--b1); border-top-color: var(--b2);
  border-radius: var(--r-md);
  cursor: pointer; transition: all var(--t) var(--ease);
}
.scale-option:hover { background: var(--s2); transform: translateY(-2px); }
.scale-option.selected {
  background: var(--red-soft); border-color: rgba(212,17,26,0.4);
  box-shadow: 0 0 0 2px var(--red-soft);
}
.scale-emoji { font-size: 30px; line-height: 1; transition: transform var(--t) var(--ease); }
.scale-option.selected .scale-emoji { transform: scale(1.18); }
.scale-star { font-size: 26px; line-height: 1; color: var(--b3); }
.scale-option.selected .scale-star { color: #FFC93C; }
.scale-label {
  font-size: 11px; font-weight: 600; text-align: center; color: var(--text-2);
  line-height: 1.3;
}
.scale-option.selected .scale-label { color: var(--text); }

/* Star strip variant */
.star-row { display: flex; gap: 6px; margin-bottom: 10px; }
.star-btn {
  background: none; border: none; cursor: pointer; font-size: 38px;
  color: var(--b3); padding: 0; line-height: 1;
  transition: color var(--t) var(--ease), transform var(--t) var(--ease);
}
.star-btn.filled { color: #FFC93C; }
.star-btn:hover { transform: scale(1.12); }
.star-caption { font-size: 13px; color: var(--text-2); min-height: 18px; }

/* ── Multiple choice ────────────────────────────────────────────────── */
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--s1); border: 1px solid var(--b1); border-top-color: var(--b2);
  border-radius: var(--r-sm);
  cursor: pointer; transition: all var(--t) var(--ease);
  font-size: 15px; font-weight: 500;
}
.choice-option:hover { background: var(--s2); }
.choice-option.selected {
  background: var(--red-soft); border-color: rgba(212,17,26,0.4);
}
.choice-key {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--b2); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-2); flex-shrink: 0;
}
.choice-option.selected .choice-key { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Text area ──────────────────────────────────────────────────────── */
textarea.input {
  width: 100%; min-height: 130px; resize: vertical;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--b1); border-top-color: var(--b2);
  border-radius: var(--r-sm);
  color: var(--text); font-family: inherit; font-size: 15px;
  padding: 14px 18px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.input:focus { border-color: var(--b3); box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
textarea.input::placeholder { color: var(--text-3); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* ── Loading spinner ────────────────────────────────────────────────── */
.spinner {
  width: 34px; height: 34px; margin: 0 auto;
  border: 3px solid var(--b1); border-top-color: var(--red);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error state ────────────────────────────────────────────────────── */
.icon-badge {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin-bottom: 20px;
}
.icon-badge--error { background: var(--red-soft); color: #ff6060; border: 1px solid rgba(212,17,26,0.3); }

/* ── Thank-you screen ───────────────────────────────────────────────── */
.card--done { text-align: center; }
.check-badge { display: flex; justify-content: center; margin-bottom: 8px; }
.check-circle {
  fill: none; stroke: var(--green); stroke-width: 2.5;
  stroke-dasharray: 151; stroke-dashoffset: 151;
  animation: circle-draw 0.6s var(--ease) forwards;
}
.check-mark {
  fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: mark-draw 0.4s var(--ease) 0.5s forwards;
}
.check-badge svg { width: 84px; height: 84px; }
@keyframes circle-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

.review-draft {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--b1);
  text-align: left;
}
.review-draft-label { font-size: 13px; color: var(--text-2); margin: 0 0 14px; }
.review-draft-text {
  font-size: 15px; line-height: 1.6; font-style: italic; color: var(--text);
  background: var(--s1); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 16px 18px; margin: 0 0 16px;
}
.review-draft-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.review-draft-actions .btn-ghost { flex: 1; }
.review-draft-actions .btn-primary { flex: 1; text-align: center; text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.app-footer-fixed {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8,8,10,0.65);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--b1);
  padding: 10px 24px;
  text-align: center;
}
.app-footer-text { font-size: 12px; color: rgba(240,240,242,0.25); margin: 0; }
.app-footer-text a { color: rgba(212,17,26,0.7); text-decoration: none; font-weight: 600; }

@media (max-width: 480px) {
  .card { padding: 32px 24px; }
  h1 { font-size: 22px; }
  .scale-emoji { font-size: 24px; }
  .star-btn { font-size: 30px; }
}
