/* ============================================================
   Celva Bio — Book a Consultation
   Clinical intake. Calm, unhurried, honest. Cream + navy + ice.
   Works over site.css + v4.css tokens.
   ============================================================ */

.book {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
}
.book .v4-mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 400;
}
.book .v4-lbl { color: var(--ink-muted); }

/* ---------- System bar ---------- */
.book-sysbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--border);
  background: var(--surface-tint);
  font-size: 11px; color: var(--ink-muted);
}
.book-sysbar .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.book-sysbar__ok { color: #2f7d52 !important; display: inline-flex; align-items: center; gap: 8px; }
.book-sysbar__pulse { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; position: relative; }
.book-sysbar__pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: #4ade80; opacity: 0.4; animation: bkpulse 2s ease-out infinite; }
@keyframes bkpulse { 0%{transform:scale(0.5);opacity:0.4} 100%{transform:scale(1.6);opacity:0} }

/* ---------- Layout: two columns ---------- */
.book-wrap {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

/* ---------- Left: intent panel ---------- */
.book-intent {
  padding: clamp(48px, 5vw, 80px) clamp(32px, 4vw, 64px);
  background: var(--surface-tint);
  border-right: 1px solid var(--border);
  position: relative;
}
.book-intent__inner {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 40px;
}

.book-intent__tag {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent-blue);
}
.book-intent__tag::before {
  content: ''; width: 20px; height: 1px; background: var(--accent-blue);
}

.book-intent h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 4.4vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.book-intent h1 em { font-style: italic; color: var(--accent-blue); font-weight: 400; }

.book-intent__lede {
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 46ch;
}

.book-intent__sig {
  display: flex; gap: 18px; align-items: flex-start;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.book-intent__sig-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: #dcd6c8 center/cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.book-intent__sig-text { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.book-intent__sig-text strong { display: block; font-weight: 500; color: var(--ink); font-size: 14.5px; margin-bottom: 2px; }
.book-intent__sig-text small { display: block; margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-muted); text-transform: uppercase; }

/* Expectations list */
.book-expect {
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.book-expect__title {
  color: var(--ink-muted);
  margin-bottom: 20px;
}
.book-expect__row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.book-expect__row:last-child { border-bottom: 0; }
.book-expect__n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-blue);
  letter-spacing: 0.06em;
  padding-top: 2px;
}
.book-expect__body h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.book-expect__body p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); }

