/* ClarityBooks intake form styles (external, CSP-safe — no inline styles). */

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

:root {
  --ink: #0f0e0c;
  --cream: #f7f3ec;
  --gold: #c9a84c;
  --gold-light: #e8d5a3;
  --warm-gray: #6b6460;
  --border: #e2ddd6;
  --card: #ffffff;
  --error: #c0392b;
  --success: #2e7d32;
}

html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  background: var(--ink);
  color: var(--cream);
  padding: 3rem 2.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  overflow-y: auto;
}

.sidebar-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sidebar-logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--cream); text-decoration: none; }
.sidebar-logo span { color: var(--gold); }

.lang-toggle {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(247,243,236,0.7);
  background: none;
  border: 1.5px solid rgba(247,243,236,0.25);
  border-radius: 2px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { border-color: var(--gold); color: var(--cream); }
.lang-toggle b { color: var(--gold); font-weight: 700; }

.sidebar-intro h2 { font-family: 'Playfair Display', serif; font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.75rem; }
.sidebar-intro h2 em { font-style: italic; color: var(--gold); }
.sidebar-intro p { font-size: 0.85rem; color: rgba(247,243,236,0.65); line-height: 1.7; }

.sidebar-steps { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-step { display: flex; gap: 1rem; align-items: flex-start; }

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,168,76,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 600; color: var(--gold);
  flex-shrink: 0; margin-top: 2px;
  transition: background 0.3s, border-color 0.3s;
}
.step-dot.active { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.step-dot.done { background: rgba(201,168,76,0.15); border-color: var(--gold); color: var(--gold); }

.step-info { flex: 1; }
.step-label { font-size: 0.78rem; font-weight: 500; color: var(--cream); margin-bottom: 0.15rem; }
.step-desc { font-size: 0.72rem; color: rgba(247,243,236,0.45); line-height: 1.5; }

.sidebar-promise {
  margin-top: auto;
  padding: 1.25rem;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px;
  background: rgba(201,168,76,0.06);
}
.promise-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.5rem; }
.promise-text { font-size: 0.8rem; color: rgba(247,243,236,0.6); line-height: 1.6; }

/* ─── MAIN ─── */
.main { padding: 4rem 3rem; max-width: 700px; margin: 0 auto; width: 100%; }

/* ─── DISCLAIMER BANNER (compliance) ─── */
.disclaimer-banner {
  background: #fffdf7;
  border: 1px solid var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  font-size: 0.78rem;
  color: var(--warm-gray);
  line-height: 1.6;
}
.disclaimer-banner strong { color: var(--ink); font-weight: 500; }

.progress-bar { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 2.5rem; overflow: hidden; }
.progress-fill { height: 100%; width: 25%; background: var(--gold); border-radius: 2px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

.step-panel { display: none; animation: slideIn 0.4s ease; }
.step-panel.active { display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.step-header { margin-bottom: 2.5rem; }
.step-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; margin-bottom: 0.5rem; }
.step-title { font-family: 'Playfair Display', serif; font-size: 1.9rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.step-subtitle { font-size: 0.88rem; color: var(--warm-gray); line-height: 1.6; }

.fields { display: flex; flex-direction: column; gap: 1.5rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-size: 0.8rem; font-weight: 500; color: var(--ink); letter-spacing: 0.02em; }
.field label .req { color: var(--gold); margin-left: 2px; }

.field input, .field select, .field textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 3px;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12); }
.field input.error, .field select.error, .field textarea.error { border-color: var(--error); }
.field textarea { resize: vertical; min-height: 110px; }
.field textarea.ta-short { min-height: 80px; }
.field-hint { font-size: 0.74rem; color: var(--warm-gray); line-height: 1.5; }
.field-error { font-size: 0.74rem; color: var(--error); display: none; }
.field-error.visible { display: block; }

.card-options { display: grid; gap: 0.75rem; }
.card-options.cols-2 { grid-template-columns: 1fr 1fr; }
.card-options.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.card-option { position: relative; cursor: pointer; }
.card-option input[type="radio"], .card-option input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }

