/* ================= Women's Hormones Intake — page-specific styles ================= */
/* Builds on tokens & components already defined in style.css (colors, .field, .btn, .wrap, .section, .supply-box, etc.) */

/* Author classes on this page (.field, .btn, .checkbox-item, etc.) set their own
   `display` value with equal specificity to the UA [hidden] rule, which can win
   the cascade and keep a "hidden" element visible. Force it everywhere on this page. */
[hidden] { display: none !important; }

.wrap--narrow { max-width: var(--content-narrow); }

/* ---------- intro ---------- */
.intake-intro { text-align: center; }
.intake-intro .eyebrow { justify-content: center; }
.intake-intro__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 700;
  color: var(--color-heading);
  margin-block: var(--space-4) var(--space-4);
  max-width: 26ch;
  margin-inline: auto;
}
.intake-intro__sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}
.intake-intro__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.intake-intro__trust span { display: inline-flex; align-items: center; gap: var(--space-2); }
.intake-intro__trust svg { flex-shrink: 0; color: var(--color-secondary); }

/* ---------- intake card ---------- */
.intake-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  box-shadow: var(--shadow-md);
}

/* progress bar */
.intake-progress { margin-bottom: var(--space-8); }
.intake-progress__bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.intake-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 320ms cubic-bezier(0.16,1,0.3,1);
}
.intake-progress__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* step content */
.intake-step[hidden] { display: none; }
.intake-step__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-heading);
  margin-block: 0 var(--space-2);
  padding: 0;
  border: none;
}
.intake-step__sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
fieldset.intake-step { border: none; margin: 0; }

.intake-notice {
  /* Informational, not a validation problem — the patient can still
     continue — so this uses the neutral secondary/teal accent rather
     than the warning color, which reads as "something's wrong". */
  font-size: var(--text-xs);
  color: var(--color-secondary);
  background: var(--color-secondary-highlight);
  border: 1px solid color-mix(in oklab, var(--color-secondary) 30%, var(--color-border));
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
}
.intake-notice a { color: var(--color-secondary); text-decoration: underline; }

.intake-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: calc(-1 * var(--space-3));
  margin-bottom: var(--space-4);
}

/* ---------- field layout helpers ---------- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) {
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
}

.field-group__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: var(--space-3);
}

/* select / textarea / date — extend .field's input styling */
.field select,
.field textarea,
.field input[type="date"],
.field input[type="number"] {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237A7974' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}
.field textarea { resize: vertical; min-height: 64px; font-family: var(--font-body); }
.field select:focus,
.field textarea:focus,
.field input[type="date"]:focus,
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}
.field--other { margin-top: calc(-1 * var(--space-2)); margin-bottom: var(--space-6); }

/* ---------- BMI display ---------- */
.bmi-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-secondary-highlight);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  margin-block: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.bmi-display strong { font-size: var(--text-lg); color: var(--color-secondary); font-family: var(--font-display); }

/* ---------- radio pills ---------- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.radio-group--inline { flex-direction: row; flex-wrap: wrap; }
.radio-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.radio-group--inline .radio-pill { flex: 1 1 120px; justify-content: center; }
.radio-pill:hover { border-color: var(--color-primary); }
.radio-pill input { width: 16px; height: 16px; accent-color: var(--color-primary); flex-shrink: 0; }
.radio-pill:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
}

/* ---------- checkbox grid ---------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.checkbox-grid--compact { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) {
  .checkbox-grid, .checkbox-grid--compact { grid-template-columns: 1fr; }
}
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.checkbox-item:hover { border-color: var(--color-primary); }
.checkbox-item input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--color-primary); flex-shrink: 0; }
.checkbox-item:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.checkbox-item--none {
  border-style: dashed;
  color: var(--color-text-muted);
}

/* ---------- nav buttons ---------- */
.intake-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.intake-nav[hidden],
.intake-nav .btn[hidden] { display: none; }
.intake-nav .btn { min-width: 120px; }

/* success step */
.intake-step--success { text-align: center; }
.intake-step--success[hidden] { display: none; }

/* ---------- validation states ---------- */
.field select.touched:invalid,
.field input.touched:invalid,
.field textarea.touched:invalid {
  border-color: var(--color-error);
  border-width: 2px;
  background: color-mix(in oklab, var(--color-error) 8%, var(--color-surface));
}
.field.touched-invalid select,
.field.touched-invalid input {
  border-color: var(--color-error);
  border-width: 2px;
}
.radio-pill.touched-invalid { border-color: var(--color-error); }
