/* === Design tokens from Roadmap Open Finance 2026 poster === */
:root {
  --bg-deep: #071e1e;
  --bg-primary: #0a2e2a;
  --bg-card: #0f3b35;
  --bg-card-hover: #134a42;
  --accent: #00d4a0;
  --accent-dim: #00a87e;
  --accent-glow: rgba(0, 212, 160, 0.15);
  --text-primary: #ffffff;
  --text-secondary: #a8c5c0;
  --text-muted: #6b9490;
  --danger: #ff6b6b;
  --warning: #ffc857;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 640px;
}

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
}

/* === Screens === */
.screen {
  display: none;
  min-height: 100dvh;
  padding: 2rem 1rem;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

/* === Progress bar === */
.progress-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* === Landing === */
.landing-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

#screen-landing .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 520px;
}

.disclaimer-small {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  font-style: italic;
}

.privacy-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* === Buttons === */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  max-width: 360px;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Lead gate screen === */
.lead-gate-card {
  text-align: center;
  padding-top: 2rem;
}
.lead-gate-card h2 {
  margin-bottom: 0.75rem;
}
.lead-gate-note {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.lead-gate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

/* === Typography === */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }

.section-sub {
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.section-title {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* === Questions (context screen) === */
.question-group {
  margin-bottom: 1.75rem;
}

.question-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-card {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.radio-card:hover { background: var(--bg-card-hover); }
.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.radio-card input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  margin-right: 0.75rem;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}
.radio-card input:checked {
  border-color: var(--accent);
}
.radio-card input:checked::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.radio-card span {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* === Scenario screen === */
.scenario-counter {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.scenario-setup {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--bg-card-hover);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.textarea::placeholder { color: var(--text-muted); }

/* === LLM summary === */
.llm-summary {
  background: var(--accent-glow);
  border: 1px solid rgba(0, 212, 160, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.summary-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
#llm-summary-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Loading === */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
.loading-spinner.large {
  width: 56px;
  height: 56px;
  border-width: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Results === */
.results-header {
  margin-bottom: 1.5rem;
}
.results-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.results-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.session-badge {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}
.btn-share {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-share:hover {
  background: var(--accent-glow);
}

/* === Estimate cards === */
.headline-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.estimate-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.estimate-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
}
.estimate-card.status-quo {
  border: 1.5px solid rgba(255, 200, 87, 0.3);
}
.estimate-card.optimized {
  border: 1.5px solid rgba(0, 212, 160, 0.3);
}

.estimate-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.estimate-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}
.estimate-card.status-quo .estimate-number {
  color: var(--warning);
}
.estimate-card.optimized .estimate-number {
  color: var(--accent);
}

.estimate-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

@media (max-width: 420px) {
  .estimate-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .estimate-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}

/* === Disclaimer box === */
.disclaimer-box {
  background: rgba(255, 200, 87, 0.08);
  border: 1px solid rgba(255, 200, 87, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.disclaimer-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}

/* === Dimension scores === */
.dimension-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  transition: border 0.2s;
  border: 1.5px solid transparent;
}
.dimension-row.lowest {
  border-color: var(--warning);
}
.dimension-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}
.dimension-dots {
  display: flex;
  gap: 6px;
}
.dimension-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  border: 1.5px solid var(--text-muted);
  transition: background 0.3s, border-color 0.3s;
}
.dimension-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}
.dimension-dot.filled.warning {
  background: var(--warning);
  border-color: var(--warning);
}
.dimension-score {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}

/* === Opportunity card === */
.opportunity-card {
  background: var(--accent-glow);
  border: 1px solid rgba(0, 212, 160, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === Recommendations === */
.rec-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 0.75rem;
}
.rec-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.rec-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Calculation details === */
.calc-details {
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}
.calc-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
}
.calc-details summary::before {
  content: '+ ';
  color: var(--accent);
}
.calc-details[open] summary::before { content: '- '; }
.calc-details p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Lead capture === */
.lead-cta-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}
.lead-cta-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.lead-cta-card > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
}

.input {
  width: 100%;
  max-width: 360px;
  background: var(--bg-deep);
  border: 1.5px solid var(--bg-card-hover);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
}
.input::placeholder { color: var(--text-muted); }

.success-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.success-text {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.cto-questions {
  text-align: left;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-top: 1rem;
}
.cto-questions h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.cto-questions ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cto-questions li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--bg-card);
  margin-top: 1rem;
}
.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.footer a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* === Responsive === */
@media (min-width: 480px) {
  h1 { font-size: 2.4rem; }
  .headline-number { font-size: 3rem; }
}

/* === Error toast === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 100;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
