/* MyBipolarTest.org - Stylesheet */
:root {
  --color-primary: #0d7377;
  --color-primary-dark: #095658;
  --color-primary-light: #14919b;
  --color-bg: #f0f9fa;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

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

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 800px; margin: 0 auto; padding: 0 1.25rem; }

/* Navigation */
.nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  text-decoration: none;
}
.nav-links { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--color-text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--color-primary); }
.nav-cta {
  background: var(--color-primary) !important;
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--color-primary-dark) !important; }

/* Hero */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, #0d7377 0%, #14919b 100%);
  color: white;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto var(--space-xl); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-white { background: white; color: var(--color-primary); }
.btn-white:hover { background: #f0fafa; transform: translateY(-1px); }

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

/* Section */
.section { padding: var(--space-3xl) 0; }
.section-alt { background: var(--color-surface); }
.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}

/* Test container */
.test-container {
  max-width: 640px;
  margin: var(--space-2xl) auto;
  padding: 0 1.25rem;
}
.test-header { text-align: center; margin-bottom: var(--space-xl); }
.test-header h1 { font-size: 1.75rem; color: var(--color-text); }

/* Progress */
.progress-wrapper { margin-bottom: var(--space-xl); }
.progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
  display: block;
}

/* Questions */
.question-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.section-label {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}
.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
  outline: none;
}
.answer-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.answer-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--color-text);
}
.answer-option:hover { border-color: var(--color-primary-light); background: #f0fafa; }
.answer-option.selected {
  border-color: var(--color-primary);
  background: #e6f7f7;
}
.answer-option-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.answer-option.selected .answer-option-indicator {
  border-color: var(--color-primary);
  background: var(--color-primary);
}
.answer-option.selected .answer-option-indicator::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: white;
  border-radius: 50%;
}

/* Test nav */
.test-nav { display: flex; justify-content: flex-start; margin-top: var(--space-xl); }
.test-nav button { font-family: inherit; }

/* Results */
.results-container {
  max-width: 700px;
  margin: var(--space-2xl) auto;
  padding: 0 1.25rem;
}
.score-hero { text-align: center; margin-bottom: var(--space-xl); }
.score-number { font-size: 4rem; font-weight: 800; line-height: 1; }
.score-label { font-size: 1.5rem; font-weight: 700; margin-top: var(--space-sm); }
.score-range { font-size: 0.9rem; color: var(--color-text-secondary); margin-top: var(--space-xs); }

.score-bar-wrapper { margin-bottom: var(--space-2xl); }
.score-bar-track {
  height: 12px;
  background: linear-gradient(to right, var(--color-success), #eab308, var(--color-warning), var(--color-danger));
  border-radius: 6px;
  position: relative;
}
.score-bar-marker {
  position: absolute;
  top: -4px;
  width: 20px;
  height: 20px;
  background: var(--color-text);
  border: 3px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.score-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.recommendations { margin-bottom: var(--space-xl); }
.recommendations h2 { text-align: left; font-size: 1.3rem; margin-bottom: var(--space-md); }
.recommendations ul { list-style: disc; padding-left: 1.5rem; }
.recommendations li { margin-bottom: var(--space-sm); line-height: 1.6; }

/* Disclaimer */
.disclaimer {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  font-size: 0.9rem;
  line-height: 1.6;
  color: #92400e;
}

/* How it works grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
}
.grid-3 h3 { font-size: 1.1rem; margin-bottom: var(--space-sm); }

/* Footer */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}
.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
}
.footer-crisis {
  background: rgba(255,255,255,0.05);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xl);
}
.footer-crisis a { color: #60a5fa; }
.footer-links { list-style: none; display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.footer-links a { color: #94a3b8; text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: white; }
.footer-copyright { font-size: 0.85rem; }

/* Severity colors */
:root {
  --severity-low: #059669;
  --severity-moderate: #d97706;
  --severity-high: #dc2626;
}

/* Action links */
.action-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  margin: var(--space-xl) 0;
}
.action-links .btn {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.action-links .btn:hover { background: #e6f7f7; border-color: var(--color-primary); }

/* No score */
.no-score-message { text-align: center; padding: var(--space-3xl) 0; }
.no-score-message h2 { margin-bottom: var(--space-md); }
.no-score-message p { margin-bottom: var(--space-xl); color: var(--color-text-secondary); }

/* Mobile */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 1.5rem; }
  .hero { padding: var(--space-2xl) 0; }
  .score-number { font-size: 3rem; }
  .action-links { flex-direction: column; align-items: center; }
}

/* Crisis bar */
.crisis-bar {
  background: #991b1b;
  color: white;
  padding: 0.75rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}
.crisis-bar a { color: #fca5a5; font-weight: 600; }
.crisis-bar-dismiss {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 1rem;
  opacity: 0.7;
}
