/* ============================================================================
   Rainbow Medicine — Intake Form
   Custom layer on top of Bootstrap 5.3.8.
   Provides the male / female / lgbtq palette switching from the prototype.
   ============================================================================ */

:root {
  /* Default palette = teal (male / unisex) */
  --rm-primary:    #0F5C6E;
  --rm-mid:        #1A8C9F;
  --rm-light:      #EAF6F8;
  --rm-accent:     #D4853E;
  --rm-accent-lt:  #FEF3E8;
  --rm-charcoal:   #1C2E35;
  --rm-shadow:     0 2px 12px rgba(0,0,0,0.09);
}

body.palette-female {
  --rm-primary:   #8B2550;
  --rm-mid:       #B5426E;
  --rm-light:     #FAEEF1;
  --rm-accent:    #C47B2A;
  --rm-accent-lt: #FDF3E7;
}

body.palette-lgbtq {
  --rm-primary:   #4A3580;
  --rm-mid:       #7B57CC;
  --rm-light:     #EEE8FA;
  --rm-accent:    #C47B2A;
  --rm-accent-lt: #FDF3E7;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
body { background: #F0F4F6; color: var(--rm-charcoal); font-size: 15px; }

.site-header {
  background: #fff;
  border-bottom: 5px solid var(--rm-primary);
  padding: 0 1.5rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--rm-shadow);
}
.site-header .logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--rm-primary);
  letter-spacing: -0.5px;
}
.site-header .logo span { color: var(--rm-accent); }

/* ── Progress bar override ────────────────────────────────────────────── */
.progress-wrap {
  background: var(--rm-light);
  border-bottom: 1px solid #d0d8dc;
  padding: 0.625rem 1.5rem;
}
.progress-wrap .progress {
  height: 8px;
  background: #d0d8dc;
}
.progress-wrap .progress-bar {
  background: linear-gradient(90deg, var(--rm-primary), var(--rm-mid)) !important;
  transition: width 0.4s ease;
}
.progress-wrap .progress-label,
.progress-wrap .progress-pct {
  color: var(--rm-primary);
  font-weight: 600;
  font-size: 13px;
}

body.palette-lgbtq .progress-bar {
  background: linear-gradient(90deg, #E63946, #F4A261, #2A9D8F, #457B9D, #6D28D9) !important;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--rm-shadow);
  padding: 1rem 0;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: #9BA8B0;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid #D0D8DC;
}
.step-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--rm-charcoal);
  border-left: 3px solid transparent;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.step-link:hover { background: #F5F6F7; }
.step-link.active {
  background: var(--rm-light);
  border-left-color: var(--rm-primary);
  color: var(--rm-primary);
  font-weight: 600;
}
.step-link.completed { color: #3D7A55; }
.step-link.completed .step-num { background: #3D7A55; color: #fff; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #D0D8DC; color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Step cards ───────────────────────────────────────────────────────── */
.step-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--rm-shadow);
  overflow: hidden;
}
.step-header {
  background: linear-gradient(135deg, #fff 60%, var(--rm-light));
  border-bottom: 1px solid var(--rm-light);
  padding: 1.25rem 1.5rem;
}
.step-eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--rm-mid);
  font-size: 11px;
  font-weight: 700;
}
.step-title {
  color: var(--rm-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.step-body { padding: 1.5rem; }

.welcome-intro {
  background: var(--rm-light);
  border-left: 4px solid var(--rm-primary);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
}
.welcome-intro h2 { color: var(--rm-primary); font-size: 1.25rem; }

/* ── Pill-style radio / check buttons ─────────────────────────────────── */
.pill-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid #D0D8DC;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.pill:hover { border-color: var(--rm-mid); background: var(--rm-light); }
.pill input { margin: 0; }
.pill.selected,
.pill input:checked + span,
.form-check-input:checked + .pill,
.btn-check:checked + .pill {
  border-color: var(--rm-primary);
  background: var(--rm-light);
  color: var(--rm-primary);
  font-weight: 600;
}
/* Hide the actual input visually but keep accessible */
.pill input[type="radio"],
.pill input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}

/* ── Form controls ────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--rm-mid);
  box-shadow: 0 0 0 3px rgba(26,140,159,0.12);
}
.btn-rm-primary {
  background: var(--rm-primary);
  border-color: var(--rm-primary);
  color: #fff;
}
.btn-rm-primary:hover { opacity: 0.88; color: #fff; }

/* ── Step navigation ─────────────────────────────────────────────────── */
.step-nav {
  border-top: 1px solid #E5E9EB;
  padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
  background: #fafbfc;
}

/* ── File upload area ────────────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed #D0D8DC;
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-upload-area:hover {
  border-color: var(--rm-mid);
  background: var(--rm-light);
}
.file-list .file-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--rm-light);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  margin-top: 0.5rem;
  font-size: 13px;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.rm-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--rm-primary);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 2000;
  font-size: 14px;
  max-width: 320px;
}
.rm-toast.show { opacity: 1; transform: translateY(0); }
.rm-toast.error { background: #C0392B; }

/* ── Step visibility ──────────────────────────────────────────────────── */
.step-pane { display: none; }
.step-pane.active { display: block; }

.step-link.gender-only { display: none; }
.step-link.gender-only.show { display: flex; }

/* Validation hint */
.field-required > label::after {
  content: ' *';
  color: #C0392B;
  font-weight: 700;
}

/* Mobile sidebar collapse */
@media (max-width: 991px) {
  .sidebar { position: static; max-height: none; }
}