/* ---------- Right: form panel ---------- */
.book-form {
  padding: clamp(40px, 5vw, 72px) clamp(32px, 5vw, 88px);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.book-form__status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 18px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.book-form__status-sub { color: var(--ink-muted); }

.book-form__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.book-form__case {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.book-form__case b { color: var(--ink); font-weight: 500; }

/* ---------- Progress rail ---------- */
.book-progress {
  display: flex; align-items: center; gap: 10px;
}
.book-progress__step {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.25s;
}
.book-progress__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 10.5px; font-weight: 500;
  color: var(--ink-muted);
  background: #fff;
  transition: all 0.25s;
}
.book-progress__step.is-done .book-progress__num,
.book-progress__step.is-active .book-progress__num {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}
.book-progress__step.is-active { color: var(--ink); }
.book-progress__step.is-done { color: var(--accent-blue); }
.book-progress__step.is-done .book-progress__num::after {
  content: ''; width: 7px; height: 4px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(1px,-1px);
  display: block;
}
.book-progress__step.is-done .book-progress__num { font-size: 0; }
.book-progress__bar {
  flex: 0 1 24px; height: 1px; background: var(--border-strong);
  transition: background 0.25s;
}
.book-progress__bar.is-done { background: var(--accent-blue); }

/* ---------- Step ---------- */
.book-step { display: none; animation: stepIn 0.4s ease-out; }
.book-step.is-active { display: block; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.book-step__eyebrow {
  color: var(--accent-blue);
  margin-bottom: 16px;
}
.book-step__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
}
.book-step__title em { font-style: italic; color: var(--accent-blue); font-weight: 400; }
.book-step__sub {
  font-size: 16px; line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 40px;
  max-width: 54ch;
}

/* ---------- Option cards (radio / checkbox) ---------- */
.book-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
}
.book-options--list { grid-template-columns: 1fr; }
.book-option {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  align-items: flex-start;
}
.book-option:hover {
  border-color: var(--accent-blue);
  background: #fafbfd;
}
.book-option input { position: absolute; opacity: 0; pointer-events: none; }
.book-option__mark {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  transition: all 0.18s;
  margin-top: 2px;
}
.book-option[data-type="multi"] .book-option__mark { border-radius: 3px; }
.book-option__mark::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-blue);
  opacity: 0; transform: scale(0.5);
  transition: all 0.18s;
}
.book-option[data-type="multi"] .book-option__mark::after {
  width: 10px; height: 6px;
  border-radius: 0; background: transparent;
  border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) scale(0.5) translate(2px, -1px);
}
.book-option input:checked ~ .book-option__mark {
  border-color: var(--accent-blue);
}
.book-option input:checked ~ .book-option__mark::after {
  opacity: 1; transform: scale(1);
}
.book-option[data-type="multi"] input:checked ~ .book-option__mark {
  background: var(--accent-blue);
}
.book-option[data-type="multi"] input:checked ~ .book-option__mark::after {
  transform: rotate(-45deg) scale(1) translate(1px, -1px);
}
.book-option:has(input:checked) {
  border-color: var(--accent-blue);
  background: var(--accent-wash);
}
.book-option__body { flex: 1; min-width: 0; }
.book-option__title {
  display: block;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.book-option__desc {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.book-option__aside {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
  padding-top: 4px;
}

/* ---------- Field groups ---------- */
.book-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 32px;
}
.book-field { display: flex; flex-direction: column; gap: 8px; }
.book-field--full { grid-column: 1 / -1; }
.book-field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.book-field label .req { color: var(--accent-blue); }
.book-field input[type="text"],
.book-field input[type="email"],
.book-field input[type="tel"],
.book-field input[type="number"],
.book-field select,
.book-field textarea {
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--ink);
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 2px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  -webkit-appearance: none; appearance: none;
}
.book-field input::placeholder, .book-field textarea::placeholder { color: #97a5b8; }
.book-field input:focus,
.book-field select:focus,
.book-field textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(45, 110, 177, 0.12);
}
.book-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234A6480' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 40px;
}
.book-field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.book-field__hint {
  font-size: 12px; color: var(--ink-muted); line-height: 1.5;
}

/* Severity slider */
.book-slider { display: flex; flex-direction: column; gap: 14px; }
.book-slider__range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; outline: none;
}
.book-slider__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent-blue);
  cursor: grab; box-shadow: 0 2px 6px rgba(11,29,58,0.18);
  transition: transform 0.15s;
}
.book-slider__range::-webkit-slider-thumb:active { transform: scale(1.1); }
.book-slider__range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent-blue);
  cursor: grab; box-shadow: 0 2px 6px rgba(11,29,58,0.18);
}
.book-slider__scale {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.06em;
}
.book-slider__val {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent-wash);
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  align-self: flex-start;
}

/* ---------- Consent checklist ---------- */
.book-consent {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  margin-bottom: 24px;
}
.book-consent__row {
  display: flex; gap: 12px; align-items: flex-start;
  cursor: pointer;
  font-size: 13.5px; line-height: 1.5; color: var(--ink-soft);
}
.book-consent__row input { position: absolute; opacity: 0; pointer-events: none; }
.book-consent__box {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  margin-top: 1px;
}
.book-consent__box::after {
  content: ''; width: 8px; height: 5px;
  border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.18s;
}
.book-consent__row input:checked ~ .book-consent__box {
  background: var(--accent-blue); border-color: var(--accent-blue);
}
.book-consent__row input:checked ~ .book-consent__box::after {
  transform: rotate(-45deg) scale(1) translate(1px, -1px);
}
.book-consent__row a { color: var(--accent-blue); border-bottom: 1px solid currentColor; }

