/* ═══════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --text: #0c1222;
  --text-secondary: #3d4a5c;
  --muted: #7b8794;
  --line: #e8ecf1;
  --soft: #f3f6f9;
  --soft2: #edf0f4;
  --accent: #3b6cf5;
  --accent-hover: #2a56d4;
  --accent-glow: rgba(59, 108, 245, 0.15);
  --accent-soft: rgba(59, 108, 245, 0.06);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.06);
  --success: #059669;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(12, 18, 34, 0.04), 0 1px 2px rgba(12, 18, 34, 0.02);
  --shadow-md: 0 4px 16px rgba(12, 18, 34, 0.06), 0 1px 3px rgba(12, 18, 34, 0.04);
  --shadow-lg: 0 12px 40px rgba(12, 18, 34, 0.08), 0 4px 12px rgba(12, 18, 34, 0.04);
  --shadow-accent: 0 8px 24px rgba(59, 108, 245, 0.2), 0 2px 8px rgba(59, 108, 245, 0.1);
  --transition-fast: 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-medium: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59, 108, 245, 0.04), transparent),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(139, 92, 246, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: box-shadow var(--transition-medium);
}
header:hover {
  box-shadow: var(--shadow-sm);
}

.container {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 16px 24px;
}

.headerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.title {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
}

.subtitle {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 450;
}

.badge {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: all var(--transition-fast);
}
.badge:hover {
  background: var(--soft2);
  border-color: #d4d9e0;
}

/* ═══════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════ */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
  display: flex;
}

.content {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 36px 24px 48px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════
   STEPS & ANIMATIONS
   ═══════════════════════════════════════════ */
.step {
  display: none;
  width: min(680px, 100%);
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.step.active {
  display: block;
  animation: stepIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.qTitle {
  font-size: 22px;
  margin: 0 0 10px 0;
  letter-spacing: -0.6px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.qDesc {
  margin: 0 0 28px 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 30px;
  font-weight: 420;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════
   ANSWER BUTTONS
   ═══════════════════════════════════════════ */
.answers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.btn {
  position: relative;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px 22px;
  font-weight: 700;
  cursor: pointer;
  min-width: 200px;
  font-size: 15px;
  font-family: inherit;
  overflow: hidden;
  transition:
    transform var(--transition-spring),
    background var(--transition-medium),
    border-color var(--transition-medium),
    box-shadow var(--transition-medium);
  box-shadow: var(--shadow-sm);
  will-change: transform;
}

/* Shine overlay */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.btn:hover::before {
  transform: translateX(100%);
}

.btn:hover {
  background: var(--soft);
  border-color: #c9d0d8;
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0px) scale(0.99);
  box-shadow: var(--shadow-sm);
  transition-duration: 0.08s;
}

/* Primary variant */
.btn.primary {
  background: var(--accent-soft);
  border-color: rgba(59, 108, 245, 0.2);
  color: #1a3f8b;
}
.btn.primary:hover {
  background: rgba(59, 108, 245, 0.1);
  border-color: rgba(59, 108, 245, 0.32);
  box-shadow: 0 8px 24px rgba(59, 108, 245, 0.1), var(--shadow-sm);
}

/* Danger variant */
.btn.danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
  color: #7f1d1d;
}
.btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1), var(--shadow-sm);
}

/* Staggered entrance for answer buttons */
.answers .btn {
  opacity: 0;
  animation: btnReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.answers .btn:nth-child(1) { animation-delay: 0.08s; }
.answers .btn:nth-child(2) { animation-delay: 0.16s; }
.answers .btn:nth-child(3) { animation-delay: 0.24s; }
.answers .btn:nth-child(4) { animation-delay: 0.32s; }
.answers .btn:nth-child(5) { animation-delay: 0.40s; }
.answers .btn:nth-child(6) { animation-delay: 0.48s; }

@keyframes btnReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */
.progressWrap {
  margin: 32px auto 0;
  width: min(480px, 100%);
}

.progressBar {
  height: 8px;
  width: 100%;
  background: var(--soft2);
  border-radius: 999px;
  overflow: hidden;
  border: none;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.progressFill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.tinyRow {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.resetLink {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  display: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  border-bottom: 1px dashed var(--muted);
  padding-bottom: 1px;
}
.resetLink:hover {
  color: var(--text-secondary);
  border-bottom-color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   FORM STEP
   ═══════════════════════════════════════════ */
#step-form {
  text-align: left;
}
#step-form .qTitle,
#step-form .qDesc {
  text-align: left;
}

.divider {
  margin: 20px 0 18px;
  border: none;
  border-top: 1px solid var(--line);
}

form {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  position: relative;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 6px 1px;
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

.field:focus-within label {
  color: var(--accent);
}

input, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--surface);
  outline: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 450;
  color: var(--text);
  transition:
    border-color var(--transition-medium),
    box-shadow var(--transition-medium),
    background var(--transition-fast);
}

textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder, textarea::placeholder {
  color: #b0b8c4;
}

input:hover, textarea:hover {
  border-color: #c9d0d8;
  background: #fdfdfe;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--surface);
}

/* ═══════════════════════════════════════════
   FORM BUTTONS
   ═══════════════════════════════════════════ */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.btnSolid {
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #5b7ff7 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-spring),
    box-shadow var(--transition-medium),
    filter var(--transition-medium);
  box-shadow: var(--shadow-sm), 0 2px 8px rgba(59, 108, 245, 0.15);
  will-change: transform;
}
.btnSolid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.btnSolid:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-accent);
  filter: brightness(1.04);
}
.btnSolid:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-sm);
  filter: brightness(0.97);
  transition-duration: 0.08s;
}

