
:root {
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-light: #ccfbf1;
  --teal-xlight: #f0fdfa;
  --navy: #0f172a;
  --navy-mid: #1e293b;
  --text: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --white: #ffffff;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: #f8fafc;
  color: var(--text);
  min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-dot { color: var(--teal); }

.badge-hipaa {
  font-size: 11px;
  background: var(--teal-xlight);
  color: var(--teal-dark);
  border: 1px solid var(--teal-light);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 500;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 0;
  max-width: 680px;
  margin: 0 auto;
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  text-align: center;
  flex: 1;
  transition: color 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-label.active { color: var(--teal); }
.step-label.done { color: var(--text-mid); }

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s;
  border: 2px solid var(--border);
}

.step-label.active .step-dot {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  box-shadow: 0 0 0 4px var(--teal-light);
}

.step-label.done .step-dot {
  background: var(--teal-xlight);
  border-color: var(--teal);
  color: var(--teal);
}

.progress-track {
  height: 3px;
  background: var(--border);
  max-width: 680px;
  margin: 10px auto 0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #2dd4bf);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* ── MAIN LAYOUT ── */
.main-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

/* ── PAGE SECTIONS ── */
.page { display: none; animation: fadeUp 0.4s ease; }
.page.active { display: block; }

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

/* ── CARD ── */
.card-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.page-sub {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── QUESTION CARDS ── */
.q-block {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.q-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.q-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.q-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 14px;
  line-height: 1.5;
}

.q-sub {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 14px;
  font-style: italic;
}

.options-grid { display: flex; flex-direction: column; gap: 8px; }

.opt-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  user-select: none;
  position: relative;
}

.opt-label:hover {
  border-color: var(--teal);
  background: var(--teal-xlight);
}

.opt-label.selected {
  border-color: var(--teal);
  background: var(--teal-xlight);
  color: var(--teal-dark);
  font-weight: 500;
}

/* BLOCK OPTION STYLING — uncomment when clinical validation is enabled
.opt-label.blocked-option {
  border-color: #fca5a5;
  background: var(--danger-light);
}
*/

.opt-label input { display: none; }
.opt-label .opt-icon,
.opt-label .opt-check,
.opt-label .opt-check-inner,
.opt-label .risk-pill,
.opt-label span { pointer-events: none; }

.opt-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.opt-label.selected .opt-icon {
  background: var(--teal);
  border-color: var(--teal);
}

.opt-icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.18s;
}

.opt-label.selected .opt-icon::after { opacity: 1; }

.opt-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.opt-label.selected .opt-check {
  background: var(--teal);
  border-color: var(--teal);
}

.opt-check-inner {
  display: none;
  color: white;
  font-size: 11px;
}

.opt-label.selected .opt-check-inner { display: block; }

.risk-pill {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
}

.risk-0 { background: #f1f5f9; color: var(--text-light); }
.risk-low { background: #fef9c3; color: #854d0e; }
.risk-high { background: var(--danger-light); color: var(--danger); }

/* ── BLOCK SCREEN ── */
.block-card {
  background: var(--danger-light);
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.block-icon {
  width: 64px;
  height: 64px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.block-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: #991b1b;
  margin-bottom: 10px;
}

.block-msg {
  font-size: 14px;
  color: #7f1d1d;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ── FORM FIELDS ── */
.field-group { margin-bottom: 20px; }

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.field-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  transition: border-color 0.18s;
  background: var(--white);
}

.field-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-light);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── REVIEW ── */
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.review-row:last-child { border-bottom: none; }
.review-q { color: var(--text-mid); flex: 1; line-height: 1.5; }
.review-a { color: var(--navy); font-weight: 500; text-align: right; flex: 1; line-height: 1.5; }

.score-banner {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.score-banner.low { background: #dcfce7; border: 1px solid #86efac; }
.score-banner.high { background: var(--danger-light); border: 1px solid #fca5a5; }

.score-label { font-size: 14px; font-weight: 500; }
.score-label.low { color: #166534; }
.score-label.high { color: #991b1b; }
.score-num { font-size: 28px; font-weight: 700; }
.score-num.low { color: #16a34a; }
.score-num.high { color: var(--danger); }

/* ── NOTE DETAILS ── */
.date-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ── PAYMENT ── */
.price-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius);
  padding: 28px;
  color: white;
  text-align: center;
  margin-bottom: 20px;
}

.price-amount {
  font-family: 'DM Serif Display', serif;
  font-size: 52px;
  line-height: 1;
  margin-bottom: 4px;
}

.price-desc { font-size: 14px; opacity: 0.7; margin-bottom: 20px; }

.price-features { list-style: none; text-align: left; margin: 0 auto; max-width: 280px; }
.price-features li {
  font-size: 13px;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}
.price-features li::before { content: '✓'; color: #2dd4bf; font-weight: 700; }

.stripe-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
}

/* ── THANK YOU ── */
.thankyou-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--teal), #2dd4bf);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 32px rgba(13,148,136,0.3);
}

.note-id-box {
  background: var(--teal-xlight);
  border: 1.5px dashed var(--teal);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
  margin: 20px 0;
}

.note-id-label { font-size: 11px; color: var(--teal-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.note-id-value { font-family: 'DM Serif Display', serif; font-size: 24px; color: var(--navy); letter-spacing: 2px; }

.timeline { margin: 20px 0; }
.tl-item {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.tl-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.tl-dot.done { background: var(--teal); color: white; }
.tl-dot.pending { background: var(--border); color: var(--text-light); }
.tl-content { padding-top: 4px; }
.tl-title { font-size: 14px; font-weight: 500; color: var(--navy); }
.tl-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── PROVIDER TABLE ── */
.provider-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.provider-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

.provider-table th {
  background: var(--navy);
  color: white;
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.provider-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.provider-table tr:last-child td { border-bottom: none; }
.provider-table tr:hover td { background: var(--teal-xlight); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pending { background: #fef9c3; color: #854d0e; }
.status-reviewed { background: #dcfce7; color: #166534; }
.status-signed { background: var(--teal-light); color: var(--teal-dark); }

/* ── BUTTONS ── */
.btn-primary-nfw {
  background: linear-gradient(135deg, var(--teal), #0f766e);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.btn-primary-nfw:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(13,148,136,0.35);
}

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

.btn-secondary-nfw {
  background: transparent;
  color: var(--text-mid);
  border: 1.5px solid var(--border);
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary-nfw:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-xlight); }

.btn-row { display: flex; gap: 12px; margin-top: 24px; }
.btn-row .btn-secondary-nfw { flex: 0 0 auto; min-width: 100px; }
.btn-row .btn-primary-nfw { flex: 1; }

/* ── TRUST BAR ── */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
}

.trust-item i { color: var(--teal); }

/* ── VALIDATION ── */
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.field-input.error { border-color: var(--danger); }
.q-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 576px) {
  .main-wrap { padding: 20px 12px 60px; }
  .card-wrap { padding: 20px; }
  .page-title { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .step-labels { display: none; }
  .price-amount { font-size: 42px; }
  .btn-row { flex-direction: column-reverse; }
  .btn-row .btn-secondary-nfw { width: 100%; }
  .trust-bar { gap: 12px; }
}

/* ── CONDITIONAL Q ── */
.conditional-q { display: none; }
.conditional-q.show { display: block; }

/* ── EDIT HIGHLIGHT ── */
.edit-btn {
  font-size: 12px;
  color: var(--teal);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  text-decoration: underline;
}