/* ---------- Review / summary ---------- */
.book-review {
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.book-review__row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.book-review__row:last-child { border-bottom: 0; }
.book-review__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.book-review__val {
  font-size: 15px; color: var(--ink); line-height: 1.5;
}
.book-review__val .dim { color: var(--ink-muted); font-style: italic; }
.book-review__edit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-blue);
  background: none; border: 0; cursor: pointer;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
}
.book-review__edit:hover { border-bottom-color: var(--accent-blue); }

/* ---------- Nav row ---------- */
.book-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.book-nav__left, .book-nav__right { display: flex; align-items: center; gap: 20px; }
.book-back {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink-muted);
  background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 4px;
  transition: color 0.15s;
}
.book-back:hover { color: var(--ink); }
.book-back[disabled] { opacity: 0.3; cursor: not-allowed; }
.book-primary {
  font-family: var(--font-body);
  font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em;
  color: #fff;
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.book-primary:hover:not([disabled]) {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
}
.book-primary:active { transform: translateY(1px); }
.book-primary[disabled] { opacity: 0.45; cursor: not-allowed; }
.book-primary svg { transition: transform 0.2s; }
.book-primary:hover:not([disabled]) svg { transform: translateX(3px); }

.book-assure {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Success state ---------- */
.book-success {
  display: none;
  text-align: left;
  max-width: 620px;
  padding: 32px 0;
}
.book-success.is-active { display: block; animation: stepIn 0.5s ease-out; }
.book-success__glyph {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}
.book-success__glyph::after {
  content: ''; width: 22px; height: 12px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(2px, -4px);
}
.book-success h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}
.book-success h2 em { font-style: italic; color: var(--accent-blue); font-weight: 400; }
.book-success p {
  font-size: 16.5px; line-height: 1.6; color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 52ch;
}
.book-success__case {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  margin-top: 8px;
  margin-bottom: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink);
}
.book-success__case b { color: var(--accent-blue); font-weight: 500; }
.book-success__next {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 4px;
}
.book-success__next h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 14px; font-weight: 500;
}
.book-success__next ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.book-success__next li {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  align-items: baseline;
}
.book-success__next li:last-child { border-bottom: 0; }
.book-success__next .n {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--accent-blue); letter-spacing: 0.08em;
}
.book-success__next .t { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.book-success__next .when {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--ink-muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.book-success__actions {
  display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap;
}
.book-success__actions a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.book-success__actions a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Error state ---------- */
.book-field.is-error input,
.book-field.is-error textarea,
.book-field.is-error select { border-color: #c94a3f; box-shadow: 0 0 0 3px rgba(201,74,63,0.1); }
.book-field__err {
  display: none;
  font-size: 12px; color: #c94a3f;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em;
}
.book-field.is-error .book-field__err { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .book-wrap { grid-template-columns: 1fr; }
  .book-intent { border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 56px; }
  .book-intent__inner { position: static; }
  .book-form__header { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .book-options { grid-template-columns: 1fr; }
  .book-fields { grid-template-columns: 1fr; }
  .book-progress__step span:not(.book-progress__num) { display: none; }
  .book-progress { gap: 6px; }

  /* Sysbar: tighten to one readable line on mobile */
  .book-sysbar { padding: 10px 20px; gap: 10px; font-size: 10px; }
  .book-sysbar .v4-mono { font-size: 9.5px; }
  .book-sysbar .dot { display: none; }
  /* Drop the middle "Secure · HIPAA" chunk on mobile — it lives in privacy/legal */
  .book-sysbar > span:nth-child(3) { display: none; }

  .book-form__status { padding: 0 0 14px; gap: 10px; }
  .book-form__status .v4-mono { font-size: 10px; }
  .book-form__status-sub { flex-basis: 100%; }
  .book-review__row { grid-template-columns: 1fr; gap: 4px; }
  .book-review__edit { justify-self: start; }
  .book-form__header { padding-bottom: 18px; margin-bottom: 28px; }
  .book-intent, .book-form { padding: 36px 22px; }
  .book-nav__left, .book-nav__right { gap: 12px; }
  .book-assure { display: none; }
  .book-primary { padding: 13px 20px; font-size: 14px; }
}
