/* =====================================================
   CAST Clinical — App Styles (index.html)
   ===================================================== */

/* ── THEME TOKENS ─────────────────────────────────── */
:root {
  --sage:       #5B8C7A;
  --sage-light: #7DB5A0;
  --sage-pale:  #EAF3EF;
  --teal:       #2A9CC8;
  --teal-light: #C0E8F6;
  --teal2:      #0ECFCF;
  --sand:       #F5F0EB;
  --white:      #FFFFFF;
  --navy:       #1C2B3A;
  --mid:        #4A5D6E;
  --muted:      #8A9BAB;
  --border:     #DDE5EC;
  --red-soft:   #E07575;
  --gold:       #C9A96E;
  --radius-lg:  16px;
  --radius-md:  10px;
  --radius-sm:  6px;
  --shadow-sm:  0 2px 8px rgba(28,43,58,.07);
  --shadow-md:  0 6px 24px rgba(28,43,58,.10);
  --shadow-lg:  0 16px 48px rgba(28,43,58,.13);
  --transition: .28s cubic-bezier(.4,0,.2,1);
  --heading-grad: linear-gradient(120deg, #1C2B3A 0%, #2A9CC8 100%);
  --orb1: rgba(42,156,200,.09);
  --orb2: rgba(91,189,160,.07);
  --orb3: rgba(14,207,207,.05);
  --grid-ln: transparent;
}

/* ── DARK MODE ─────────────────────────────────────── */
body.dark {
  --white:      #111E2E;
  --sand:       #080F1A;
  --navy:       #E2EDF8;
  --mid:        #7A90A8;
  --muted:      #4A5E70;
  --border:     rgba(255,255,255,.10);
  --sage-pale:  rgba(42,156,200,.10);
  --teal-light: rgba(42,156,200,.20);
  --gold:       #E8B860;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow-md:  0 6px 24px rgba(0,0,0,.45);
  --heading-grad: linear-gradient(100deg, #FFFFFF 0%, #0ECFCF 100%);
  --orb1: rgba(42,156,200,.18);
  --orb2: rgba(91,189,160,.12);
  --orb3: rgba(14,207,207,.08);
  --grid-ln: rgba(42,156,200,.04);
}

/* ── BASE ──────────────────────────────────────────── */
body {
  background: var(--sand);
  color: var(--navy);
  transition: background .45s ease, color .45s ease;
}

/* ── HEADER ────────────────────────────────────────── */
header {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .45s ease, border-color .45s ease;
}

body.dark header {
  background: rgba(8,15,26,.82);
  border-bottom-color: rgba(255,255,255,.08);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-title { color: var(--navy); }
.logo-sub   { color: var(--muted); }

.header-badge {
  background: var(--sage-pale);
  color: var(--sage);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #BDD8CE;
  transition: all .45s ease;
}

body.dark .header-badge {
  background: rgba(42,156,200,.10);
  color: var(--teal);
  border-color: rgba(42,156,200,.30);
}

.theme-toggle {
  background: var(--sage-pale);
  border: 1.5px solid #BDD8CE;
}

body.dark .theme-toggle {
  background: rgba(42,156,200,.12);
  border-color: rgba(42,156,200,.30);
}

/* ── HERO ──────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 64px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color .45s ease;
}

body.dark .hero {
  border-bottom-color: rgba(255,255,255,.07);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(42,156,200,.09);
  border: 1px solid rgba(42,156,200,.25);
  border-radius: 24px;
  padding: 6px 16px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 28px;
  transition: all .45s ease;
}

.hero-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  animation: eyebrowPulse 2.4s ease-in-out infinite;
}

@keyframes eyebrowPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.6); }
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 600;
  line-height: 1.15;
  max-width: 640px;
  margin: 0 auto 18px;
  background: var(--heading-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  font-weight: 400;
  color: var(--mid);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.hero-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
  white-space: nowrap;
}

.hero-step-divider {
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── CONTAINER ─────────────────────────────────────── */
.container {
  max-width: 780px;
  margin: 48px auto 80px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ── PROGRESS BAR ──────────────────────────────────── */
.progress-wrap { margin-bottom: 36px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: .3px;
}

.progress-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.progress-bar-bg {
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--teal));
  border-radius: 10px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ── CARD ──────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(42,156,200,.13);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: border-color .4s ease;
}

body.dark .card {
  background: rgba(17,30,46,.80);
  border-color: rgba(42,156,200,.18);
}

.card-header {
  padding: 28px 36px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(234,243,239,.7) 0%, rgba(228,245,251,.7) 100%);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--teal-light);
}

.card-icon svg { width: 22px; height: 22px; }

