:root {
  color-scheme: dark;
  --bg: #0b1220;
  --card: #111a2e;
  --card-strong: #16223a;
  --text: #e8edf6;
  --muted: #aebbd0;
  --accent: #38bdf8;
  --accent-dark: #082f49;
  --green: #34d399;
  --green-dark: #073b30;
  --amber: #fbbf24;
  --amber-dark: #402d05;
  --red: #f87171;
  --red-dark: #451a1a;
  --line: #283650;
  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

button,
input,
a {
  font: inherit;
}

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

.site-header,
.app-shell,
.noscript {
  width: min(100% - 32px, 480px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px 14px;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
}

.brand__mark {
  width: 26px;
  height: 26px;
}

.site-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: right;
}

.app-shell {
  padding-block: 14px 48px;
  overflow: hidden;
}

.screen {
  animation: screen-in 240ms var(--ease-out) both;
}

.quiz-card,
.gate-card,
.report-section,
.share-block {
  background: var(--card);
  border-radius: var(--radius);
}

.quiz-card,
.gate-card {
  padding: clamp(22px, 6vw, 32px);
}

.quiz-card {
  border: 1px solid var(--line);
}

.landing {
  padding-block: clamp(34px, 12vw, 64px);
  text-align: center;
}

.landing__mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-dark);
  font-size: 1.45rem;
  font-weight: 850;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.landing h1 {
  max-width: 12ch;
  margin-inline: auto;
  margin-bottom: 16px;
  font-size: clamp(2rem, 9vw, 2.8rem);
}

.landing__sub {
  max-width: 36ch;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 1rem;
}

.trust-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.primary-button,
.secondary-button,
.answer-button,
.back-button,
.share-button,
.share-link {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms var(--ease-out);
}

.primary-button {
  width: 100%;
  padding: 12px 18px;
  color: var(--bg);
  background: var(--accent);
  font-weight: 800;
}

.primary-button:hover {
  background: #7dd3fc;
}

.primary-button:active,
.secondary-button:active,
.answer-button:active,
.share-button:active,
.share-link:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.question-header {
  margin-bottom: 26px;
}

.question-header__top {
  display: grid;
  grid-template-columns: 68px 1fr 68px;
  align-items: center;
  margin-bottom: 12px;
}

.question-count {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.back-button {
  min-width: 48px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
}

.back-button:hover {
  color: var(--text);
  background: var(--card-strong);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #23304a;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms var(--ease-out);
}

.question-title {
  margin-bottom: 24px;
  font-size: clamp(1.45rem, 6.5vw, 2rem);
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--card-strong);
  font-weight: 650;
  text-align: left;
}

.answer-button:hover {
  border-color: #527095;
  background: #1b2944;
}

.answer-button.is-selected {
  color: #dff5ff;
  border-color: var(--accent);
  background: var(--accent-dark);
}

.feedback {
  min-height: 48px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  animation: feedback-in 180ms var(--ease-out) both;
}

.feedback--0 {
  color: #fecaca;
  background: var(--red-dark);
}

.feedback--1 {
  color: #fde68a;
  background: var(--amber-dark);
}

.feedback--2 {
  color: #a7f3d0;
  background: var(--green-dark);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.teaser {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 7vw, 38px);
  border: 1px solid #2a5370;
  border-radius: var(--radius);
  background: var(--card);
}

.teaser::after {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--accent);
  content: "";
}

.score-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.score-value {
  margin: 0;
  color: var(--text);
  font-size: clamp(3.75rem, 18vw, 5.5rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.score-value__total {
  color: var(--muted);
  font-size: 0.35em;
  letter-spacing: 0;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 22px 0 14px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.teaser h1 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 8vw, 2.55rem);
}

.tier-line {
  margin: 0;
  color: var(--muted);
}

.leak-teaser {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.leak-name {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.leak-teaser p {
  margin: 0;
  font-weight: 800;
}

.gate-card {
  border: 1px solid var(--line);
}

.gate-card h2,
.full-report h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.gate-list {
  margin: 0 0 26px;
  padding-left: 21px;
  color: var(--muted);
}

.gate-list li + li {
  margin-top: 7px;
}

.field-group {
  margin-bottom: 17px;
}

.field-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

.field-group input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  color: var(--text);
  border: 1px solid #425371;
  border-radius: 9px;
  background: #0d1628;
}

.field-group input::placeholder {
  color: #99a8be;
}

.field-group input:focus {
  border-color: var(--accent);
}

.hp-field {
  position: absolute;
  left: -9999px;
}

.turnstile-slot {
  min-height: 0;
  margin-bottom: 16px;
}

.form-error {
  min-height: 24px;
  margin: 0 0 12px;
  color: #fecaca;
  font-size: 0.88rem;
  font-weight: 700;
}

.full-report {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-section,
.share-block {
  padding: clamp(22px, 6vw, 30px);
}

.report-section {
  border: 1px solid var(--line);
}

.scale-line {
  margin: 0 0 18px;
  color: var(--green);
  font-weight: 750;
}

.leak-ranking {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.leak-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 14px;
  align-items: center;
  padding: 15px;
  border-radius: 10px;
  background: var(--card-strong);
}

.leak-row__name {
  font-weight: 800;
}

.leak-row__score {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 850;
}

.leak-row__status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.first-fix {
  border-color: #2a5370;
}

.first-fix p,
.sms-note {
  margin-bottom: 0;
  color: var(--muted);
}

.sms-note {
  padding: 0 4px;
  color: var(--green);
  font-weight: 750;
}

.share-block {
  background: var(--card-strong);
}

.share-block h2 {
  margin-bottom: 8px;
}

.share-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-button,
.share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  color: var(--text);
  border: 1px solid #4b5f7e;
  background: transparent;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.share-button:hover,
.share-link:hover {
  border-color: var(--accent);
  background: var(--accent-dark);
}

.share-button--native {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
}

.share-button--native:hover {
  color: var(--bg);
  background: #7dd3fc;
}

.share-button__note {
  display: block;
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.share-button--native .share-button__note {
  color: var(--accent-dark);
}

.noscript {
  padding: 18px;
  color: var(--red);
  text-align: center;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 380px) {
  .site-header,
  .app-shell,
  .noscript {
    width: min(100% - 22px, 480px);
  }

  .site-title {
    max-width: 13ch;
  }

  .quiz-card,
  .gate-card,
  .report-section,
  .share-block {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
