/* Cardinal Star Healing — public site
 *
 * Colors, fonts and corner radius arrive as CSS variables printed by the
 * theme (Admin > Branding). Nothing here hard-codes a brand color, so a
 * theme change restyles every page at once.
 */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; width: 100%; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
h1:focus, h2:focus, h3:focus { outline: none; }

.wrap { width: 100%; max-width: 66rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.icon { flex: none; }

.skip { position: absolute; left: -999px; top: 0; z-index: 10; background: var(--surface); color: var(--ink); padding: 0.6rem 1rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Header and footer ---------- */

.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; text-decoration: none; }
.brand-logo { display: block; height: 3rem; width: auto; max-width: 11rem; object-fit: contain; flex: none; }
.brand-logo.on-plate { background: #fff; border-radius: 8px; padding: 0.25rem 0.4rem; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; font-weight: 500; }
.head-link { flex: none; font-weight: 700; text-decoration: none; white-space: nowrap; padding: 0.5rem 0.1rem; border-bottom: 2px solid var(--primary); }
.head-link:hover { color: var(--primary); }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.95rem; padding: 1.25rem 0; }
.site-foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; }
.site-foot p { margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.65rem 1.25rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--surface); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-block { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 0.4rem 0; cursor: pointer; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em;
}
.link-btn:hover { text-decoration-color: currentColor; }

/* ---------- Panels ---------- */

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.6); }
.sheet-head { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.5rem; }
.empty { padding: 1.5rem 1.25rem; margin: 0; color: var(--muted); }

.notice { margin: 0 0 1.25rem; padding: 0.85rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); }
.notice.is-error { border-color: var(--danger); color: var(--danger); background: var(--surface); font-weight: 500; }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Home ---------- */

.hero { padding: 2.25rem 0 1.75rem; }
.hero-star { display: block; width: 1.75rem; height: 1.75rem; margin-bottom: 1rem; fill: var(--accent); }
.hero h1 { font-size: clamp(2.25rem, 8vw, 3.5rem); letter-spacing: -0.01em; max-width: 16ch; }
.hero-lead { max-width: 38rem; margin: 1rem 0 0; font-size: 1.2rem; color: var(--muted); }
.home-list { padding-bottom: 3rem; }

/* ---------- Service list ---------- */

.svc-list { list-style: none; margin: 0; padding: 0; }
.svc { display: flex; flex-direction: column; gap: 1rem; padding: 1.35rem 1.25rem; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc-name { font-size: 1.45rem; }
.svc-desc { max-width: 60ch; margin: 0.4rem 0 0; color: var(--muted); }
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.75rem 0 0; padding: 0; font-weight: 500; }
.meta li { display: flex; align-items: center; gap: 0.4rem; }
.meta .icon { color: var(--muted); }

/* ---------- Booking flow ---------- */

.book-page { padding-top: 1.25rem; padding-bottom: 3rem; }
.page-title { font-size: clamp(1.9rem, 6vw, 2.5rem); margin: 0.75rem 0 1.25rem; }
.back { display: inline-flex; align-items: center; gap: 0.3rem; margin-bottom: 0.9rem; color: var(--muted); font-weight: 500; text-decoration: none; }
.back:hover { color: var(--ink); }

