/* ============================================================================
   Kanjin Health - Prospect Assessment page styles
   ----------------------------------------------------------------------------
   Layered on top of styles.css. Reuses CSS variables (--color-primary,
   --space-*, --font-size-*) for visual consistency with the rest of the site.
   ========================================================================== */

.assessment-body { background: #f7faf8; }

/* The top banner is position:fixed at var(--header-height) tall. Push all
   the assessment content below it so nothing (progress bar, page counter,
   "Saved" indicator) ever hides under the banner. */
.assessment-main {
  padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-12);
  min-height: 70vh;
}

@media (max-width: 640px) {
  .assessment-main { padding: calc(var(--header-height) + var(--space-6)) 0 var(--space-8); }
}

/* ---- Cards ---------------------------------------------------------------- */
.assessment-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  max-width: 760px;
  margin: 0 auto var(--space-4);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
@media (max-width: 640px) {
  .assessment-card { padding: 20px; border-radius: 12px; }
}

.assessment-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary, #3e7c59);
  margin: 0 0 12px;
}

.assessment-lede {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  margin: 0 0 16px;
}

/* ---- Gate (email + OTP) --------------------------------------------------- */
.gate-blurb { color: #4b5563; line-height: 1.55; margin: 0 0 16px; font-size: 15px; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin: 12px 0 6px;
}
.field-label .required { color: #b91c1c; margin-left: 4px; }

.text-input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.text-input:focus {
  outline: none;
  border-color: var(--color-primary, #3e7c59);
  box-shadow: 0 0 0 3px rgba(62, 124, 89, 0.15);
}
.text-input[readonly] { background: #f3f4f6; color: #6b7280; }

.textarea-input { min-height: 96px; resize: vertical; }

.code-input {
  font-size: 24px;
  letter-spacing: 12px;
  text-align: center;
  font-family: 'Inter', monospace;
  font-weight: 600;
}

.gate-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.link-btn {
  background: none;
  border: none;
  padding: 6px 0;
  color: var(--color-primary, #3e7c59);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: #2c5a40; }

.gate-status { font-size: 14px; line-height: 1.5; margin-top: 12px; }
.gate-status-err  { color: #b91c1c; }
.gate-status-info { color: #4b5563; }

/* ---- Signed-in banner (top of form pages) -------------------------------- */
.signed-in-banner {
  max-width: 760px;
  margin: 0 auto 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #4b5563;
  padding: 6px 12px;
  background: #f0f7f3;
  border: 1px solid #d6e9dc;
  border-radius: 6px;
}
.signed-in-banner strong { color: #1f2937; word-break: break-all; }
.signed-in-banner .link-btn { font-size: 13px; }

/* ---- Progress bar --------------------------------------------------------- */
.form-progress {
  max-width: 760px;
  margin: 0 auto 16px;
  /* Keep the progress bar visible just below the site banner while the
     client scrolls through a long form page. */
  position: sticky;
  top: calc(var(--header-height) + 8px);
  z-index: 10;
  background: #f7faf8;
  padding: 8px 0;
}
.form-progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
}
.progress-step {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.progress-step:hover:not([disabled]) { background: #d4dde6; color: #1f2937; }
.progress-step.reached {
  background: #d6e9dc;
  color: #1f5236;
}
.progress-step.reached:hover { background: #b8d8c4; }
.progress-step.current {
  background: #3e7c59;
  color: #ffffff;
  border-color: #2c5a40;
}
.progress-step.current:hover { background: #2c5a40; }
.progress-step.locked {
  cursor: not-allowed;
  opacity: 0.6;
}
.progress-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 18px;
}
.progress-step.current .progress-step-num {
  background: #ffffff;
  color: #2c5a40;
}
.progress-step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 700px) {
  .progress-step-label { display: none; }
  .progress-step { flex: 0 0 32px; padding: 4px; }
}
.form-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
}
.form-progress-save { font-style: italic; }
.form-progress-save.saved { color: #059669; font-style: normal; }

/* ---- Recommended-uploads note on the final page -------------------------- */
.recommended-uploads {
  background: #fff8e6;
  border: 1px solid #f3d77a;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.55;
}
.recommended-uploads-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #92651a;
}
.recommended-uploads-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.recommended-uploads-list .rec-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}
.recommended-uploads-list .rec-bullet {
  flex: 0 0 18px;
  color: #9ca3af;
  font-weight: 700;
  text-align: center;
}
.recommended-uploads-list .rec-check {
  flex: 0 0 18px;
  color: #047857;
  font-weight: 700;
  text-align: center;
}
.recommended-uploads-list .rec-item.done > span:last-child {
  color: #047857;
  font-weight: 600;
}

/* All recommended documents covered: switch the whole box to green. */
.recommended-uploads.complete {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}
.recommended-uploads.complete .recommended-uploads-title { color: #047857; }
.recommended-uploads-complete {
  margin: 10px 0 0;
  font-weight: 600;
  color: #047857;
}

/* Inline informational note inside a page (e.g. wellness-track callout) */
.field-note {
  background: #eef4ff;
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 16px;
  font-size: 14px;
  color: #1e3a8a;
  line-height: 1.5;
}

/* Section header inside a page: visually breaks up groups of fields. */
.field-section-header {
  margin: 28px 0 12px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.field-section-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #3e7c59;
}
.field-section-header p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* Highlighted field variant: stands out from the surrounding form fields,
   used for optional add-on questions like the private-label opt-in. */
.field.field-highlight {
  background: #fff4d6;
  border: 1px solid #f3d77a;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.field.field-highlight .field-help {
  color: #6b4f10;
  background: transparent;
}

/* ---- Form fields ---------------------------------------------------------- */
.form-card { padding-bottom: 24px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary, #3e7c59);
  margin: 0 0 8px;
}
.page-intro {
  color: #4b5563;
  line-height: 1.55;
  margin: 0 0 20px;
  font-size: 14px;
  background: #f7faf8;
  border-left: 3px solid #3e7c59;
  padding: 10px 12px;
  border-radius: 4px;
}
.page-privacy {
  color: #6b7280;
  font-size: 13px;
  font-style: italic;
}

.field { margin-bottom: 18px; }
.field-help { font-size: 13px; color: #6b7280; margin: 4px 0 6px; line-height: 1.5; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.radio-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  background: #ffffff;
  transition: background .15s, border-color .15s;
}
/* Zebra striping: every other option gets a neutral grey tint so a long
   list (e.g. the "Other Kanjin services" 10-item check-all) is easier to
   scan. Kept neutral grey - not green / not yellow - so it never collides
   with the green hover or green "checked" states below. */
.radio-group > .radio-opt:nth-child(even) { background: #f3f4f6; }
.radio-opt:hover { background: #eef4f0; border-color: #cfdfd5; }
.radio-group > .radio-opt:nth-child(even):hover { background: #e9efea; }
.radio-opt input { margin-top: 3px; flex-shrink: 0; }
.radio-opt span { line-height: 1.5; color: #1f2937; font-size: 14px; }
.radio-opt input:checked + span { color: var(--color-primary, #3e7c59); font-weight: 500; }
.radio-opt:has(input:checked) { background: #e3efe6; border-color: #a8c8b4; }
.radio-group > .radio-opt:nth-child(even):has(input:checked) { background: #d9e9dd; }

select.text-input { cursor: pointer; }

/* file uploads */
input[type="file"] {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}
.upload-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
}
.upload-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.upload-item-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-label-select { font-size: 13px; padding: 6px 8px; }
.upload-label-other { font-size: 13px; padding: 6px 8px; }
.upload-name { flex: 1; color: #1f2937; word-break: break-all; }
.upload-size { color: #6b7280; font-size: 13px; }
.upload-remove { font-size: 13px; }

/* ---- Nav buttons ---------------------------------------------------------- */
.form-nav {
  max-width: 760px;
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}
.form-nav .btn { flex: 0 0 auto; }
.form-nav .btn-secondary {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.form-nav .btn-secondary:hover { background: #f9fafb; }

@media (max-width: 640px) {
  .form-nav { flex-direction: column; }
  .form-nav .btn { width: 100%; }
}

/* ---- Thanks / Exit -------------------------------------------------------- */
.thanks-mark {
  font-size: 48px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #d5e4db;
  color: #3e7c59;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-weight: 700;
}
.assessment-thanks .assessment-card,
.assessment-exit .assessment-card {
  text-align: center;
}

/* ---- Missing-fields modal ------------------------------------------------- */
.missing-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.missing-modal[hidden] { display: none !important; }

/* The user-agent [hidden] rule is overridden by .btn's explicit display,
   so we need an explicit, higher-specificity rule for form-nav buttons. */
.form-nav .btn[hidden] { display: none !important; }

.missing-modal-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.missing-title {
  font-size: 18px;
  color: #b91c1c;
  margin: 0 0 12px;
}
.missing-list {
  list-style: disc;
  padding-left: 20px;
  margin: 8px 0 16px;
}
.missing-list li {
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1.45;
}
.missing-list li:hover {
  background: #f9fafb;
}
.missing-actions {
  display: flex;
  justify-content: flex-end;
}

/* ---- Footer --------------------------------------------------------------- */
.assessment-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  color: #6b7280;
  text-align: center;
  padding: 20px 0;
  font-size: 13px;
}
.assessment-footer p { margin: 0; }

/* ---- Assessment list (pick which of my assessments to open) -------------- */
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.choice-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border, #d8dee4); border-radius: 12px;
  background: #fff; transition: border-color .15s, box-shadow .15s, transform .05s;
}
.choice-item:hover { border-color: var(--jade, #1f7a5a); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.choice-item:active { transform: translateY(1px); }
.choice-item-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.choice-item-name { font-weight: 600; color: #1f2a37; }
.choice-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-item-when { font-size: 12px; color: #6b7280; }
.choice-item-cta { color: var(--jade, #1f7a5a); font-weight: 600; white-space: nowrap; font-size: 14px; }
.choice-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; }
.choice-badge-draft { background: #fef3c7; color: #b45309; }
.choice-badge-sub { background: #dcfce7; color: #15803d; }
