/* ============================================================
   PROGRESS BAR
============================================================ */
#progress-bar-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cream-dark);
  z-index: 100;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-dark), var(--sage), var(--sage-light));
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  border-radius: 0 2px 2px 0;
}

.progress-label {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 8px));
  right: max(14px, env(safe-area-inset-right, 14px));
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.5px;
  z-index: 101;
  pointer-events: none;
}

/* ============================================================
   STEP CARD
============================================================ */
.step-card {
  width: 100%;
  max-width: 640px;
  background: var(--cream-card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px 20px;
  display: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  word-break: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 480px) { .step-card { padding: 36px 32px; border-radius: 24px; } }
@media (min-width: 640px) { .step-card { padding: 44px 44px; } }

/* Compact card padding in landscape on phones */
@media (orientation: landscape) and (max-height: 520px) {
  .step-card { padding: 20px 20px; border-radius: 16px; }
}

.step-card.active { display: block; opacity: 1; transform: translateY(0); }
.step-card.slide-out { opacity: 0; transform: translateY(-20px); }

#step-0 { text-align: center; }
#step-10 { text-align: center; }

/* ============================================================
   WELCOME SCREEN
============================================================ */
.brand-name {
  font-size: clamp(26px, 6vw, 40px);
  font-weight: 300;
  font-style: italic;
  color: var(--text-dark);
  line-height: 1.15;
}

.brand-ornament {
  width: 48px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--sage), transparent);
  margin: 10px auto;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--sage-dark);
}

.welcome-heading {
  font-size: clamp(18px, 4.5vw, 26px);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.3;
  margin: 24px 0 12px;
}

.welcome-body {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-inset);
  margin: 18px 0 26px;
}

.welcome-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
}

.welcome-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
  margin-top: 5px;
}

.btn-welcome {
  display: inline-block;
  background: linear-gradient(135deg, var(--sage-dark), var(--sage));
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 40px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 8px 8px 20px rgba(122,158,148,.4), -3px -3px 10px rgba(255,255,255,.5);
  letter-spacing: 0.3px;
}
.btn-welcome:hover {
  transform: translateY(-3px);
  box-shadow: 10px 14px 28px rgba(122,158,148,.5), -3px -3px 10px rgba(255,255,255,.5);
}

/* ============================================================
   TRIAGE CARDS (Step 2) — horizontal list layout
   Mobile:  1 column, full-width rows
   Desktop: 2 columns, full-width rows
   Icon bubble left · title + sub stacked right · no text cramping
============================================================ */
.triage-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* 2-column grid from 560 px up */
@media (min-width: 560px) {
  .triage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

.triage-card {
  position: relative;
  cursor: pointer;
  display: flex;           /* lets .triage-card-inner fill the grid cell */
  flex-direction: column;
}

.triage-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ── Row: horizontal flex ── */
.triage-card-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  width: 100%;
  flex: 1;                 /* equal-height rows within each grid row */
  background: var(--cream-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}

.triage-card-inner:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Selected: left accent + tinted background */
.triage-card input:checked + .triage-card-inner {
  border-color: var(--caramel);
  background: var(--caramel-pale);
  box-shadow: var(--shadow-md);
}

/* ── Icon bubble: inset square, centered emoji ── */
.triage-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--cream);
  box-shadow: var(--shadow-inset);
  flex-shrink: 0;
  line-height: 1;
}

/* ── Text block: title + sub stacked, takes remaining space ── */
.triage-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

/* ── Title: dominant, strong ── */
.triage-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  letter-spacing: -0.1px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Sub: clearly secondary, never competes with title ── */
.triage-sub {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ============================================================
   SPECIFIC QUESTIONS (Step 3)
============================================================ */
.triage-section { display: none; }
.triage-section.active { display: block; }

/* ============================================================
   SYMPTOM GRID (Step 4)
============================================================ */
.symptoms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 380px) { .symptoms-grid { grid-template-columns: 1fr; } }

