:root {
  --assessment-max: 1240px;
  --panel: #181020;
  --panel-raised: #1f162c;
  --control: #241a33;
  --control-hover: #2d2040;
  --text-strong: #f7f4fc;
  --success: #5bbf8a;
  --danger: #e0606a;
  --radius-sm: 4px;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(6, 4, 10, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 86% 18%, rgba(123, 63, 228, 0.2), transparent 32rem),
    radial-gradient(circle at 12% 86%, rgba(230, 142, 10, 0.08), transparent 26rem),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--royal-bright);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--text-strong);
  background: var(--royal);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:is(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 3px;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, var(--assessment-max));
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.13rem;
  font-weight: 600;
  text-decoration: none;
}

.brand svg {
  flex: 0 0 auto;
}

.language-control {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(24, 16, 32, 0.84);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.language-control svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.language-control select {
  min-height: 40px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: transparent;
  border: 0;
}

main {
  position: relative;
  padding: 28px 20px 64px;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(160, 107, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 107, 255, 0.11) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(70% 60% at 60% 40%, black, transparent);
}

.assessment-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.45fr);
  width: min(100%, var(--assessment-max));
  min-height: 660px;
  margin-inline: auto;
  overflow: hidden;
  background: rgba(18, 14, 26, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.signal-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 44px 38px;
  background:
    linear-gradient(160deg, rgba(123, 63, 228, 0.24), transparent 52%),
    linear-gradient(180deg, rgba(36, 26, 51, 0.94), rgba(18, 14, 26, 0.96));
  border-right: 1px solid var(--line-strong);
}

.kicker {
  margin: 0 0 18px;
  color: var(--orange-bright);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.signal-panel h2 {
  max-width: 13ch;
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.12;
}

.signal-model {
  display: grid;
  gap: 0;
  margin-block: 48px;
  counter-reset: signal;
}

.signal-model span {
  position: relative;
  padding: 13px 0 13px 38px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 1px solid var(--line-strong);
  counter-increment: signal;
}

.signal-model span::before {
  position: absolute;
  left: -6px;
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  content: "";
  background: var(--royal);
  border: 2px solid var(--panel-raised);
  border-radius: 50%;
}

.signal-model span:nth-child(3)::before {
  background: var(--orange-bright);
  box-shadow: 0 0 20px rgba(247, 168, 50, 0.46);
}

.side-note {
  max-width: 30ch;
  margin: 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.65;
}

.assessment-panel {
  min-width: 0;
  padding: 52px clamp(32px, 5vw, 72px);
}

#assessment-app {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.loading-state {
  display: grid;
  min-height: 480px;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-muted);
}

.loading-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--orange-bright);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.view {
  display: flex;
  min-height: 100%;
  flex: 1;
  flex-direction: column;
  animation: enter 240ms ease-out both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
}

.view-head {
  margin-bottom: 30px;
}

.view-head h1,
.view-head h2 {
  max-width: 18ch;
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 2.65rem;
  font-weight: 600;
  line-height: 1.07;
}

.view-head h2 {
  max-width: 22ch;
  font-size: 2rem;
  line-height: 1.16;
}

