:root,
[data-theme="dark"] {
  --primary: #e07bb0;
  --primary-dark: #f4a6cf;
  --bg: #1a1420;
  --card-bg: #241c2c;
  --text: #f2e9ee;
  --muted: #b7a6b3;
  --border: #3a2e42;
  --step-bg: #3a2e42;
  --btn-secondary-bg: #3a2e42;
  --low: #6fcf7a;
  --moderate: #f0c14b;
  --high: #f2755a;
  --low-bg: #1f3324;
  --moderate-bg: #382b12;
  --high-bg: #3a1f1a;
}

[data-theme="light"] {
  --primary: #a23b72;
  --primary-dark: #7d2c58;
  --bg: #fdf3f7;
  --card-bg: #ffffff;
  --text: #33202b;
  --muted: #7a6773;
  --border: #d9c3cf;
  --step-bg: #e6d4de;
  --btn-secondary-bg: #eee0e7;
  --low: #2e7d32;
  --moderate: #e6a817;
  --high: #c0392b;
  --low-bg: #e5f4e6;
  --moderate-bg: #fdf1d6;
  --high-bg: #fbe4e1;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.page {
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: relative;
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 3rem;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .site-header {
    padding: 0 2.5rem;
  }

  .theme-toggle {
    top: 0;
    right: 0;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.95rem;
  }

  .site-header h1 {
    font-size: 1.35rem;
  }
}

.site-header h1 {
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.progress {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.progress .step {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--step-bg);
  color: var(--muted);
  font-weight: bold;
}

.progress .step.active {
  background: var(--primary);
  color: #fff;
}

.progress .step.done {
  background: var(--primary-dark);
  color: #fff;
}

form label {
  display: block;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

form input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-group .radio {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.btn {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.7rem 1.6rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--primary-dark);
}

.info-list {
  padding-left: 1.2rem;
  color: var(--muted);
}

.result-box {
  text-align: center;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.result-box .risk-percent {
  font-size: 2.6rem;
  font-weight: 800;
}

.result-box .risk-level {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-low { background: var(--low-bg); color: var(--low); }
.risk-moderate { background: var(--moderate-bg); color: var(--moderate); }
.risk-high { background: var(--high-bg); color: var(--high); }

.disclaimer {
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.site-footer .credit {
  margin-top: 0.4rem;
  font-size: 0.7rem;
}

.site-footer .credit a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.site-footer .credit a:hover {
  text-decoration: underline;
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 6, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.privacy-modal[hidden] {
  display: none;
}

.privacy-modal__panel {
  width: min(100%, 460px);
  padding: 1.75rem;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.privacy-modal__panel h2 {
  margin-top: 0;
  color: var(--primary-dark);
  text-align: center;
}

.privacy-modal__panel p {
  text-align: center;
}

.privacy-modal__button {
  width: 100%;
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .card {
    padding: 1.5rem;
  }

  .privacy-modal__panel {
    padding: 1.5rem;
  }
}
