:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #171717;
  --muted-foreground: #737373;
  --secondary: #f5f5f5;
  --secondary-strong: #eeeeee;
  --border: #e5e5e5;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --radius: 10px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
}

button,
input {
  font: inherit;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: min(100% - 32px, 1152px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  align-items: start;
}

@media (min-width: 768px) {
  .app-shell {
    padding: 64px 0;
  }
}

.intro-screen,
.question-screen {
  width: 100%;
  max-width: 576px;
  margin: 0 auto;
}

.intro-screen {
  text-align: center;
}

.hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: var(--secondary);
  display: grid;
  place-items: center;
}

.hero-icon svg {
  width: 32px;
  height: 32px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(1.875rem, 5vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.3;
}

.intro-lead {
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.55;
}

.intro-note {
  margin-bottom: 28px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: var(--foreground);
  color: var(--background);
}

.button-primary:hover:not(:disabled) {
  background: #2b2b2b;
}

.button-outline {
  border-color: var(--border);
  background: var(--background);
  color: var(--foreground);
}

.button-outline:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  background: var(--secondary);
}

.button-ghost {
  color: var(--foreground);
}

.button-lg {
  width: min(100%, 320px);
  min-height: 56px;
  font-size: 1.125rem;
}

.button-full {
  width: 100%;
}

.button-icon svg {
  width: 16px;
  height: 16px;
}

.feature-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  text-align: left;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-card {
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
  padding: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.45;
}

.feature-icon {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--muted-foreground);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.progress-block {
  margin-bottom: 32px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--secondary);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--foreground);
  transition: width 300ms ease-out;
}

.option-list {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.option-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.option-button:hover {
  border-color: color-mix(in srgb, var(--foreground) 50%, transparent);
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
}

.option-button.is-selected {
  border-color: var(--foreground);
  background: var(--secondary);
}

.option-button span {
  display: block;
  font-weight: 600;
}

.nav-row {
  display: flex;
  gap: 12px;
}

.nav-row .button {
  flex: 1;
}

.result-screen {
  width: 100%;
  max-width: 672px;
  margin: 0 auto;
}

.result-header {
  margin-bottom: 32px;
  text-align: center;
}

.risk-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.risk-icon svg {
  width: 40px;
  height: 40px;
}

.risk-low-bg {
  background: var(--emerald-bg);
  color: var(--emerald);
}

.risk-medium-bg {
  background: var(--amber-bg);
  color: var(--amber);
}

.risk-high-bg {
  background: var(--red-bg);
  color: var(--red);
}

.risk-low-text {
  color: var(--emerald);
}

.risk-medium-text {
  color: var(--amber);
}

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

.result-header p {
  max-width: 544px;
  margin: 0 auto;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.residence-note {
  margin-top: 8px !important;
  font-size: 0.875rem;
  font-style: italic;
}

.risk-section {
  margin-bottom: 32px;
}

.risk-section h2,
.next-step h2 {
  margin-bottom: 16px;
  font-size: 1.125rem;
  line-height: 1.3;
}

.risk-list {
  display: grid;
  gap: 12px;
}

.risk-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--secondary) 30%, transparent);
  padding: 16px;
}

.risk-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.risk-number {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.875rem;
  font-weight: 700;
}

.risk-card p {
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.next-step {
  margin-bottom: 32px;
  border: 2px solid var(--foreground);
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary) 20%, transparent);
  padding: 24px;
}

.next-step p {
  margin-bottom: 16px;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.config-warning {
  margin: 12px 0 0 !important;
  color: var(--amber) !important;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.email-capture {
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  padding: 24px;
}

.email-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.email-title p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.email-icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--muted-foreground);
}

.email-icon svg {
  width: 20px;
  height: 20px;
}

.email-form {
  display: grid;
  gap: 16px;
}

.email-form input[type="email"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  padding: 0 12px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1.45;
}

.consent-row input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--foreground);
}

.email-success {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  background: var(--emerald-bg);
  padding: 12px;
  color: #047857;
}

.email-success[hidden] {
  display: none;
}

.email-success svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.email-success p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.45;
}

.email-error {
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.45;
}

.restart-row {
  text-align: center;
}

.disclaimer {
  margin: 32px auto 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 24px, 1152px);
  }

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