:root {
  --max-width: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-mark {
  color: var(--accent);
}

.logo-sub {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.site-nav .nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}

.site-nav .nav-cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 1.2rem;
  cursor: pointer;
}

.main-content {
  flex: 1;
  padding: 2rem 0 3rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-inner {
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner p {
  margin: 0.35rem 0;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.25;
}

.hero p {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 60ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-glow.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.consent-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.consent-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
}

.consent-label input {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.disclaimer-box {
  background: var(--accent-soft);
  border: 1px solid #99f6e4;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.9rem;
  color: #115e59;
}

.stepper {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
  margin: 0;
  overflow-x: auto;
}

.stepper-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  opacity: 0.55;
}

.stepper-item.is-active,
.stepper-item.is-done {
  opacity: 1;
}

.stepper-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--border);
  color: var(--muted);
}

.stepper-item.is-active .stepper-num {
  background: var(--accent);
  color: #fff;
}

.stepper-item.is-done .stepper-num {
  background: #14b8a6;
  color: #fff;
}

.stepper-label {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.2;
}

.progress-wrap {
  margin-bottom: 1.5rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s;
}

.test-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.test-instruction {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  scroll-margin-top: 100px;
}

.question-card.is-invalid {
  border-color: #fca5a5;
  background: #fffafa;
}

.question-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.question-text {
  margin: 0.35rem 0 1rem;
  font-weight: 500;
}

.answer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.answer-option {
  position: relative;
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer-option label {
  display: block;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
  user-select: none;
}

.answer-option input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #115e59;
  font-weight: 600;
}

.sticky-submit {
  position: sticky;
  bottom: 0;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: 1.5rem;
}

.score-grid {
  display: grid;
  gap: 1rem;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.score-item:last-child {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--border);
  color: var(--muted);
}

.badge-low { background: #dbeafe; color: #1d4ed8; }
.badge-average { background: #e2e8f0; color: #475569; }
.badge-high { background: #fee2e2; color: #b91c1c; }
.badge-moderate { background: #fef3c7; color: #b45309; }
.badge-very_high { background: #fecaca; color: #991b1b; }

.rec-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rec-item {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

.rec-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.rec-item p {
  margin: 0;
  color: var(--muted);
}

.test-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.test-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.test-list li:last-child {
  border-bottom: none;
}

.share-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.share-box {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.share-box label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.share-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-row input {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .stepper-label {
    display: none;
  }

  .answer-options {
    flex-direction: column;
  }

  .answer-option label {
    text-align: center;
  }
}
