:root {
  --purple: #32205b;
  --purple-bright: #65308f;
  --magenta: #c70a76;
  --pink: #d33a82;
  --gold: #d99a1d;
  --teal: #1ca79f;
  --ink: #302843;
  --soft: #f6f0f8;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #ececec; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 12% 0%, rgba(199, 10, 118, .07), transparent 28rem), #ececec;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.site-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(50, 32, 91, .04);
}
.pattern-bar {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(30deg, transparent 43%, #6d0751 44% 53%, transparent 54%) 0 0 / 32px 32px,
    linear-gradient(150deg, transparent 43%, #7e125d 44% 53%, transparent 54%) 0 0 / 32px 32px,
    var(--magenta);
}
.pattern-bar::after { content: ""; position: absolute; inset: 190px 0 0; background: #f7f7f7; }
.pattern-bar span { position: absolute; z-index: 1; inset-inline-start: 9px; bottom: 18px; color: var(--pink); font-size: 11px; writing-mode: vertical-rl; }
.page-frame { min-width: 0; padding: 24px 48px 34px; }
.topbar { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; min-height: 58px; }
.brand-logo { width: 299px; max-width: 38vw; height: auto; display: block; object-fit: contain; }
.step-badge { min-width: 215px; padding: 11px 22px; border-radius: 999px; color: #fff; background: var(--pink); text-align: center; font-size: 14px; font-weight: 700; }

.intro-heading, .quiz-heading, .result-heading { margin: -12px auto 18px; text-align: center; }
.intro-heading h1, .quiz-heading h1, .result-heading h1 { margin: 0; color: var(--purple-bright); font-size: clamp(28px, 3.2vw, 44px); line-height: 1.2; font-weight: 800; }
.intro-heading .gold-title { color: var(--gold); }
.alert-copy { max-width: 940px; margin: 12px auto 0; color: #d61323; font-size: 16px; line-height: 1.7; font-weight: 700; }
.consent-layout { display: grid; grid-template-columns: minmax(240px, .34fr) minmax(0, .66fr); gap: 22px; align-items: stretch; }
.context-panel { min-height: 430px; padding: 42px 36px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 14px; color: #fff; background: var(--purple); }
.context-panel h2 { margin: 0; color: #f4d36e; font-size: 18px; }
.context-panel p { margin: 0; font-size: 17px; line-height: 1.9; }
.consent-card { min-height: 430px; padding: 30px 42px 20px; border: 1px solid #f1edf2; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgba(50,32,91,.14); }
.consent-card h2 { margin: 0 0 70px; color: var(--gold); font-size: 17px; }
.consent-text { max-width: 620px; margin: auto; font-size: 16px; line-height: 1.75; }
.consent-text p { margin: 0 0 4px; }
.consent-text ul { margin: 0 0 4px; padding-inline-start: 24px; }
.actions, .quiz-actions { display: flex; justify-content: center; gap: 16px; margin-top: 26px; }
.button { min-width: 140px; padding: 12px 24px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .answer-option:has(input:focus-visible) { outline: 3px solid rgba(28,167,159,.35); outline-offset: 3px; }
.button.primary { color: #fff; background: var(--teal); box-shadow: 0 8px 20px rgba(28,167,159,.22); }
.button.primary:hover { background: #168d87; }
.button.muted { color: #827b92; background: #efebf4; }
.button.outline { color: var(--purple-bright); border: 1px solid #dacbe1; background: #fff; }
.button.light { color: var(--purple); background: #fff; }
.inline-notice, .form-error { margin: 12px auto 0; color: #b41326; text-align: center; font-size: 14px; font-weight: 700; }

.question-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; direction: rtl; }
.question-card { min-width: 0; min-height: 360px; margin: 0; padding: 0 0 18px; overflow: hidden; border: 1px solid #e2d5e7; border-radius: 12px; background: var(--soft); box-shadow: 0 3px 9px rgba(50,32,91,.12); }
.question-card legend { width: 100%; min-height: 84px; padding: 22px 24px; display: grid; place-items: center; color: #fff; background: var(--purple-bright); text-align: center; font-size: 17px; line-height: 1.5; font-weight: 800; }
.answer-list { padding: 20px 20px 0; display: grid; gap: 9px; }
.answer-option { padding: 9px 10px; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 14px; line-height: 1.5; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.answer-option:hover { background: #fff; transform: translateX(-2px); }
.answer-option.selected { border-color: rgba(101,48,143,.25); background: #fff; box-shadow: 0 4px 12px rgba(50,32,91,.08); }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.answer-letter { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; }
.legend-row { margin: 18px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; color: var(--purple-bright); font-size: 13px; font-weight: 700; }
.legend-row b { font-size: 16px; }
.quiz-actions { margin-top: 14px; }

.roles-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
.role-card { min-height: 220px; padding: 22px 18px 12px; display: flex; flex-direction: column; align-items: center; border: 1px solid #ded2e4; border-radius: 12px; background: var(--soft); text-align: center; box-shadow: 0 3px 9px rgba(50,32,91,.12); transition: transform 180ms ease, box-shadow 180ms ease; }
.role-card.active-role { transform: translateY(-6px); border-color: var(--role-color); box-shadow: 0 10px 24px color-mix(in srgb, var(--role-color) 24%, transparent); }
.role-letter { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--role-color); font-size: 24px; font-weight: 800; }
.role-card h2 { margin: 14px 0 32px; color: var(--role-color); font-size: 15px; }
.role-card small { color: #8b8194; font-size: 10px; }
.role-card p { margin: 8px 0 0; font-size: 13px; }
.final-result { margin-top: 20px; padding: 22px 32px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; border-radius: 12px; color: #fff; background: var(--purple-bright); box-shadow: 0 4px 12px rgba(50,32,91,.18); }
.result-dots { width: 66px; display: grid; grid-template-columns: repeat(2,26px); gap: 8px; }
.result-dots span { width: 26px; height: 26px; border-radius: 50%; }
.result-kicker { margin: 0; color: #f4d36e; font-size: 14px; font-weight: 800; }
.final-result h2 { margin: 6px 0 8px; font-size: 24px; }
.final-result p:last-child { margin: 0; color: #e7dfee; line-height: 1.7; }

@media (max-width: 900px) {
  .site-shell { width: 100%; grid-template-columns: 20px minmax(0,1fr); }
  .page-frame { padding: 18px 24px 30px; }
  .consent-layout { grid-template-columns: 1fr; }
  .context-panel { min-height: 0; gap: 26px; }
  .consent-card { order: -1; }
  .question-grid { grid-template-columns: 1fr; }
  .question-card { min-height: 0; }
  .roles-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .page-frame { padding: 16px 14px 24px; }
  .topbar { min-height: 96px; align-items: flex-start; }
  .brand { min-height: 42px; }
  .brand-logo { width: 210px; max-width: 47vw; }
  .step-badge { min-width: 0; padding: 10px 14px; font-size: 12px; }
  .intro-heading, .quiz-heading, .result-heading { margin-top: 0; }
  .alert-copy { font-size: 14px; }
  .consent-card, .context-panel { padding: 24px 20px; }
  .consent-card h2 { margin-bottom: 28px; }
  .consent-text { font-size: 14px; }
  .actions { flex-direction: column; }
  .roles-grid { grid-template-columns: 1fr; }
  .role-card { min-height: 200px; }
  .role-card h2 { margin-bottom: 20px; }
  .final-result { grid-template-columns: 1fr; text-align: center; }
  .result-dots { margin: auto; }
  .final-result .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
