/* ==========================================================================
   YourMD Smart Intake — page-specific styling
   --------------------------------------------------------------------------
   Inherits design tokens from /interface/patient/ymp-design-system.css
   (teal scale, spacing, radii, motion), so the intake feels like the
   same design language the patient will land in after registration.

   Only selectors used by smart.php + smart-intake.js live here. Everything
   else comes from the shared token file.
   ========================================================================== */

/* --- adds a couple of tokens not in the shared file -------------------- */
:root {
  --ym-teal-400:  #3FB68E;
  --ym-red-50:    #FDECEC;
  --ym-red-600:   #D24848;
  --ym-red-800:   #991B1B;
}

/* --- shell ------------------------------------------------------------- */
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  color: var(--ym-text-primary);
  background: #F7FAF9;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.intake-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #FAFBFC 0%, #F0F7F5 100%);
  padding-bottom: 60px;
}

.intake-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 720px;
  margin: 0 auto;
  height: 52px;
}
.intake-brand {
  text-decoration: none;
  color: var(--ym-text-primary);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.intake-brand span {
  color: var(--ym-text-secondary);
  font-weight: 400;
  margin-left: 4px;
  font-size: 13px;
}
.intake-nav-right {
  font-size: 12px;
  color: var(--ym-text-secondary);
}

.intake-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 20px;
}

/* --- progress bar ------------------------------------------------------ */
.intake-progress { margin-bottom: 28px; }
.intake-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.intake-progress-label {
  font-size: 11px;
  color: var(--ym-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
}
.intake-progress-count {
  font-size: 11px;
  color: var(--ym-teal-600);
  font-weight: 500;
}
.intake-progress-bar {
  height: 4px;
  background: var(--ym-gray-100);
  border-radius: 2px;
  overflow: hidden;
}
.intake-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ym-teal-600), var(--ym-teal-400));
  border-radius: 2px;
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- question header --------------------------------------------------- */
.intake-step-label {
  font-size: 11px;
  color: var(--ym-teal-600);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.intake-question {
  font-size: 22px;
  font-weight: 500;
  color: var(--ym-text-primary);
  letter-spacing: -0.4px;
  line-height: 1.3;
  margin: 0 0 6px;
}
.intake-helper {
  font-size: 13px;
  color: var(--ym-text-secondary);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* --- card + options --------------------------------------------------- */
.intake-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 0.5px solid var(--ym-border-light);
}
.intake-options { display: flex; flex-direction: column; gap: 8px; }

.intake-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 0.5px solid var(--ym-border-default);
  background: white;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.intake-option:hover {
  border-color: var(--ym-teal-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(29, 158, 117, 0.08);
}
.intake-option.selected {
  border-color: var(--ym-teal-600);
  background: var(--ym-teal-50);
  border-width: 1.5px;
  padding: 13.5px 15.5px;
}

.intake-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ym-border-default);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms;
}
.intake-option.selected .intake-option-radio {
  border-color: var(--ym-teal-600);
  background: var(--ym-teal-600);
}
.intake-option.selected .intake-option-radio::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}
.intake-option.checkbox .intake-option-radio { border-radius: 4px; }
.intake-option.checkbox.selected .intake-option-radio::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid white;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
  margin-top: -2px;
  border-radius: 0;
  background: transparent;
}

/* Inline visual (e.g. Norwood scale diagram on the hair-loss pattern
   question). Rendered between the radio and the option content when
   the tree provides opt.icon. */
.intake-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--ym-bg-secondary);
  padding: 4px;
}
.intake-option-icon svg,
.intake-option-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
.intake-option.has-icon { padding: 10px 14px; }
.intake-option.has-icon.selected { padding: 9.5px 13.5px; }