.btnGhost {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition:
    transform var(--transition-spring),
    background var(--transition-medium),
    border-color var(--transition-medium),
    box-shadow var(--transition-medium);
  box-shadow: var(--shadow-sm);
  will-change: transform;
}
.btnGhost:hover {
  background: var(--soft);
  border-color: #c9d0d8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btnGhost:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
  transition-duration: 0.08s;
}

/* ═══════════════════════════════════════════
   STATUS & FEEDBACK
   ═══════════════════════════════════════════ */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status.loading .spinner { display: inline-block; }
.status.ok { color: var(--success); }
.status.err { color: #b91c1c; }

.thank {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid rgba(5, 150, 105, 0.15);
  background: rgba(5, 150, 105, 0.04);
  padding: 16px 18px;
  border-radius: var(--radius);
  color: #065f46;
  font-weight: 650;
  font-size: 15px;
  animation: thankReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes thankReveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.foot {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 450;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 720px) {
  .container { padding: 14px 18px; }
  .content { padding: 28px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .btn { min-width: 160px; }

  .qTitle {
    font-size: 25px;
    letter-spacing: -0.4px;
  }
  .qDesc {
    font-size: 14.5px;
    margin-bottom: 22px;
  }

  .step { padding: 12px; }
  .progressWrap { margin-top: 24px; }
}

@media (max-width: 420px) {
  .btn {
    min-width: 100%;
  }
  .title { font-size: 17px; }
  .actions { flex-direction: column; }
  .actions .btnSolid,
  .actions .btnGhost {
    width: 100%;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════
   FOCUS VISIBLE (Accessibility)
   ═══════════════════════════════════════════ */
.btn:focus-visible,
.btnSolid:focus-visible,
.btnGhost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

input:focus-visible, textarea:focus-visible {
  outline: none;
}

/* ═══════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════ */
::selection {
  background: rgba(59, 108, 245, 0.15);
  color: var(--text);
}

/* ═══════════════════════════════════════════
   SCROLLBAR (Webkit)
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.consentRow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  text-align: left;
  color: var(--text-secondary);
  line-height: 1.6;
}

.consentRow input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.messageActions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  width: min(420px, 100%);
  margin: 26px auto 0;
}

.linkBtn {
  text-decoration: none;
  text-align: center;
}


#pageId{
  position: fixed;
  right: 8px;
  bottom: 6px;
  font-size: 11px;
  color: #888;
  opacity: 0.7;
  z-index: 9999;
  user-select: none;
}