.book { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.book-summary { padding: 1.4rem 1.25rem; border-bottom: 1px solid var(--line); }
.book-summary h1 { font-size: 1.85rem; }
.book-summary .svc-desc { margin-top: 0.8rem; }
.book-summary .moving { margin: 0.9rem 0 0; color: var(--muted); }
.book-summary .moving strong { display: block; color: var(--ink); font-weight: 500; }
.book-step { min-width: 0; padding: 1.4rem 1.25rem 1.6rem; }
.step-title { font-size: 1.4rem; margin-bottom: 1rem; }

.pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.pick > * { min-width: 0; }

.cal { max-width: 24rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.cal-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; }
.cal-nav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: transparent; cursor: pointer;
}
.cal-nav:hover:not([disabled]) { border-color: var(--ink); }
.cal-nav[disabled] { opacity: 0.3; cursor: default; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow span { padding: 0.3rem 0; text-align: center; font-size: 0.85rem; color: var(--muted); }
.cal-grid { min-height: 15rem; align-content: start; }

.day {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 1.05rem; font-variant-numeric: lining-nums tabular-nums;
}
.day[disabled] { opacity: 0.55; }
.day.is-blank { visibility: hidden; }
.day.is-open { color: var(--ink); font-weight: 700; cursor: pointer; }
.day.is-open .num { transform: translateY(-14%); }
@media (hover: hover) {
  .day.is-open:hover { background: var(--primary-soft); }
  .time:hover { background: var(--primary); color: var(--on-primary); }
}
.day .star { position: absolute; bottom: 13%; left: 50%; width: 0.5rem; height: 0.5rem; margin-left: -0.25rem; fill: var(--accent); }
.day.is-today .num { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
.day.is-picked, .day.is-picked:hover { background: var(--primary); color: var(--on-primary); }
.day.is-picked .star { fill: var(--on-primary); }

.cal-legend { display: flex; align-items: center; gap: 0.45rem; margin: 0.75rem 0 0; color: var(--muted); font-size: 0.95rem; }
.cal-legend .star { width: 0.6rem; height: 0.6rem; fill: var(--accent); flex: none; }
.status { min-height: 1.55em; margin: 0.6rem 0 0; color: var(--muted); }
.status.is-error { color: var(--danger); font-weight: 500; }

.tz { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; color: var(--muted); font-size: 0.95rem; }
.tz label { display: inline-flex; align-items: center; gap: 0.4rem; }
.tz select {
  width: 100%; max-width: 24rem; min-height: 2.6rem; padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}

.times h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.times-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.time {
  min-height: 3rem; border: 1.5px solid var(--primary); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer;
  font-variant-numeric: lining-nums tabular-nums;
}
.time:active { background: var(--primary); color: var(--on-primary); }

.chosen { display: flex; align-items: flex-start; gap: 0.7rem; margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.chosen .star { width: 1.1rem; height: 1.1rem; margin-top: 0.3rem; fill: var(--accent); flex: none; }
.chosen-text { flex: 1; min-width: 0; }
.chosen-when { display: block; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; font-weight: 500; text-wrap: balance; }
.chosen .hint { display: block; margin-top: 0.15rem; font-size: 0.95rem; color: var(--muted); }

/* ---------- Forms ---------- */

.field { margin-bottom: 1.1rem; }
.field > label, .field > .label { display: block; margin-bottom: 0.35rem; font-weight: 700; }
.field .opt { font-weight: 400; color: var(--muted); }
.field .hint { display: block; margin-top: 0.3rem; font-size: 0.95rem; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field select, .field textarea {
  width: 100%; min-height: 3rem; padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 1.0625rem;
}
.field textarea { min-height: 6.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--primary-soft); outline-offset: 0; border-color: var(--primary); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 0.65rem; font-weight: 500; }
.check input { flex: none; width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; accent-color: var(--primary); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { margin: 0.9rem 0 0; font-size: 0.95rem; color: var(--muted); }

/* ---------- Booking page (confirmation, reschedule, cancel) ---------- */

.confirm { max-width: 40rem; margin: 0 auto; padding: 2rem 0 3rem; }
.confirm-head { display: flex; align-items: flex-start; gap: 0.9rem; margin-bottom: 1.1rem; }
.confirm-head .star { width: 2rem; height: 2rem; margin-top: 0.3rem; fill: var(--accent); flex: none; }
.confirm h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
.confirm-lead { margin: 0.5rem 0 0; color: var(--muted); }
.confirm .sheet { padding: 0.4rem 1.25rem 1.4rem; }
.details { margin: 0; }
.details > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.actions .btn { flex: 1 1 14rem; }
.change { margin-top: 1.5rem; }
.change h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.change p { color: var(--muted); }
.cancel-box { margin-top: 0.9rem; }
.cancel-box summary { cursor: pointer; font-weight: 500; padding: 0.4rem 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; }
.cancel-box form { margin-top: 0.75rem; }

@keyframes csh-twinkle {
  0% { transform: scale(0.2) rotate(-40deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.is-new .confirm-head .star { animation: csh-twinkle 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .is-new .confirm-head .star { animation: none; }
}

/* ---------- Wider screens ---------- */

@media (min-width: 30rem) {
  .times-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand-name { font-size: 1.3rem; }
}

@media (min-width: 44rem) {
  .wrap { padding-left: 2rem; padding-right: 2rem; }
  .hero { padding: 3.5rem 0 2.25rem; }
  .svc { flex-direction: row; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.5rem 1.75rem; }
  .svc-cta { flex: none; }
  .sheet-head { padding: 1.25rem 1.75rem; }
  .empty { padding: 1.75rem; }
  .confirm .sheet { padding: 0.6rem 1.75rem 1.75rem; }
  .details > div { grid-template-columns: 7rem minmax(0, 1fr); }
}

@media (min-width: 56rem) {
  .book { grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr); }
  .book-summary { padding: 2rem 1.75rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .book-step { padding: 2rem 2rem 2.25rem; }
  .pick.has-day { grid-template-columns: minmax(0, 24rem) minmax(0, 13.5rem); align-items: start; }
  .times-list { grid-template-columns: minmax(0, 1fr); max-height: 25rem; overflow-y: auto; padding-right: 0.25rem; }
  .details-form { max-width: 32rem; }
}