.card-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.card-header p {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.6;
}

.card-body { padding: 32px 36px; }

/* ── FORM ELEMENTS ─────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid.full { grid-template-columns: 1fr; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field.span-2 { grid-column: span 2; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .2px;
}

label .req { color: var(--red-soft); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,156,200,.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A9BAB' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 90px; }

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── SECTION TITLE ─────────────────────────────────── */
.section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--teal-light);
}

/* ── CHECKBOX GRID ─────────────────────────────────── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.check-item { position: relative; }

.check-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mid);
  background: var(--white);
  transition: all var(--transition);
  user-select: none;
}

.check-label:hover {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--navy);
}

.check-item input:checked + .check-label {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 600;
}

.check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.check-item input:checked + .check-label .check-box {
  background: var(--teal);
  border-color: var(--teal);
}

.check-box::after {
  content: '';
  width: 5px;
  height: 8px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity var(--transition);
}

.check-item input:checked + .check-label .check-box::after { opacity: 1; }

/* ── SEVERITY SCALE ────────────────────────────────── */
.severity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.severity-item label { display: block; margin-bottom: 8px; }

.scale-buttons { display: flex; gap: 4px; }

.scale-btn {
  flex: 1;
  padding: 7px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.scale-btn:hover { border-color: var(--teal); color: var(--teal); }

.scale-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.scale-legend { display: flex; justify-content: space-between; margin-top: 5px; }
.scale-legend span { font-size: 10.5px; color: var(--muted); }

/* ── RADIO CARDS ───────────────────────────────────── */
.radio-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.radio-item { position: relative; }

.radio-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--mid);
  background: var(--white);
  transition: all var(--transition);
}

.radio-label:hover { border-color: var(--teal); color: var(--navy); }

.radio-item input:checked + .radio-label {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 600;
}

/* ── VR CARDS ──────────────────────────────────────── */
.vr-cards { display: flex; flex-direction: column; gap: 10px; }

.vr-card-label {
  border-radius: var(--radius-md) !important;
  padding: 14px 16px !important;
  align-items: flex-start !important;
  gap: 14px !important;
  width: 100%;
}

.vr-icon { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }

.vr-card-text { display: flex; flex-direction: column; gap: 3px; }

.vr-card-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  display: block;
}

.vr-card-text span {
  font-size: 12.5px;
  color: var(--mid);
  line-height: 1.5;
}

.radio-item input:checked + .vr-card-label .vr-card-text strong { color: var(--teal); }
.radio-item input:checked + .vr-card-label .vr-card-text span   { color: var(--teal); opacity: .85; }

/* ── NAV BUTTONS ───────────────────────────────────── */
.card-footer {
  padding: 20px 36px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: #FAFBFC;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  outline: none;
  letter-spacing: .2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #1A7FAB);
  color: white;
  box-shadow: 0 4px 16px rgba(42,156,200,.30);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(42,156,200,.40);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--mid);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--sand);
  border-color: #C4CFDA;
  color: var(--navy);
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── STEP VISIBILITY ───────────────────────────────── */
.step { display: none; }
.step.active { display: block; animation: fadeSlide .35s ease; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BACKGROUND LAYER ──────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb { position: absolute; border-radius: 50%; }

.bg-orb-1 {
  top: -200px; right: -100px;
  width: 700px; height: 700px;
  background: radial-gradient(ellipse, var(--orb1) 0%, transparent 65%);
  animation: orbDrift1 16s ease-in-out infinite alternate;
}

.bg-orb-2 {
  bottom: -150px; left: -120px;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, var(--orb2) 0%, transparent 65%);
  animation: orbDrift2 20s ease-in-out infinite alternate;
}

.bg-orb-3 {
  top: 50%; left: 50%;
  width: 450px; height: 450px;
  background: radial-gradient(ellipse, var(--orb3) 0%, transparent 65%);
  animation: orbDrift3 13s ease-in-out infinite alternate;
  transform: translate(-50%, -50%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-ln) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-ln) 1px, transparent 1px);
  background-size: 60px 60px;
}

@keyframes orbDrift1 { from { transform: translate(0,0); }        to { transform: translate(-60px,40px) scale(1.1); } }
@keyframes orbDrift2 { from { transform: translate(0,0); }        to { transform: translate(45px,-35px) scale(1.08); } }
@keyframes orbDrift3 { from { transform: translate(-50%,-50%); }  to { transform: translate(-50%,-50%) scale(1.15); } }