.card-face {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
  height: 100%;
}
.card-face:hover { border-color: var(--gold-light); transform: translateY(-1px); }
.card-option input:checked + .card-face { border-color: var(--gold); background: #fffdf7; box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }
.card-option input:focus-visible + .card-face { outline: 2px solid var(--gold); outline-offset: 2px; }

.card-icon { font-size: 1.3rem; }
.card-name { font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.card-desc { font-size: 0.74rem; color: var(--warm-gray); line-height: 1.4; }

.range-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--warm-gray); }
.range-value { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: 0.25rem; }

input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--border); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--gold); cursor: pointer; transition: transform 0.15s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* consent checkbox */
.consent {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: #fffdf7; border: 1.5px solid var(--gold-light);
  border-radius: 4px; padding: 1rem 1.1rem;
}
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--gold); flex-shrink: 0; }
.consent label { font-size: 0.8rem; color: var(--warm-gray); line-height: 1.55; cursor: pointer; }
.consent label b { color: var(--ink); font-weight: 500; }
.consent label a { color: var(--ink); }

/* honeypot — invisible to humans, tempting to bots.
   Not display:none (some bots skip those); moved off-screen instead. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  height: 1px; width: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Turnstile (CAPTCHA) container */
.turnstile-wrap { min-height: 65px; }

.step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.step-nav-right { display: flex; align-items: center; gap: 1.5rem; }
.btn-back { background: none; border: 1.5px solid var(--border); color: var(--warm-gray); padding: 0.75rem 1.5rem; border-radius: 3px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.btn-back:hover { border-color: var(--ink); color: var(--ink); }
.btn-next { background: var(--ink); color: var(--cream); border: none; padding: 0.85rem 2rem; border-radius: 3px; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500; cursor: pointer; letter-spacing: 0.02em; box-shadow: 4px 4px 0px var(--gold); transition: background 0.2s, transform 0.15s, box-shadow 0.2s; }
.btn-next:hover { background: var(--gold); color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0px var(--ink); }
.btn-next:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-next.btn-submit { background: var(--success); box-shadow: 4px 4px 0px var(--gold); }
.step-counter { font-size: 0.78rem; color: var(--warm-gray); }

/* submit failure message */
.submit-error {
  display: none;
  margin-top: 1rem;
  background: #fbe0dc;
  border: 1px solid var(--error);
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
  font-size: 0.82rem;
  color: var(--error);
  line-height: 1.5;
}
.submit-error.visible { display: block; }

.success-screen { display: none; text-align: center; padding: 4rem 2rem; animation: slideIn 0.5s ease; }
.success-screen.active { display: block; }
.success-icon { width: 80px; height: 80px; border-radius: 50%; background: #fdeccd; border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 2rem; }
.success-screen h2 { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; line-height: 1.15; margin-bottom: 1rem; }
.success-screen h2 em { font-style: italic; color: var(--gold); }
.success-screen p { font-size: 0.95rem; color: var(--warm-gray); line-height: 1.7; max-width: 440px; margin: 0 auto 2rem; }

.next-steps { display: flex; flex-direction: column; gap: 0.75rem; max-width: 440px; margin: 0 auto 2.5rem; text-align: left; }
.next-step-item { display: flex; align-items: flex-start; gap: 0.75rem; background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 1rem; }
.ns-num { width: 24px; height: 24px; border-radius: 50%; background: var(--gold-light); color: #7a5c1a; font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ns-text { font-size: 0.83rem; color: var(--ink); line-height: 1.5; }
.ns-text strong { font-weight: 500; }

.success-disclaimer { font-size: 0.72rem; color: var(--warm-gray); max-width: 440px; margin: 0 auto; line-height: 1.6; }

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 2rem 1.5rem; gap: 1.5rem; }
  .sidebar-steps, .sidebar-promise { display: none; }
  .main { padding: 2rem 1.5rem; max-width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .card-options.cols-3 { grid-template-columns: 1fr 1fr; }
  .card-options.cols-2 { grid-template-columns: 1fr; }
}
