:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #142033;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #1c64f2;
  --brand-dark: #1552c0;
  --success: #12b76a;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.10);
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(28, 100, 242, 0.12), transparent 34rem), linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.page {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  padding: 26px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6ea8ff);
  box-shadow: 0 12px 28px rgba(28, 100, 242, 0.28);
}

.lang-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

main {
  display: grid;
  place-items: center;
  padding: 28px 0 36px;
}

.shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 22px;
  align-items: stretch;
}

.hero, .quiz-card, .legal-card {
  border: 1px solid rgba(228, 231, 236, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  color: #175cd3;
  background: #eff8ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1 {
  margin: 18px 0 10px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.compliance-note, .legal-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.trust {
  display: grid;
  gap: 12px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.trust span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--success);
  font-size: 14px;
}

.quiz-card {
  padding: 30px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.progress {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.progress-bar {
  width: 33.333%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #77aaff);
  transition: width 220ms ease;
}

.question {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.quiz-view {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  width: 100%;
  min-height: 64px;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: #1d2939;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.answer:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(16, 24, 40, 0.08); }
.answer.selected { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(28, 100, 242, 0.12); }

.actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.btn {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 14px 36px rgba(28, 100, 242, 0.24); }
.btn-primary:not(:disabled):hover { background: var(--brand-dark); }
.btn-ghost { color: #344054; background: #eef2f6; }

.loader-view, .result {
  display: none;
  flex: 1;
  place-items: center;
  text-align: center;
}

.loader-view.active, .result.active { display: grid; }
.hidden { display: none !important; }

.loader-inner, .result-inner { width: min(420px, 100%); margin: 0 auto; }
.loader {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 999px;
  border: 7px solid #eaf0ff;
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

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

.success-mark {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--success), #6ce9a6);
  font-size: 38px;
  font-weight: 900;
}

.result .btn-primary { margin-top: 24px; width: 100%; }

.legal-main {
  align-items: start;
  padding-top: 18px;
}

.legal-card {
  width: min(920px, 100%);
  padding: clamp(26px, 4vw, 46px);
}

.legal-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.legal-back {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.legal-updated {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.legal-content {
  margin-top: 30px;
  display: grid;
  gap: 24px;
}

.legal-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.legal-section p {
  margin: 0 0 12px;
  color: #475467;
  font-size: 16px;
  line-height: 1.75;
}

footer {
  padding: 18px 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
  font-weight: 800;
}

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  width: min(720px, calc(100% - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 60px rgba(16, 24, 40, 0.18);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateX(-50%);
}

.cookie-banner.active { display: flex; }
.cookie-copy { margin: 0; color: #475467; font-size: 14px; font-weight: 700; line-height: 1.45; }
.cookie-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-actions .btn { min-height: 42px; border-radius: 14px; font-size: 13px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .hero { gap: 24px; }
  .quiz-card { min-height: 520px; }
  .legal-topline { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .page { width: min(100% - 20px, 1120px); }
  .topbar { padding-top: 18px; }
  .hero, .quiz-card, .legal-card { border-radius: 22px; }
  .hero, .quiz-card { padding: 22px; }
  .actions { grid-template-columns: 1fr; }
  .cookie-banner { align-items: stretch; flex-direction: column; }
  .cookie-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

/* PHP locale switcher */
.locale-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(228, 231, 236, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
  backdrop-filter: blur(14px);
}

.locale-current {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6ea8ff);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 22px rgba(28, 100, 242, 0.22);
}

.locale-select {
  width: 142px;
  min-height: 38px;
  border: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 34px 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.locale-switcher::after {
  content: "";
  position: absolute;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #98a2b3;
  border-bottom: 2px solid #98a2b3;
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.locale-select:focus-visible {
  box-shadow: 0 0 0 4px rgba(28, 100, 242, 0.12);
}

@media (max-width: 560px) {
  .locale-switcher { gap: 4px; padding: 5px; }
  .locale-current { width: 34px; height: 34px; font-size: 12px; }
  .locale-select { width: 104px; min-height: 34px; font-size: 12px; padding-left: 6px; padding-right: 26px; }
  .locale-switcher::after { right: 12px; width: 7px; height: 7px; }
}
