/* ============================================================
   Poland Foundation — Symptom Checker
   symptom-checker.css
   Aesthetic: Warm editorial / medical-trustworthy
   Fonts: Lora (serif display) + DM Sans (body)
   Palette: Deep sage + rust + warm cream
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --sage-deep:    #2D4A3E;
  --sage-mid:     #3D6B5A;
  --sage-light:   #7BA697;
  --sage-pale:    #D4E6DF;
  --sage-mist:    #EEF5F2;

  --rust:         #B84C2A;
  --rust-light:   #D96840;
  --rust-pale:    #F5E0D8;

  --cream:        #FAF7F2;
  --warm-white:   #FFFFFF;
  --text-dark:    #1A2820;
  --text-mid:     #3A4A42;
  --text-soft:    #6B7D74;
  --text-light:   #9BADA5;

  --border:       #D4E0DB;
  --shadow-sm:    0 2px 8px rgba(45, 74, 62, 0.08);
  --shadow-md:    0 6px 24px rgba(45, 74, 62, 0.12);
  --shadow-lg:    0 16px 48px rgba(45, 74, 62, 0.16);

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-xl:    32px;

  --transition:   all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Page Layout ───────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(123, 166, 151, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(184, 76, 42, 0.06) 0%, transparent 60%),
    var(--cream);
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--sage-deep);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--sage-deep);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--sage-deep);
  line-height: 1.2;
}

.logo-text span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-disclaimer {
  font-size: 11px;
  color: var(--text-light);
  max-width: 280px;
  text-align: right;
  line-height: 1.4;
}

/* ── Main Container ────────────────────────────────────── */
.checker-container {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Intro Screen ──────────────────────────────────────── */
#intro-screen {
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-pale);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.intro-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--sage-mid);
  border-radius: 50%;
}

.intro-title {
  font-family: 'Lora', serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  color: var(--sage-deep);
  line-height: 1.2;
  margin-bottom: 16px;
}

.intro-title em {
  font-style: italic;
  color: var(--rust);
}

.intro-subtitle {
  font-size: 16px;
  color: var(--text-mid);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.intro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
  text-align: left;
}

.intro-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.intro-card:hover {
  border-color: var(--sage-light);
  box-shadow: var(--shadow-sm);
}

.intro-card-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.intro-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--sage-deep);
  margin-bottom: 4px;
}

.intro-card p {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.disclaimer-box {
  background: var(--rust-pale);
  border: 1px solid rgba(184, 76, 42, 0.2);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 36px;
}

.disclaimer-box p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}

.disclaimer-box strong {
  color: var(--rust);
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--sage-deep);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 16px 36px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 16px rgba(45, 74, 62, 0.3);
}

.btn-start:hover {
  background: var(--sage-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 74, 62, 0.35);
}

.btn-start svg {
  transition: transform 0.2s ease;
}

.btn-start:hover svg {
  transform: translateX(4px);
}

/* ── Question Screen ───────────────────────────────────── */
#question-screen {
  display: none;
  animation: fadeUp 0.5s ease both;
}

/* ── Progress Bar ──────────────────────────────────────── */
.progress-wrapper {
  margin-bottom: 36px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-count {
  font-size: 12px;
  color: var(--text-light);
}

.progress-track {
  height: 4px;
  background: var(--sage-pale);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-mid), var(--rust-light));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── Question Card ─────────────────────────────────────── */
.question-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow-md);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage-deep), var(--rust-light));
}

.question-phase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage-mist);
  color: var(--sage-mid);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.question-text {
  font-family: 'Lora', serif;
  font-size: clamp(19px, 3vw, 24px);
  font-weight: 600;
  color: var(--sage-deep);
  line-height: 1.35;
  margin-bottom: 10px;
}

.question-hint {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Answer Options ────────────────────────────────────── */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}

.option-btn:hover {
  background: var(--sage-mist);
  border-color: var(--sage-light);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.option-btn.selected {
  background: var(--sage-mist);
  border-color: var(--sage-mid);
  box-shadow: 0 0 0 3px rgba(61, 107, 90, 0.12);
}

.option-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}

.option-btn:hover .option-indicator,
.option-btn.selected .option-indicator {
  border-color: var(--sage-mid);
  background: var(--sage-mid);
}

.option-btn.selected .option-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.option-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
  line-height: 1.4;
}

.option-sublabel {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Navigation ────────────────────────────────────────── */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-back:hover {
  border-color: var(--sage-light);
  color: var(--sage-mid);
  background: var(--sage-mist);
}

.btn-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-deep);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: var(--transition-bounce);
  opacity: 0.4;
  pointer-events: none;
}

.btn-next.active {
  opacity: 1;
  pointer-events: all;
}

.btn-next.active:hover {
  background: var(--sage-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 74, 62, 0.3);
}