/* ── DARK MODE OVERRIDES ───────────────────────────── */
body.dark .card-header { background: rgba(255,255,255,.04) !important; }
body.dark .card-footer { background: rgba(255,255,255,.03) !important; }
body.dark .week-day-header {
  background: linear-gradient(90deg, rgba(42,156,200,.1), rgba(14,207,207,.05)) !important;
  border-bottom-color: rgba(255,255,255,.07);
}
body.dark .week-slot { border-bottom-color: rgba(255,255,255,.05); }
body.dark .week-day-block { border-color: rgba(255,255,255,.08); box-shadow: none; }
body.dark .resource-card { border-color: rgba(255,255,255,.08); }
body.dark .disclaimer {
  background: rgba(201,169,110,.08);
  border-color: rgba(201,169,110,.18);
}
body.dark .disclaimer p { color: rgba(220,185,110,.8); }
body.dark .disclaimer strong { color: #E8B860; }
body.dark .plan-summary-bar { border-color: rgba(42,156,200,.25); }
body.dark .summary-stat-divider { background: rgba(42,156,200,.25); }
body.dark .parenting-teaser { border-color: rgba(42,156,200,.2); }
body.dark .progress-bar-bg { background: rgba(255,255,255,.08); }
body.dark .tag-wellness  { background: rgba(91,189,160,.18);  color: #6BBDA0; }
body.dark .tag-therapy   { background: rgba(42,156,200,.18);  color: var(--teal); }
body.dark .tag-mindful   { background: rgba(150,120,220,.18); color: #B89AE0; }
body.dark .tag-nutrition { background: rgba(200,160,60,.18);  color: #D4B060; }
body.dark .tag-social    { background: rgba(200,100,110,.18); color: #E09298; }
body.dark .tag-recovery  { background: rgba(200,140,60,.18);  color: #D4A858; }
body.dark .tag-sleep     { background: rgba(80,120,200,.18);  color: #88A8E0; }
body.dark .tag-tech      { background: rgba(80,100,200,.18);  color: #8898E0; }

.card, .card-header, .card-footer, .week-day-header, .week-slot, .week-day-block,
.resource-card, .disclaimer, .parenting-teaser, .plan-summary-bar,
.progress-bar-bg, .tag-wellness, .tag-therapy, .tag-mindful, .tag-nutrition,
.tag-social, .tag-recovery, .tag-sleep, .tag-tech, .summary-stat-divider {
  transition: background .4s ease, background-color .4s ease, border-color .4s ease, color .4s ease;
}

/* ── TREATMENT PLAN ────────────────────────────────── */
#plan-card { display: none; animation: fadeSlide .4s ease; }
#plan-card.visible { display: block; }

.plan-hero {
  background: linear-gradient(135deg, var(--sage) 0%, var(--teal) 100%);
  padding: 40px 36px 36px;
  color: white;
  position: relative;
  overflow: hidden;
}

.plan-hero::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.plan-hero::after {
  content: '';
  position: absolute;
  right: 40px; bottom: -80px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.plan-greeting {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 8px;
}

.plan-hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 10px;
}

.plan-hero p {
  font-size: 14px;
  opacity: .85;
  line-height: 1.65;
  max-width: 500px;
}

.plan-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  background: rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
}

.plan-body { padding: 36px; }

.plan-diagnoses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.dx-tag {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}

.dx-tag.mental {
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid #A0D8EE;
}

.dx-tag.addiction {
  background: #FEF3E7;
  color: #C07A2A;
  border: 1px solid #F0CFA0;
}

/* ── TIME BLOCKS ───────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.time-block {
  display: flex;
  gap: 20px;
  padding-bottom: 24px;
  position: relative;
}

.time-block:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 43px; top: 52px; bottom: 0;
  width: 1px;
  background: var(--border);
}

.time-col { flex-shrink: 0; width: 86px; text-align: right; }

.time-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sage);
  letter-spacing: .5px;
  line-height: 1.3;
}

.time-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.time-dot-wrap {
  flex-shrink: 0;
  width: 16px;
  display: flex;
  justify-content: center;
  padding-top: 3px;
}

.time-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--sage);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--sage-light);
  margin-top: 3px;
}

.time-content { flex: 1; }

.time-content-inner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.time-content-inner h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.time-content-inner p {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
}

.time-content-inner ul { margin: 8px 0 0 16px; }

.time-content-inner ul li {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.7;
}

.time-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 7px;
}

.tag-wellness  { background: #EDF6F2; color: var(--sage); }
.tag-therapy   { background: #D6F1FA; color: var(--teal); }
.tag-mindful   { background: #F3EDF8; color: #7A5BA8; }
.tag-nutrition { background: #FEF9ED; color: #B8892A; }
.tag-social    { background: #FDEFF0; color: #C0525C; }
.tag-recovery  { background: #FFF3E8; color: #C07A2A; }
.tag-sleep     { background: #EAF0FD; color: #4A72C0; }
.tag-tech      { background: #EEF0FD; color: #4A5EC0; }

/* ── RESOURCES ─────────────────────────────────────── */
.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.resource-card {
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.resource-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.resource-card p {
  font-size: 12.5px;
  color: var(--mid);
  line-height: 1.55;
}

.resource-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--sage-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.resource-icon svg { width: 15px; height: 15px; }

/* ── DISCLAIMER ────────────────────────────────────── */
.disclaimer {
  margin-top: 32px;
  padding: 16px 20px;
  background: #FFF9EE;
  border: 1px solid #F0DFBA;
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.disclaimer svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.disclaimer p { font-size: 12px; color: #7A6130; line-height: 1.6; }
.disclaimer strong { color: #5A4210; }

/* ── CERTIFICATE ───────────────────────────────────── */
.certificate-wrap {
  margin-top: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0B1F3A 0%, #0D2B50 60%, #0A3040 100%);
  padding: 3px;
  box-shadow: 0 8px 40px rgba(42,156,200,.22), 0 2px 8px rgba(0,0,0,.12);
}
.certificate-inner {
  background: linear-gradient(155deg, #0F2744 0%, #0C1E38 100%);
  border-radius: calc(var(--radius-lg) - 2px);
  padding: 48px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.certificate-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(42,156,200,.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(91,189,160,.06) 0%, transparent 45%);
  pointer-events: none;
}
.cert-logo {
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--teal); margin-bottom: 8px;
}
.cert-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 4px;
  text-transform: uppercase; color: rgba(255,255,255,.45); margin-bottom: 20px;
}
.cert-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 40px); font-weight: 600; font-style: italic;
  color: #FFFFFF; margin-bottom: 16px; line-height: 1.2;
}
.cert-body {
  font-size: 13.5px; color: rgba(255,255,255,.65);
  line-height: 1.8; max-width: 520px; margin: 0 auto 28px;
}
.cert-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 18px 0; margin-bottom: 24px;
}
.cert-meta-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 0 32px;
}
.cert-meta-divider { width: 1px; height: 36px; background: rgba(255,255,255,.12); }
.cert-meta-label { font-size: 9.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.35); }
.cert-meta-value { font-size: 13.5px; font-weight: 600; color: var(--teal); }
.cert-seal { font-size: 26px; color: var(--gold); opacity: .75; letter-spacing: 8px; }

/* ── PARENTING TEASER ──────────────────────────────── */
.parenting-teaser {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--sage-pale);
  border: 1px solid #C8DDD8;
  border-radius: var(--radius-md);
}
.parenting-teaser-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.parenting-teaser-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.parenting-teaser-body { font-size: 12.5px; color: var(--mid); line-height: 1.7; }
.parenting-teaser-body strong { color: var(--navy); }

/* ── PLAN ACTIONS ──────────────────────────────────── */
.plan-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── DAY PICKER ────────────────────────────────────── */
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.day-btn {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--mid);
  cursor: pointer;
  transition: all var(--transition);
}

.day-btn:hover { border-color: var(--sage-light); color: var(--navy); }
.day-btn.selected { background: var(--sage); border-color: var(--sage); color: white; }

/* ── START DATE PICKER ─────────────────────────────── */
.start-date-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.start-date-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 72px;
}

.start-date-btn:hover {
  border-color: var(--teal);
  background: rgba(42,156,200,.06);
}

.start-date-btn.selected {
  background: var(--teal);
  border-color: var(--teal);
}

.start-date-btn.selected .sd-day,
.start-date-btn.selected .sd-date { color: white; }

.sd-day {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--teal);
}

.sd-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

/* smaller check grid for support level */
.check-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* support level — full-width, 4-across */
.check-grid-support {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.field-hint-inline {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

/* ── REMINDERS ─────────────────────────────────────── */
.reminder-toggle-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.reminder-toggle-btn {
  padding: 9px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mid);
  cursor: pointer;
  transition: all var(--transition);
}

.reminder-toggle-btn:hover { border-color: var(--teal); color: var(--navy); }
.reminder-toggle-btn.selected { background: var(--teal); border-color: var(--teal); color: white; }

.reminder-method-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reminder-method-card {
  cursor: pointer;
}

.reminder-method-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rmc-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mid);
  background: var(--white);
  transition: all var(--transition);
  user-select: none;
}