.intake-option-content { flex: 1; }
.intake-option-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ym-text-primary);
  line-height: 1.3;
}
.intake-option-sub {
  display: block;
  font-size: 12px;
  color: var(--ym-text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}

.intake-option-flag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
  white-space: nowrap;
}
.intake-option-flag.review          { background: #FFF4E0; color: #92400E; }
.intake-option-flag.contraindication { background: var(--ym-red-50); color: var(--ym-red-800); }

/* --- branch-alert inline feedback ------------------------------------- */
.intake-branch-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: intake-fade-in 300ms ease;
}
.intake-branch-alert.info {
  background: var(--ym-teal-50);
  border: 0.5px solid var(--ym-teal-200);
  color: var(--ym-teal-700);
}
.intake-branch-alert.warning {
  background: #FFF4E0;
  border: 0.5px solid #FAC775;
  color: #92400E;
}
.intake-branch-alert.contraindication {
  background: var(--ym-red-50);
  border: 0.5px solid #F7C1C1;
  color: var(--ym-red-800);
}
.intake-branch-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 12px;
  font-weight: 500;
}
.intake-branch-alert.info .intake-branch-icon            { background: var(--ym-teal-600); }
.intake-branch-alert.warning .intake-branch-icon         { background: #D97706; }
.intake-branch-alert.contraindication .intake-branch-icon { background: var(--ym-red-600); }
.intake-branch-text { font-size: 12px; line-height: 1.5; }

@keyframes intake-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- form + text inputs ------------------------------------------------ */
.intake-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 0.5px solid var(--ym-border-default);
  border-radius: 10px;
  background: white;
  color: var(--ym-text-primary);
  outline: none;
  transition: all 150ms;
  box-sizing: border-box;
}
.intake-input:focus {
  border-color: var(--ym-teal-600);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}
.intake-textarea { min-height: 110px; resize: vertical; line-height: 1.55; }

.intake-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .intake-form-grid { grid-template-columns: 1fr; } }

.intake-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ym-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.intake-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .intake-identity-grid { grid-template-columns: 1fr; } }
.intake-identity-field { display: flex; flex-direction: column; }

/* --- BMI readout ------------------------------------------------------- */
.intake-bmi-readout { margin-top: 12px; }
.intake-bmi-card {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ym-text-primary);
  background: var(--ym-teal-50);
  border: 0.5px solid var(--ym-teal-200);
}
.intake-bmi-card.review {
  background: #FFF4E0;
  border-color: #FAC775;
  color: #92400E;
}

/* --- navigation actions ------------------------------------------------ */
.intake-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
.intake-back {
  font-size: 13px;
  color: var(--ym-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: inherit;
  padding: 8px 4px;
  transition: color 150ms;
}
.intake-back:hover { color: var(--ym-text-primary); }

.intake-next {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--ym-teal-600);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 150ms;
}
.intake-next:hover {
  background: var(--ym-teal-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 158, 117, 0.25);
}
.intake-next:active { transform: translateY(0); }
.intake-next:disabled {
  background: var(--ym-gray-200);
  color: var(--ym-gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- outcome screens --------------------------------------------------- */
.intake-outcome {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  border: 0.5px solid var(--ym-border-light);
}
.intake-outcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
  font-weight: 500;
  color: white;
}
.intake-outcome-eligible .intake-outcome-icon    { background: var(--ym-teal-600); }
.intake-outcome-review .intake-outcome-icon      { background: #2B6CB0; }
.intake-outcome-contra .intake-outcome-icon      { background: #D97706; }
.intake-outcome-refer .intake-outcome-icon       { background: var(--ym-text-secondary); }

.intake-outcome .intake-question { margin-top: 4px; }
.intake-outcome .intake-helper   { max-width: 460px; margin: 0 auto 12px; }

/* --- Cross-sell card (consult track → DTC upsell) ------------------- */
.intake-cross-sell {
  margin-top: 18px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #f5faf8 0%, #ffffff 60%);
  border: 0.5px solid var(--ym-teal-200);
  border-left: 3px solid var(--ym-teal-600);
  border-radius: 12px;
  animation: intake-fade-in 320ms ease;
}
.intake-cross-sell-eyebrow {
  font-size: 10px;
  color: var(--ym-teal-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.intake-cross-sell-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ym-text-primary);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.intake-cross-sell-sub {
  font-size: 12px;
  color: var(--ym-text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.intake-cross-sell-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  border: 0.5px solid var(--ym-teal-600);
  border-radius: var(--ym-radius-pill);
  background: transparent;
  color: var(--ym-teal-700);
  cursor: pointer;
  transition: background var(--ym-duration-fast);
}
.intake-cross-sell-btn:hover {
  background: var(--ym-teal-50);
}