/* ── Transition Animations ─────────────────────────────── */
.question-card.slide-out-left {
  animation: slideOutLeft 0.25s ease forwards;
}

.question-card.slide-in-right {
  animation: slideInRight 0.3s ease forwards;
}

.question-card.slide-out-right {
  animation: slideOutRight 0.25s ease forwards;
}

.question-card.slide-in-left {
  animation: slideInLeft 0.3s ease forwards;
}

/* ── Results Screen ────────────────────────────────────── */
#result-screen {
  display: none;
  animation: fadeUp 0.6s ease both;
}

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

.result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.result-eyebrow.confidence-high {
  background: var(--sage-pale);
  color: var(--sage-deep);
}

.result-eyebrow.confidence-medium {
  background: #FFF3CD;
  color: #856404;
}

.result-eyebrow.confidence-low {
  background: var(--rust-pale);
  color: var(--rust);
}

.result-eyebrow.confidence-other {
  background: #E3E8F0;
  color: #3D4F7C;
}

.result-title {
  font-family: 'Lora', serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--sage-deep);
  line-height: 1.2;
  margin-bottom: 12px;
}

.result-subtitle {
  font-size: 16px;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Result Card ───────────────────────────────────────── */
.result-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.result-card-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.result-card-header.header-sage {
  background: linear-gradient(135deg, var(--sage-mist) 0%, white 100%);
}

.result-card-header.header-warm {
  background: linear-gradient(135deg, #FFF9E6 0%, white 100%);
}

.result-card-header.header-other {
  background: linear-gradient(135deg, #F0F3F9 0%, white 100%);
}

.result-condition-name {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--sage-deep);
  margin-bottom: 8px;
}

.result-description {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
}

.confidence-badge {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.confidence-badge.high {
  background: var(--sage-pale);
  color: var(--sage-deep);
}

.confidence-badge.medium {
  background: #FFF3CD;
  color: #856404;
}

.confidence-badge.low {
  background: var(--rust-pale);
  color: var(--rust);
}

.confidence-badge.info {
  background: #E3E8F0;
  color: #3D4F7C;
}

.confidence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Result Body ───────────────────────────────────────── */
.result-card-body {
  padding: 32px 40px;
}

.result-section {
  margin-bottom: 28px;
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.result-next-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.next-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.next-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sage-deep);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.next-step-text {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

.result-resources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.resource-link:hover {
  background: var(--sage-mist);
  border-color: var(--sage-light);
  color: var(--sage-deep);
}

.resource-link-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── CTA Buttons in Results ────────────────────────────── */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--sage-deep);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-bounce);
  text-align: center;
}

.btn-primary-action:hover {
  background: var(--sage-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45, 74, 62, 0.3);
}

.btn-secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: var(--sage-deep);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 100px;
  border: 1.5px solid var(--sage-light);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}

.btn-secondary-action:hover {
  background: var(--sage-mist);
  border-color: var(--sage-mid);
}

.btn-rust-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--rust);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-bounce);
  text-align: center;
}

.btn-rust-action:hover {
  background: var(--rust-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(184, 76, 42, 0.3);
}

/* ── Emotional Support Block ───────────────────────────── */
.emotional-support-block {
  background: var(--sage-mist);
  border: 1px solid var(--sage-pale);
  border-left: 4px solid var(--sage-mid);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 16px;
}

.emotional-support-block p {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--sage-deep);
  line-height: 1.7;
}

/* ── Restart / Print ───────────────────────────────────── */
.result-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

.btn-restart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-restart:hover {
  border-color: var(--sage-light);
  color: var(--sage-mid);
  background: var(--sage-mist);
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-print:hover {
  border-color: var(--rust);
  color: var(--rust);
  background: var(--rust-pale);
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

.site-footer a {
  color: var(--sage-mid);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ── Utility ───────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Loading Indicator ─────────────────────────────────── */
.loading-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 40px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage-light);
  animation: pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header {
    padding: 16px 20px;
  }

  .header-disclaimer {
    display: none;
  }

  .checker-container {
    padding: 28px 16px 60px;
  }

  .question-card {
    padding: 28px 24px;
  }

  .result-card-header,
  .result-card-body {
    padding: 24px;
  }

  .confidence-badge {
    position: static;
    display: inline-flex;
    margin-bottom: 12px;
  }

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

  .btn-back, .btn-next {
    width: 100%;
    justify-content: center;
  }
}

/* ── Print Styles ──────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .result-footer-actions,
  .btn-start,
  .btn-next,
  .btn-back,
  .btn-restart,
  .btn-print,
  #intro-screen,
  #question-screen {
    display: none !important;
  }

  #result-screen {
    display: block !important;
  }

  body {
    background: white;
  }

  .result-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .page-wrapper {
    background: white;
  }
}