.lead {
  max-width: 62ch;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.honest-note,
.privacy-note,
.field-hint {
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.55;
}

.honest-note {
  display: flex;
  gap: 10px;
  margin: 20px 0 0;
}

.honest-note::before {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  content: "";
  background: var(--orange-bright);
  border-radius: 50%;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: auto;
  padding-top: 44px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  color: #fff;
  font-weight: 600;
  background: var(--royal);
  border: 1px solid var(--royal);
  border-radius: var(--radius-sm);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.primary-button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.primary-button:active {
  background: var(--primary-active);
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.secondary-button {
  color: var(--text);
  background: transparent;
  border-color: var(--line-strong);
}

.secondary-button:hover {
  background: var(--control);
}

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

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}

.progress-value {
  height: 100%;
  background: linear-gradient(90deg, var(--royal), var(--orange-bright));
  transition: width 220ms ease-out;
}

.question-title {
  max-width: 28ch;
  margin: 0 0 28px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.24;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 13px;
  width: 100%;
  min-height: 54px;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  text-align: left;
  background: rgba(36, 26, 51, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.option:hover {
  color: var(--text);
  background: var(--control-hover);
  border-color: var(--line-strong);
}

.option[data-selected="true"] {
  color: var(--text-strong);
  background: rgba(123, 63, 228, 0.16);
  border-color: var(--royal-bright);
}

.option-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.option[data-selected="true"] .option-index {
  color: #fff;
  background: var(--royal);
  border-color: var(--royal);
}

.nav-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text-strong);
  background: var(--control);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.consent-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 13px;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.checkbox-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--royal);
}

.required-mark {
  color: var(--orange-bright);
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  color: #ffc9ce;
  font-size: 0.82rem;
  line-height: 1.5;
  background: rgba(224, 96, 106, 0.12);
  border: 1px solid rgba(224, 96, 106, 0.38);
  border-radius: var(--radius);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.submitting-state {
  display: grid;
  min-height: 460px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.submitting-state h2 {
  max-width: 26ch;
  margin: 22px 0 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.result-layout {
  display: grid;
  gap: 34px;
}

.score-hero {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 34px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.score-ring {
  position: relative;
  display: grid;
  width: 160px;
  height: 160px;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(circle at center, var(--panel) 62%, transparent 63%),
    conic-gradient(var(--orange-bright) var(--score-angle), var(--line) 0);
  border-radius: 50%;
}

.score-number {
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
}

.score-denominator {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.stage-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--orange-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.score-summary {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.68;
}

.result-section h3 {
  margin: 0 0 16px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.constraint-card {
  padding: 22px;
  background: rgba(123, 63, 228, 0.11);
  border: 1px solid rgba(160, 107, 255, 0.32);
  border-left: 3px solid var(--royal-bright);
  border-radius: var(--radius);
}

.constraint-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.constraint-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.dimension-list {
  display: grid;
  gap: 15px;
}

.dimension-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 1.2fr) 60px;
  gap: 14px;
  align-items: center;
}

.dimension-name {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dimension-track {
  height: 7px;
  overflow: hidden;
  background: var(--line);
  border-radius: 4px;
}

.dimension-value {
  height: 100%;
  background: var(--royal-bright);
  border-radius: inherit;
}

.dimension-score {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: right;
}

.risk-list {
  display: grid;
  gap: 9px;
  padding: 0;
  list-style: none;
}

.risk-list li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
  background: rgba(224, 96, 106, 0.08);
  border: 1px solid rgba(224, 96, 106, 0.22);
  border-radius: var(--radius);
}

.risk-list li::before {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  content: "";
  background: var(--danger);
  border-radius: 50%;
}

.action-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.action-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--panel-raised);
}

.action-number {
  color: var(--orange-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.action-card h4 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.action-card p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.58;
}

.first-step {
  color: var(--text) !important;
}

.delivery-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  background: rgba(91, 191, 138, 0.08);
  border: 1px solid rgba(91, 191, 138, 0.24);
  border-radius: var(--radius);
}

.diagnostic-card {
  padding: 26px;
  background: linear-gradient(145deg, rgba(123, 63, 228, 0.18), rgba(36, 26, 51, 0.78));
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--orange-bright);
  border-radius: var(--radius);
}

.diagnostic-card h3 {
  max-width: 30ch;
}

.diagnostic-card p {
  max-width: 60ch;
  margin: 0 0 20px;
  color: var(--text-muted);
  line-height: 1.65;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer {
  min-height: 72px;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.site-footer a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  text-underline-offset: 3px;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }

@media (max-width: 920px) {
  .assessment-shell {
    grid-template-columns: 1fr;
  }

  .signal-panel {
    display: none;
  }

  .assessment-panel {
    min-height: 650px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    width: min(100% - 32px, var(--assessment-max));
  }

  .site-header {
    min-height: 72px;
  }

  .brand span {
    font-size: 1rem;
  }

  main {
    padding: 12px 12px 44px;
  }

  .assessment-shell {
    min-height: calc(100dvh - 100px);
  }

  .assessment-panel {
    min-height: 620px;
    padding: 34px 22px;
  }

  .view-head h1 {
    font-size: 2.1rem;
  }

  .view-head h2,
  .question-title {
    font-size: 1.55rem;
  }

  .intro-actions,
  .nav-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-actions .primary-button,
  .nav-actions button,
  .result-actions :is(a, button) {
    width: 100%;
  }

  .nav-actions {
    flex-direction: row;
  }

  .nav-actions button {
    width: auto;
    flex: 1;
  }

  .option {
    min-height: 60px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-full,
  .consent-list {
    grid-column: auto;
  }

  .score-hero {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .dimension-row {
    grid-template-columns: 1fr 52px;
  }

  .dimension-track {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .dimension-score {
    grid-row: 1;
    grid-column: 2;
  }

  .site-footer {
    flex-wrap: wrap;
  }
}

@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;
  }
}

@media print {
  .site-header,
  .site-footer,
  .signal-panel,
  .result-actions {
    display: none !important;
  }

  body,
  main,
  .assessment-shell,
  .assessment-panel {
    color: #111;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .assessment-shell {
    display: block;
  }
}