.rmc-inner svg { width: 17px; height: 17px; flex-shrink: 0; }

.reminder-method-card:hover .rmc-inner { border-color: var(--teal); color: var(--navy); }

.reminder-method-card input:checked + .rmc-inner {
  border-color: var(--teal);
  background: rgba(42,156,200,.09);
  color: var(--teal);
}

/* ── WEEKLY PLAN TABLE ─────────────────────────────── */
.week-grid { display: flex; flex-direction: column; gap: 20px; margin-bottom: 8px; }

.week-day-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.week-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(90deg, var(--sage-pale), #E8F5FC);
  border-bottom: 1px solid var(--border);
}

.week-day-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 600; color: var(--navy);
}

.week-day-meta {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}

.week-day-slots { display: flex; flex-direction: column; gap: 0; }

.week-slot {
  display: flex;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #F0F4F7;
  align-items: flex-start;
}
.week-slot:last-child { border-bottom: none; }

.week-slot-time {
  flex-shrink: 0; width: 80px;
  font-size: 11.5px; font-weight: 700; color: var(--sage); padding-top: 2px;
}

.week-slot-body { flex: 1; }

.week-slot-title {
  font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 3px;
}

.week-slot-desc { font-size: 12.5px; color: var(--mid); line-height: 1.55; }

