/* Header */
:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2235;
  --border: #1e2d45;
  --accent: #00b4d8;
  --accent2: #0077b6;
  --text: #e0eaf8;
  --text-dim: #7a96b8;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --green-bg: rgba(34,197,94,0.1);
  --yellow-bg: rgba(234,179,8,0.1);
  --red-bg: rgba(239,68,68,0.1);
  --selected-bg: rgba(0,180,216,0.15);
  --selected-border: #00b4d8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  padding: 0;
}

.ra-header {
  background: linear-gradient(135deg, #0a0e1a 0%, #0d1b2e 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 16px 16px;
  position: sticky;
  top: 95px;
  z-index: 100;
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

.header-text p {
  font-size: 1rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Score bar */
.score-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 200px;
  z-index: 99;
}

.score-bar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.score-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.score-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--green);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1), background 0.4s ease;
}

.score-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  font-weight: 400;
  min-width: 42px;
  text-align: right;
  transition: color 0.3s ease;
  color: var(--green);
}

.progress-text {
  font-size: 1.65rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Main content */
.main {
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 12px 100px;
}

.intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 1.2rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

/* Question cards */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.question-card.answered {
  border-color: var(--accent2);
}

.question-card.has-five {
  border-color: var(--yellow);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.q-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  background: rgba(0,180,216,0.1);
  border: 1px solid rgba(0,180,216,0.2);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.q-title {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
}

.q-score-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  background: var(--selected-bg);
  border: 1px solid var(--selected-border);
  color: var(--accent);
  border-radius: 3px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.answered .q-score-badge { opacity: 1; }

/* Options grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.option-btn {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--border);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:last-child { border-right: none; }

.option-btn:active { background: rgba(0,180,216,0.08); }

.option-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 400;
}

.option-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--text-dim);
  line-height: 1.3;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  transition: all 0.2s ease;
  margin-top: 2px;
}

/* Selected state */
.option-btn.selected {
  background: var(--selected-bg);
}

.option-btn.selected .option-num {
  color: var(--accent);
}

.option-btn.selected .option-label {
  color: var(--text);
}

.option-btn.selected .option-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(0,180,216,0.5);
}

/* Score 5 selected — warning */
.option-btn[data-score="5"].selected {
  background: rgba(234,179,8,0.1);
}

.option-btn[data-score="5"].selected .option-num,
.option-btn[data-score="5"].selected .option-label {
  color: var(--yellow);
}

.option-btn[data-score="5"].selected .option-dot {
  background: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 0 0 6px rgba(234,179,8,0.5);
}

/* Disabled/N/A options */
.option-btn.na {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* Results panel */
.results-panel {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.results-inner {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 20px 20px 28px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
}

.results-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.risk-display {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.risk-score-big {
  font-family: 'Share Tech Mono', monospace;
  font-size: 3rem;
  line-height: 1;
  font-weight: 400;
  transition: color 0.4s ease;
}

.risk-info {
  flex: 1;
}

.risk-level {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.risk-message {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.risk-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.4s ease;
}

.reset-btn {
  width: 100%;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:active {
  background: var(--border);
  color: var(--text);
}

.five-warning {
  display: none;
  font-size: 0.72rem;
  color: var(--yellow);
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

/* Pulse animation on score change */
@keyframes pulse-score {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.score-num.pulse {
  animation: pulse-score 0.25s ease;
}

@media (min-width: 480px) {
  .option-label { font-size: 1.2rem; }
  .option-btn { padding: 12px 8px; }
}

/* Disclaimer modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  touch-action: none;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--accent2);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  max-width: 480px;
  width: 100%;
  padding: 28px 24px 24px;
  box-shadow: 0 0 48px rgba(0,180,216,0.12), 0 16px 40px rgba(0,0,0,0.6);
  touch-action: auto;          /* ← added */
  position: relative;          /* ← added */
  z-index: 501;                /* ← added */
}

.modal-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-icon svg { flex-shrink: 0; }

.modal-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.2;
}

.modal-body {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 10px;
}

.modal-body strong {
  color: var(--text);
  font-weight: 600;
}

.modal-list {
  list-style: none;
  margin: 10px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.modal-list li::before {
  content: '›';
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.modal-question {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.modal-btns {
  display: flex;
  gap: 10px;
}

.btn-agree {
  flex: 1;
  padding: 13px;
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: #000;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;             /* ← added */
  -webkit-tap-highlight-color: transparent; /* ← added */
  position: relative;                     /* ← added */
  z-index: 10;
}

.btn-agree:active { opacity: 0.85; }

.btn-disagree {
  flex: 1;
  padding: 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-disagree:active {
  background: var(--surface2);
  color: var(--text);
}

/* Declined screen */
.declined-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 24px;
  flex-direction: column;
  text-align: center;
}

.declined-icon {
  margin-bottom: 20px;
  opacity: 0.4;
}

.declined-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.declined-msg {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 360px;
  margin-bottom: 28px;
  opacity: 0.7;
}

.btn-optin {
  padding: 13px 28px;
  background: var(--surface);
  border: 1px solid var(--accent2);
  border-radius: 5px;
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-optin:active {
  background: var(--surface2);
}
