/* Larchwood Mikveh — booking + manage pages.
   Builds on ../css/styles.css (variables, header, footer, buttons). Mobile-first. */

.mk-page [hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mk-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--paper); color: var(--ink);
  padding: .7rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
}
.mk-skip:focus { top: 12px; }
.mk-page :focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.mk-page [tabindex="-1"]:focus { outline: none; }
.mk-page h1, .mk-page h2, .mk-page h3, .mk-page h4, .mk-done-when, .mk-when { font-variant-numeric: lining-nums; }
.mk-page .nav a[aria-current="page"]::after { right: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-copper:disabled:hover { background: var(--copper); }
.btn-outline:disabled:hover { background: transparent; color: var(--ink); }
.btn-danger { background: #9a3d2c; color: #fff; }
.btn-danger:hover { background: #7f3123; }

/* ---------- Hero ---------- */
.mk-hero {
  background: var(--night); color: #d9cfc2; position: relative; overflow: hidden;
  padding: calc(var(--header-h) + 20px) 0 56px;
}
.mk-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(900px 500px at 85% 20%, rgba(201,154,114,.14), transparent 65%);
}
.mk-hero-grid { position: relative; display: grid; gap: 32px; }
.mk-hero-media { margin: 0; position: relative; isolation: isolate; }
.mk-hero-media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; border-radius: var(--radius); }
.mk-hero h1 { color: #fff; font-size: clamp(2.9rem, 7vw, 5.4rem); font-weight: 400; letter-spacing: -.02em; line-height: .95; margin-bottom: .35em; }
.mk-hero h1 em { font-style: italic; color: #f3e6d8; }
.mk-hero-lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: #e9e1d6; max-width: 34em; margin-bottom: 1.25rem; }
.mk-details { margin-top: 1rem; }
.mk-details li { align-items: baseline; }
.mk-detail-text { margin: 0; color: #d9cfc2; }
.mk-hero .btn-row { margin-top: 1.75rem; }
@media (max-width: 479px) { .mk-hero .btn-row .btn { flex: 1 1 100%; } }

@media (min-width: 900px) {
  .mk-hero { padding: calc(var(--header-h) + 48px) 0 88px; }
  .mk-hero-grid { grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
  .mk-hero-media { order: 2; }
  .mk-hero-media img { aspect-ratio: 5 / 4; }
  .mk-hero-media::after {
    content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
    border: 1px solid rgba(201,154,114,.45); border-radius: var(--radius);
  }
  .mk-details li { grid-template-columns: 130px 1fr; }
}

/* ---------- Booking section ---------- */
.mk-book { background: var(--ivory); padding: clamp(56px, 9vw, 112px) 0 clamp(64px, 10vw, 128px); }
.mk-book .container { width: min(1040px, 100% - 40px); }
.mk-book-head { max-width: 680px; margin-bottom: clamp(24px, 4vw, 40px); }
.mk-book-head h2 { margin-bottom: .3em; }
.mk-book-head .section-sub { margin-bottom: .75rem; }
.mk-notice {
  margin: 0; padding: .85rem 1rem .85rem 1.1rem; border-left: 2px solid var(--copper);
  background: rgba(165,104,60,.07); color: var(--ink); font-size: .95rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.mk-notice a { white-space: nowrap; }

.mk-widget {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
  padding: 20px 18px 24px;
}
@media (min-width: 640px) { .mk-widget { padding: 28px 32px 32px; } }
@media (min-width: 900px) { .mk-widget { padding: 36px 44px 40px; } }

/* progress */
.mk-steps {
  list-style: none; margin: 0 0 24px; padding: 0 0 18px; display: flex; gap: 6px; border-bottom: 1px solid var(--line);
  counter-reset: none;
}
.mk-steps li { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: .82rem; font-weight: 600; }
.mk-steps li.is-current { flex: 0 0 auto; }
.mk-steps li + li::before { content: ""; flex: 1 1 12px; min-width: 8px; height: 1px; background: var(--stone-2); margin-right: 2px; }
.mk-step-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--stone-2); font-size: .78rem; background: var(--paper); transition: all .25s;
}
.mk-step-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.mk-steps li.is-current { color: var(--ink); }
.mk-steps li.is-current .mk-step-num { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.mk-steps li.is-current .mk-step-name { display: inline; }
.mk-steps li.is-done { color: var(--copper-dk); }
.mk-steps li.is-done .mk-step-num { background: rgba(165,104,60,.1); border-color: var(--copper-lt); color: var(--copper-dk); }
@media (min-width: 640px) {
  .mk-step-name { display: inline; }
  .mk-steps { gap: 10px; }
  .mk-steps li, .mk-steps li.is-current { flex: 1 1 0; }
  .mk-steps li + li::before { flex: 0 0 24px; }
}

.mk-panel-title { font-size: clamp(1.7rem, 3.2vw, 2.15rem); margin-bottom: 1.1rem; outline: none; scroll-margin-top: calc(var(--header-h) + 24px); }
.mk-panel h3.mk-panel-title:focus-visible { outline: none; }
.mk-loading { color: var(--muted); padding: 1.5rem 0; }
.mk-loading.is-error { color: #8a3324; }
.mk-loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px;
  border: 2px solid var(--stone-2); border-top-color: var(--copper); border-radius: 50%; animation: mkSpin .8s linear infinite;
}
.mk-loading.is-error::before { display: none; }
@keyframes mkSpin { to { transform: rotate(360deg); } }

.mk-error, .mk-field-error { color: #8a3324; }
.mk-error {
  margin: 0 0 1rem; padding: .8rem 1rem; background: #f8ebe6; border: 1px solid #e7c8bd; border-radius: var(--radius);
  font-size: .95rem; outline: none; scroll-margin-top: calc(var(--header-h) + 24px);
}
.mk-success {
  margin: 0 0 1.25rem; padding: .8rem 1rem; background: #eef2e8; border: 1px solid #cfdcc0; border-radius: var(--radius);
  color: #3b4f2a; font-size: .95rem;
}
.mk-callout {
  margin: 1.25rem 0 0; padding: 1rem 1.1rem; background: var(--ivory); border: 1px solid var(--line);
  border-left: 2px solid var(--copper); border-radius: var(--radius); color: var(--ink);
}
.mk-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.mk-actions-split { justify-content: space-between; }
.mk-actions .btn { min-width: 128px; }
@media (max-width: 479px) {
  .mk-actions .btn { flex: 1; min-width: 0; padding-inline: 1rem; }
}

.mk-recap { margin: -4px 0 14px; }
.mk-recap p {
  margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: .65rem .9rem; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .9rem; color: var(--ink);
}
.mk-dot { margin: 0 .45rem; color: var(--copper-lt); }
.mk-link {
  background: none; border: 0; padding: .25rem 0; font: 600 .88rem var(--sans); color: var(--copper-dk);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; flex-shrink: 0;
}
.mk-link:hover { color: var(--copper); }

/* ---------- Step 1: appointment types ---------- */
.mk-types { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .mk-types { grid-template-columns: 1fr 1fr; gap: 16px; } }
.mk-type {
  position: relative; display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
  padding: 20px 20px 18px; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.mk-type:hover { border-color: var(--copper-lt); }
.mk-type input, .mk-addon input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mk-type-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mk-type-sub { font-size: .85rem; color: var(--muted); }
.mk-type-title { font-family: var(--serif); font-size: 1.65rem; line-height: 1.15; color: var(--ink); font-weight: 500; }
.mk-type-desc { font-size: .9rem; margin-top: .3rem; }
.mk-type-meta { display: flex; gap: 10px; margin-top: .85rem; }
.mk-type-meta span {
  font-size: .85rem; font-weight: 600; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem;
}
.mk-type-check {
  flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--stone-2); background: var(--paper);
  margin-top: 4px; position: relative; transition: all .2s;
}
.mk-type:has(input:checked) { border-color: var(--copper); background: #fbf6f0; box-shadow: 0 0 0 1px var(--copper) inset; }
.mk-type:has(input:checked) .mk-type-check { border-color: var(--copper); background: var(--copper); }
.mk-type:has(input:checked) .mk-type-check::after {
  content: ""; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mk-type:has(input:focus-visible), .mk-addon:has(input:focus-visible) { outline: 2px solid var(--copper); outline-offset: 2px; }

.mk-addon {
  position: relative; display: flex; align-items: center; gap: 14px; margin-top: 16px; cursor: pointer;
  padding: 16px 20px; border: 1px dashed var(--copper-lt); border-radius: var(--radius); background: var(--paper);
  transition: border-color .2s, background .2s;
}
.mk-addon:hover { border-style: solid; }
.mk-addon-box {
  flex: 0 0 22px; height: 22px; border: 1.5px solid var(--stone-2); border-radius: 3px; background: #fff; position: relative; transition: all .2s;
}
.mk-addon-text { display: flex; flex-direction: column; line-height: 1.35; }
.mk-addon-text strong { color: var(--ink); font-weight: 600; }
.mk-addon-text span { font-size: .87rem; color: var(--muted); }
.mk-addon:has(input:checked) { border-style: solid; border-color: var(--copper); background: #fbf6f0; }
.mk-addon:has(input:checked) .mk-addon-box { background: var(--copper); border-color: var(--copper); }
.mk-addon:has(input:checked) .mk-addon-box::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------- Step 2: calendar + slots ---------- */
.mk-picker { display: grid; gap: 28px; }
@media (min-width: 900px) {
  .mk-picker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
  .mk-cal { padding-right: 36px; border-right: 1px solid var(--line); }
  .mk-slots { padding-left: 36px; }
}
.mk-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mk-cal-title { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; color: var(--ink); margin: 0; text-align: center; flex: 1; }
.mk-cal-nav {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: all .2s;
}
.mk-cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mk-cal-nav:hover:not(:disabled) { border-color: var(--copper); color: var(--copper-dk); }
.mk-cal-nav:disabled { opacity: .3; cursor: default; }
.mk-cal-table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.mk-cal-table th { font-size: .75rem; font-weight: 600; color: var(--muted); padding: 6px 0; text-align: center; }
.mk-cal-table abbr { text-decoration: none; cursor: default; }
.mk-cal-table td { padding: 0; text-align: center; }
.mk-day {
  position: relative; display: grid; place-items: center; width: 100%; max-width: 48px; aspect-ratio: 1; min-height: 40px;
  margin: 0 auto; border-radius: 50%; font: 500 .95rem/1 var(--sans); border: 1px solid transparent; background: none;
}
.mk-day.is-off { color: var(--muted); opacity: .45; }
.mk-day.is-open {
  cursor: pointer; color: var(--ink); font-weight: 700; background: rgba(165,104,60,.09); transition: all .15s;
}
.mk-day.is-open:hover { border-color: var(--copper); background: rgba(165,104,60,.14); }
.mk-day.is-selected, .mk-day.is-selected:hover { background: var(--copper); border-color: var(--copper); color: #fff; }
.mk-day.is-today::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor;
}
.mk-day.is-today.is-open::after { background: var(--copper); }
.mk-day.is-selected::after { background: #fff !important; }
.mk-day.is-marked { box-shadow: 0 0 0 1.5px var(--ink) inset; }
.mk-cal.is-loading tbody { opacity: .35; }
.mk-cal.is-loading .mk-cal-table { background: linear-gradient(90deg, transparent, rgba(165,104,60,.06), transparent) 0 0 / 200% 100%; animation: mkShimmer 1.2s linear infinite; }
@keyframes mkShimmer { to { background-position: -200% 0; } }
.mk-cal-msg { margin: 10px 0 0; font-size: .92rem; color: var(--muted); text-align: center; }

.mk-slots-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; min-height: 44px; }
.mk-slots-title { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; color: var(--ink); margin: 0; outline: none; scroll-margin-top: calc(var(--header-h) + 24px); }
.mk-sunset { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .88rem; color: var(--copper-dk); font-weight: 600; }
.mk-sunset svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mk-slot-note { margin: -4px 0 12px; font-size: .9rem; color: var(--ink); background: var(--ivory); padding: .5rem .75rem; border-radius: var(--radius); }
.mk-slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 480px) { .mk-slot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .mk-slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .mk-slot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-slot {
  min-height: 46px; padding: .6rem .25rem; border: 1px solid var(--stone-2); border-radius: var(--radius); background: #fff;
  font: 600 .93rem/1 var(--sans); color: var(--ink); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mk-slot:hover { border-color: var(--copper); color: var(--copper-dk); }
.mk-slot.is-selected, .mk-slot.is-selected:hover { background: var(--copper); border-color: var(--copper); color: #fff; }
.mk-slots-empty { margin: 0; color: var(--muted); font-size: .95rem; }
.mk-slots:not(.has-date) .mk-slots-empty { padding: 1.2rem; border: 1px dashed var(--stone-2); border-radius: var(--radius); text-align: center; }
.mk-slots.is-loading .mk-slots-empty::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 9px; vertical-align: -2px;
  border: 2px solid var(--stone-2); border-top-color: var(--copper); border-radius: 50%; animation: mkSpin .8s linear infinite;
}

/* ---------- Step 3: details ---------- */
.mk-details-grid { display: grid; gap: 24px; }
.mk-details-grid .mk-summary { order: -1; }
@media (min-width: 900px) {
  .mk-details-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .mk-details-grid .mk-summary { order: 0; position: sticky; top: calc(var(--header-h) + 20px); }
}
.mk-form { margin: 0; }
.mk-field { margin-bottom: 18px; }
.mk-field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.mk-optional { font-weight: 400; color: var(--muted); }
.mk-field input, .mk-field textarea {
  width: 100%; font: 500 1rem var(--sans); color: var(--ink); background: #fff;
  border: 1px solid var(--stone-2); border-radius: var(--radius); padding: .85rem 1rem; transition: border-color .2s, box-shadow .2s;
}
.mk-field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.mk-field input:focus, .mk-field textarea:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(165,104,60,.15); }
.mk-field input[aria-invalid="true"] { border-color: #b4553f; }
.mk-hint { margin: 6px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.mk-field-error { margin: 6px 0 0; font-size: .86rem; font-weight: 600; }
.mk-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mk-summary { background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.mk-summary h4 { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; color: var(--ink); margin: 0 0 .5rem; }
.mk-summary dl, .mk-done-list { margin: 0; }
.mk-summary dl div, .mk-done-list div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: .65rem 0; border-top: 1px solid var(--line); }
.mk-summary dt, .mk-done-list dt { font-size: .82rem; color: var(--muted); font-weight: 600; padding-top: .12em; }
.mk-summary dd, .mk-done-list dd { margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.mk-private { margin: .9rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); line-height: 1.45; }

/* ---------- Step 4: confirmation ---------- */
.mk-done { max-width: 640px; }
.mk-done .mk-panel-title { margin-bottom: .5rem; }
.mk-done-mark { width: 52px; height: 52px; margin-bottom: 14px; }
.mk-done-mark svg { width: 100%; height: 100%; fill: none; stroke: var(--copper); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mk-done-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: mkDraw .6s .15s ease forwards; }
@keyframes mkDraw { to { stroke-dashoffset: 0; } }
.mk-done-when, .mk-when { font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.2rem); color: var(--ink); line-height: 1.15; margin: 0 0 1.25rem; }
.mk-done-when span, .mk-when span { display: block; color: var(--copper-dk); font-size: .8em; margin-top: .15em; }
.mk-done-note { margin: 1.25rem 0 0; font-size: .95rem; }
.mk-done-actions { margin-top: 1.5rem; }
.mk-done-small { margin: 1rem 0 0; font-size: .84rem; color: var(--muted); }
.mk-widget.is-complete .mk-steps li .mk-step-num { background: rgba(165,104,60,.1); }
.mk-widget[data-current="4"] .mk-steps li.is-current .mk-step-num { background: var(--copper); border-color: var(--copper); color: #fff; }

@media (max-width: 479px) {
  .mk-done-actions .btn, .mk-page-manage .btn-row .btn { flex: 1 1 100%; }
  .mk-summary dl div, .mk-done-list div { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Manage page ---------- */
.mk-manage { background: var(--ivory); padding: calc(var(--header-h) + clamp(32px, 6vw, 64px)) 0 clamp(64px, 10vw, 112px); min-height: 70vh; }
.mk-manage-inner { width: min(860px, 100% - 40px); }
.mk-manage-head { margin-bottom: clamp(20px, 3vw, 32px); }
.mk-manage-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin-bottom: .1em; }
.mk-manage-head .section-sub { margin: 0; }
.mk-when-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.mk-when-row .mk-when { margin-bottom: 1rem; }
.mk-status {
  margin: .35rem 0 0; font-size: .82rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px;
  background: #eef2e8; color: #3b4f2a; border: 1px solid #cfdcc0; white-space: nowrap;
}
.mk-status.is-cancelled { background: #f4ece9; color: #8a3324; border-color: #e7c8bd; }
.mk-status.is-completed, .mk-status.is-no_show { background: var(--stone); color: var(--ink-2); border-color: var(--stone-2); }
#mg-view.is-cancelled .mk-when { color: var(--muted); }
#mg-view.is-cancelled .mk-when span { color: var(--muted); text-decoration: line-through; }
#mg-list { margin-bottom: 1.25rem; }
#mg-actions { margin-top: 1.5rem; }
.mk-confirm, .mk-resched { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.mk-confirm h3, .mk-resched h3 { font-size: 1.7rem; outline: none; scroll-margin-top: calc(var(--header-h) + 24px); }
.mk-confirm { background: #fbf4f1; border: 1px solid #ecd3ca; border-radius: var(--radius); padding: 20px 22px; }
.mk-confirm .btn-row { margin-top: 1.25rem; }
.mk-manage-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.mk-manage-foot p { margin: 0; }
#mg-missing .mk-panel-title { outline: none; }