.week-slot-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 2px 7px; border-radius: 4px; margin-bottom: 5px;
}

.plan-summary-bar {
  display: flex;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 16px 18px;
  background: var(--sage-pale);
  border: 1px solid #BDD8CE;
  border-radius: var(--radius-md);
}

.summary-stat { display: flex; flex-direction: column; gap: 2px; }

.summary-stat-value {
  font-size: 18px; font-weight: 700; color: var(--teal); line-height: 1;
}

.summary-stat-label {
  font-size: 11px; font-weight: 500; color: var(--mid);
  text-transform: uppercase; letter-spacing: .8px;
}

.summary-stat-divider {
  width: 1px; background: #BDD8CE; align-self: stretch; margin: 0 4px;
}

/* ── ERROR STATE ───────────────────────────────────── */
.error-msg { font-size: 12px; color: var(--red-soft); margin-top: 4px; display: none; }

.field-error input,
.field-error select { border-color: var(--red-soft) !important; }

/* ── FOUR-WEEK OVERVIEW ─────────────────────────────── */
.four-week-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}

.fw-card {
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.fw-card.fw-active {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), var(--shadow-sm);
}

.fw-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fw-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--teal);
  background: rgba(42,156,200,.1);
  border-radius: 6px;
  padding: 2px 7px;
}

.fw-phase {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.fw-theme {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.fw-desc {
  font-size: 12px;
  color: var(--mid);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.fw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.fw-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--sage);
  background: var(--sage-pale);
  border-radius: 20px;
  padding: 3px 9px;
}

body.dark .fw-card {
  background: rgba(17,30,46,.65);
  border-color: rgba(255,255,255,.08);
}

body.dark .fw-card.fw-active {
  border-color: rgba(42,156,200,.5);
  box-shadow: 0 0 0 1px rgba(42,156,200,.5);
}

/* ── CRISIS BANNER ──────────────────────────────────── */
.crisis-banner {
  display: none;
  align-items: flex-start;
  gap: 14px;
  background: rgba(224,117,117,.08);
  border: 1px solid rgba(224,117,117,.35);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.crisis-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.crisis-banner-body {
  font-size: 13.5px;
  color: var(--navy);
  line-height: 1.65;
}

.crisis-banner-body strong {
  display: block;
  margin-bottom: 4px;
  color: #c0392b;
  font-size: 14px;
}

.crisis-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 10px;
}

.crisis-lines span {
  font-size: 13px;
  color: var(--mid);
}

.crisis-lines a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

body.dark .crisis-banner {
  background: rgba(224,117,117,.12);
  border-color: rgba(224,117,117,.30);
}

body.dark .crisis-banner-body strong { color: #e07575; }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 640px) {
  header { padding: 0 20px; }
  .card-header, .card-body, .card-footer { padding-left: 20px; padding-right: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.span-2 { grid-column: span 1; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .severity-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .hero-steps { flex-direction: column; align-items: center; gap: 10px; }
  .hero-step-divider { width: 1px; height: 16px; margin: 0; }
  .plan-hero { padding: 28px 20px 24px; }
  .plan-body { padding: 20px; }
  .time-col { width: 68px; }
  .four-week-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  header, .progress-wrap, .hero, #form-section { display: none !important; }
  #plan-card { display: block !important; box-shadow: none !important; }
  .plan-actions { display: none !important; }
  .certificate-wrap { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .parenting-teaser { display: none; }
}
