/* ==========================================================================
   Shared components for the clinic templates (copied into each template's assets/).
   Every colour is a token from the template's :root, so this file never needs editing
   to re-theme. Templates tune shape with --radius-btn / --radius-card / --radius-field.
   ========================================================================== */
:root { --radius-btn: 999px; --radius-card: 24px; --radius-field: 14px; --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.22, 1.25, .36, 1); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: rgb(var(--c-ground)); color: rgb(var(--c-ink)); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
::selection { background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent)); }
:focus-visible { outline: 3px solid rgb(var(--c-accent)); outline-offset: 3px; border-radius: 8px; }
.tnum { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); letter-spacing: var(--display-tracking, -0.02em); line-height: var(--display-leading, 1.02); }

/* buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: var(--radius-btn); font-weight: 700; white-space: nowrap;
  transition: transform .4s var(--ease-spring), background-color .2s, color .2s, box-shadow .3s; -webkit-tap-highlight-color: transparent; user-select: none; }
.btn:active { transform: scale(.96); transition-duration: 90ms; }
.btn-accent { background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent)); }
.btn-ink { background: rgb(var(--c-ink)); color: rgb(var(--c-ground)); }
.btn-line { color: rgb(var(--c-ink)); box-shadow: inset 0 0 0 1.5px rgb(var(--c-ink) / .25); }
@media (hover: hover) {
  .btn-accent:hover { background: rgb(var(--c-accent-deep)); color: rgb(var(--c-on-accent-deep, var(--c-on-accent))); transform: translateY(-2px); }
  .btn-ink:hover { transform: translateY(-2px); }
  .btn-line:hover { box-shadow: inset 0 0 0 1.5px rgb(var(--c-ink)); transform: translateY(-2px); }
}
.btn .arrow { transition: transform .4s var(--ease-spring); }
.btn:hover .arrow { transform: translateX(4px); }

/* nav */
.nav { transition: background-color .35s, box-shadow .35s, color .35s; }
.nav.is-scrolled { background: rgb(var(--c-ground) / .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgb(var(--c-ink) / .07); }

/* reveal (content stays visible without JS) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.split-line { display: inline-block; vertical-align: top; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.split-word { display: inline-block; }

/* reviews */
.quote { transition: opacity .5s ease, transform .7s var(--ease-out), visibility 0s .5s; opacity: 0; visibility: hidden; transform: translateY(14px); }
.quote.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease .1s, transform .7s var(--ease-out) .1s, visibility 0s; }
.dot { position: relative; transition: width .5s var(--ease-spring), background-color .3s; }
.dot::after { content: ""; position: absolute; inset: -14px -6px; }
.dot[aria-current="true"] { width: 2rem; background: rgb(var(--c-accent)); }

/* FAQ */
.faq summary { list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { transition: transform .5s var(--ease-spring); }
.faq[open] .plus { transform: rotate(45deg); }
.faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.faq[open] .faq-body { grid-template-rows: 1fr; }
.faq-body > div { overflow: hidden; }

/* dialog: centred card on desktop, drag-to-close bottom sheet on phones */
.sheet { padding: 0; margin: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; color: inherit; overflow: hidden; }
.sheet::backdrop { background: transparent; }
.sheet-scrim { background: rgb(var(--c-ink) / .55); }
@media (max-width: 639px) { .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; border-radius: var(--radius-card) var(--radius-card) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); } }
@media (min-width: 640px) { .sheet-panel { position: absolute; left: 50%; top: 50%; width: min(600px, calc(100vw - 48px)); max-height: min(800px, calc(100dvh - 48px)); border-radius: var(--radius-card); translate: -50% -50%; } }
.grab { touch-action: none; cursor: grab; }
.steps { position: relative; }
.step { position: absolute; inset: 0 0 auto 0; opacity: 0; visibility: hidden; transform: translateX(32px); pointer-events: none; transition: opacity .2s ease, transform .6s var(--ease-spring), visibility 0s linear .2s; }
.step.is-past { transform: translateX(-32px); }
.step.is-active { position: relative; opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .3s ease .05s, transform .6s var(--ease-spring), visibility 0s; }
.progress-fill { transform-origin: left; transition: transform .7s var(--ease-spring); }
.opt { transition: background-color .2s, box-shadow .2s, transform .35s var(--ease-spring); box-shadow: inset 0 0 0 1.5px rgb(var(--c-ink) / .12); border-radius: var(--radius-field); }
.opt:active { transform: scale(.97); }
.opt:has(input:checked) { background: rgb(var(--c-accent-soft)); box-shadow: inset 0 0 0 2px rgb(var(--c-accent)); }
.opt:has(input:focus-visible) { outline: 3px solid rgb(var(--c-accent)); outline-offset: 2px; }
.field { border-radius: var(--radius-field); box-shadow: inset 0 0 0 1.5px rgb(var(--c-ink) / .15); background: rgb(var(--c-surface)); transition: box-shadow .2s; }
.field:focus { outline: none; box-shadow: inset 0 0 0 2px rgb(var(--c-ink)); }
.field[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #C62828; }
.error { color: #C62828; font-weight: 700; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake .4s ease; }

/* phone action bar */
.mab { transform: translateY(140%); transition: transform .6s var(--ease-spring); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.mab.is-shown { transform: none; }
body.modal-open .mab { transform: translateY(140%); }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
/* Lenis does the smoothing: CSS smooth scrolling under it throws off ScrollTrigger whenever it re-measures mid-page */
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
