:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --card: #111726;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --border: #1f2937;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --risk-low: #34d399;
  --risk-medium: #fbbf24;
  --risk-high: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.topbar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.topbar a:hover {
  text-decoration: underline;
}

.progress-wrap {
  max-width: 760px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
}

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

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}

.progress-label {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.container {
  max-width: 760px;
  margin: 1rem auto 3rem;
  padding: 0 1.5rem;
}

.section-intro {
  color: var(--muted);
  margin-top: -0.5rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.1rem;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-copy {
  flex: 1;
}

.toggle-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-label {
  font-weight: 600;
}

.badge-active {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.toggle-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
}

.consent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

.consent-row input {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.btn-full {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.required {
  color: var(--risk-high);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.section-icon {
  flex-shrink: 0;
  color: var(--accent);
  background: rgba(20, 184, 166, 0.12);
  border-radius: 8px;
  padding: 6px;
  box-sizing: content-box;
}

.question {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.question.skipped {
  opacity: 0.6;
}

.question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.question-text {
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.4rem;
}

.q-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  margin-right: 0.55rem;
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.14);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.35rem;
  color: var(--muted);
  cursor: help;
  vertical-align: middle;
}

.info-icon:hover,
.info-icon:focus {
  color: var(--accent);
  outline: none;
}

.info-tooltip {
  display: none;
  position: absolute;
  left: 0;
  top: 135%;
  width: 280px;
  max-width: 70vw;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 20;
  text-align: left;
}

.info-icon:hover .info-tooltip,
.info-icon:focus .info-tooltip {
  display: block;
}

.question-input textarea,
.question-input input[type='text'] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 400;
  font-size: 0.92rem;
  margin: 0.4rem 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice:hover {
  border-color: var(--accent);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(20, 184, 166, 0.1);
}

.choice input[type='checkbox'],
.choice input[type='radio'] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.choice-text {
  flex: 1;
}

.btn-skip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
  white-space: nowrap;
}

.btn-skip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.skipped-note {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.score-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.score-tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  color: #fff;
}

.risk-low, .score-tag.risk-low { color: var(--risk-low); }
.risk-medium, .score-tag.risk-medium { color: var(--risk-medium); }
.risk-high, .score-tag.risk-high { color: var(--risk-high); }
.score-tag.risk-low { background: var(--risk-low); color: #06281c; }
.score-tag.risk-medium { background: var(--risk-medium); color: #2b1a02; }
.score-tag.risk-high { background: var(--risk-high); color: #2b0b0b; }

.pillar-list {
  margin-bottom: 1.5rem;
}

.pillar-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pillar-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.pillar-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.pillar-bar-fill {
  height: 100%;
}

.pillar-bar-fill.risk-low { background: var(--risk-low); }
.pillar-bar-fill.risk-medium { background: var(--risk-medium); }
.pillar-bar-fill.risk-high { background: var(--risk-high); }

.pillar-score {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}

.rec-list li {
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.history-table button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-right: 0.3rem;
}

.history-table button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Landing page ---- */

.lp-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.lp-brand-icon {
  color: #2dd4bf;
  display: inline-flex;
}

.lp-brand-name {
  color: #f3f4f6;
}

.lp-hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #5eead4;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
}

.lp-headline {
  font-size: 2.75rem;
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 1.25rem;
  color: #f9fafb;
}

.lp-headline-accent {
  color: #2dd4bf;
}

.lp-subtext {
  color: #9aa4b2;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 2rem;
}

.lp-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #14b8a6;
  padding: 0.9rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
}

.lp-cta:hover {
  background: #0d9488;
}

.lp-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #6b7280;
  font-size: 0.85rem;
  margin: 1.5rem auto 0;
  max-width: 480px;
}

.lp-pillars-strip {
  background: #0f1420;
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  padding: 2rem 1.5rem;
  text-align: center;
}

.lp-pillars-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.lp-pillars-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.lp-chip {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.lp-chip-govern { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(168, 85, 247, 0.35); }
.lp-chip-identify { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border-color: rgba(96, 165, 250, 0.35); }
.lp-chip-protect { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; border-color: rgba(45, 212, 191, 0.35); }
.lp-chip-detect { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.lp-chip-respond { background: rgba(251, 146, 60, 0.15); color: #fb923c; border-color: rgba(251, 146, 60, 0.35); }
.lp-chip-recover { background: rgba(52, 211, 153, 0.15); color: #34d399; border-color: rgba(52, 211, 153, 0.35); }

.lp-features {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.lp-features-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f9fafb;
  margin: 0 0 2rem;
}

.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.lp-feature-card {
  background: #111726;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 1.5rem;
}

.lp-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
  margin-bottom: 0.9rem;
}

.lp-feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #f3f4f6;
}

.lp-feature-card p {
  margin: 0;
  color: #9aa4b2;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .lp-headline {
    font-size: 2.1rem;
  }
}