.symptom-card {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 12px 10px 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.symptom-card:hover { box-shadow: var(--shadow-md); }

.symptom-card.selected {
  background: var(--sage-pale);
  border-color: var(--sage);
  box-shadow: var(--shadow-md);
}

.symptom-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.symptom-check svg { width: 10px; height: 10px; stroke: transparent; }
.symptom-card.selected .symptom-check { background: var(--sage-dark); }
.symptom-card.selected .symptom-check svg { stroke: white; }

.symptom-icon { font-size: 20px; display: block; margin-bottom: 4px; }

.symptom-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.35;
  display: block;
  margin-bottom: 8px;
  padding-right: 24px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.symptom-intensity {
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.symptom-card.selected .symptom-intensity {
  opacity: 1;
  pointer-events: auto;
}

.intensity-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-pill);
  padding: 4px 2px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--cream-dark);
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
}

.intensity-btn:hover { background: var(--sage-light); color: var(--sage-dark); }

.intensity-btn.leve.active    { background: var(--sage-pale);    color: var(--sage-dark);    }
.intensity-btn.moderado.active { background: var(--caramel-pale); color: var(--caramel-dark); }
.intensity-btn.intenso.active  { background: var(--rose-pale);   color: var(--rose-dark);    }

/* ============================================================
   CONDITIONAL FIELDS
============================================================ */
.conditional-field {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}
.conditional-field.visible { max-height: 320px; opacity: 1; margin-top: 12px; }
.conditional-field.visible.large { max-height: 700px; }

/* ============================================================
   IMPORTANCE SLIDER
============================================================ */
.importance-wrap { text-align: center; padding: 10px 0; }
.importance-heart { font-size: 40px; display: block; margin-bottom: 4px; }
.importance-num {
  font-size: 48px;
  font-weight: 300;
  color: var(--rose-dark);
  line-height: 1;
  margin-bottom: 4px;
}
.importance-label { font-size: 12px; color: var(--text-light); margin-bottom: 12px; }
input[type="range"].importance-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--rose-dark), var(--rose));
}
input[type="range"].importance-slider::-moz-range-thumb {
  background: linear-gradient(135deg, var(--rose-dark), var(--rose));
}

/* ============================================================
   COMMITMENT CARD
============================================================ */
.commitment-card {
  background: linear-gradient(135deg, var(--sage-pale), var(--cream-card));
  border-radius: var(--radius-md);
  border: 1px solid var(--sage-light);
  padding: 16px;
  margin-bottom: 12px;
}

/* ============================================================
   PRIVACY NOTE
============================================================ */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--sage-pale);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--sage);
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.55;
}
.privacy-note-icon { font-size: 14px; flex-shrink: 0; padding-top: 1px; }

/* ============================================================
   SEND ERROR
============================================================ */
.send-error {
  display: none;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--rose-pale);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--rose-dark);
  font-size: 13px;
  color: var(--rose-dark);
  line-height: 1.5;
}
.send-error.visible { display: block; }

/* ============================================================
   LOADING STATE
============================================================ */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading::after {
  content: '';
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* ============================================================
   CONFIRMATION SCREEN
============================================================ */
.success-anim {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--sage-dark), var(--sage));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 8px 8px 24px rgba(122,158,148,.4), -4px -4px 14px rgba(255,255,255,.6);
  animation: successPulse 2s ease infinite;
}

@keyframes successPulse {
  0%, 100% { box-shadow: 8px 8px 24px rgba(122,158,148,.4), -4px -4px 14px rgba(255,255,255,.6); }
  50%       { box-shadow: 12px 12px 32px rgba(122,158,148,.55), -4px -4px 14px rgba(255,255,255,.7); }
}

.success-check {
  width: 32px; height: 32px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.8s ease 0.2s forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.confirm-title {
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 300;
  font-style: italic;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 16px;
}

.confirm-msg {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 460px;
  margin: 0 auto 20px;
}

.confirm-closing {
  font-size: 15px;
  font-style: italic;
  color: var(--caramel);
}

/* ============================================================
   RADIO PILLS — VERTICAL (compromisso)
============================================================ */
.radio-pill-group.vertical {
  flex-direction: column;
  gap: 6px;
}
.radio-pill-group.vertical .radio-pill label {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
