/* ============================================================
   Klipphörnan Studio – Booking demo
   Clean Scandinavian SaaS style
   ============================================================ */

:root {
  /* Surfaces */
  --bg:          #f7f3ec;          /* warm off-white */
  --bg-2:        #ffffff;
  --card:        #ffffff;
  --line:        #e8e0d2;
  --line-2:      #efe7d8;

  /* Ink */
  --ink:         #1f1b16;
  --ink-2:       #4a4339;
  --ink-3:       #8a8174;

  /* Accent — calm teal */
  --accent:      oklch(0.58 0.07 195);
  --accent-2:    oklch(0.52 0.08 195);
  --accent-soft: oklch(0.95 0.02 195);
  --accent-ink:  oklch(0.30 0.05 195);

  /* Status */
  --ok:          oklch(0.62 0.10 155);
  --ok-soft:     oklch(0.95 0.03 155);
  --warn:        oklch(0.66 0.13 55);
  --bad:         oklch(0.60 0.14 25);
  --bad-soft:    oklch(0.95 0.03 25);

  /* Shape */
  --r-xs:        6px;
  --r-sm:        10px;
  --r-md:        14px;
  --r-lg:        20px;
  --r-xl:        28px;

  --shadow-sm:   0 1px 2px rgba(31, 27, 22, 0.05);
  --shadow-md:   0 4px 16px -6px rgba(31, 27, 22, 0.10),
                 0 1px 2px rgba(31, 27, 22, 0.04);
  --shadow-lg:   0 24px 60px -28px rgba(31, 27, 22, 0.25);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }
input  { font-family: inherit; }

/* Subtle texture / vignette */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 600px at 100% -10%, oklch(0.95 0.03 195 / .35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, oklch(0.93 0.04 60 / .25), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Page shell ===== */
.page {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background:
    conic-gradient(from 210deg at 50% 50%,
      oklch(0.58 0.07 195) 0deg, oklch(0.72 0.06 195) 120deg,
      oklch(0.58 0.07 195) 240deg, oklch(0.45 0.08 195) 360deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), var(--shadow-sm);
  position: relative;
}
.brand__mark::after {
  content: "";
  position: absolute; inset: 11px;
  border-radius: 50%;
  background: var(--bg);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 700; letter-spacing: -0.01em; }
.brand__tag { font-size: 12.5px; color: var(--ink-3); }

.header__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.header__meta a {
  text-decoration: none;
}

.header__meta a span {
  text-decoration: none;
  color: #000;
  transition: color 0.18s ease;
}

.header__meta a:hover span {
  color: #0f766e;
}


.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.dot--live { background: var(--ok); box-shadow: 0 0 0 4px oklch(0.62 0.10 155 / .15); }

.page__footer {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 0 4px;
}

/* ===== Stepper ===== */
.stepper { margin-bottom: 20px; }
.stepper ol {
  list-style: none;
  margin: 0; padding: 8px;
  display: flex; gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.step {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.step__num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.step.is-active {
  background: oklch(0.95 0.02 195);
  color: var(--accent-ink);
}
.step.is-active .step__num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.step.is-done .step__num {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.step.is-done { color: var(--ink-2); }

/* ===== Cards / panels ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.panel { padding: 32px; }
.panel.is-hidden { display: none; }
.panel--center { text-align: center; }

.panel__head { margin-bottom: 24px; }
.panel__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel__sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

.panel__actions {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.panel__actions--center { justify-content: center; }

/* ===== Buttons ===== */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, background .15s, border-color .15s, box-shadow .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .5; }

.btn--primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) { background: #000; }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--ink);
}

.iconbtn {
  appearance: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s;
}
.iconbtn:hover { background: var(--bg); color: var(--ink); border-color: var(--ink-3); }

/* ===== Services (step 1) ===== */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.service {
  position: relative;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .08s;
  display: flex; flex-direction: column; gap: 10px;
}
.service:hover { border-color: var(--ink-3); }
.service[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px oklch(0.58 0.07 195 / .12);
}
.service__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.service__name { font-weight: 600; letter-spacing: -0.005em; }
.service__price {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.service__meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.service__pill {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.service[aria-checked="true"] .service__pill {
  background: white;
  border-color: oklch(0.58 0.07 195 / .3);
  color: var(--accent-ink);
}
.service__radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-grid; place-items: center;
  flex-shrink: 0;
}
.service[aria-checked="true"] .service__radio {
  border-color: var(--accent);
  background: var(--accent);
}
.service[aria-checked="true"] .service__radio::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
}

/* ===== Schedule (step 2) ===== */
.schedule {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Calendar */
.calendar {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.calendar__nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.calendar__title {
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}
.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 0 2px 8px;
}
.calendar__weekdays span {
  text-align: center;
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.day {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.day:hover:not(:disabled):not(.day--full) { background: var(--bg); border-color: var(--line); }
.day:disabled, .day.day--past, .day.day--outside {
  color: oklch(0.78 0.01 80);
  cursor: not-allowed;
}
.day.day--outside { opacity: .35; }
.day.day--available::after {
  content: "";
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.day.day--full {
  background: var(--bad-soft);
  color: oklch(0.45 0.08 25);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: oklch(0.60 0.14 25 / .5);
}
.day.day--today {
  border-color: var(--ink);
}
.day.is-selected,
.day.is-selected:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.day.is-selected.day--available::after { background: white; }

/* Legend */
.legend {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 2px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend__swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  position: relative;
}
.legend__swatch--available::after {
  content: "";
  position: absolute; inset: 0;
  margin: auto; width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.legend__swatch--full {
  background: var(--bad-soft);
  border-color: oklch(0.60 0.14 25 / .25);
}
.legend__swatch--unavail {
  background: var(--bg);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 3px,
    oklch(0.85 0.01 80) 3px 4px
  );
}

/* Slots */
.slots {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.slots__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.slots__label { font-weight: 600; letter-spacing: -0.01em; }
.slots__date { font-size: 13px; color: var(--ink-3); }
.slots__body { flex: 1; }
.slots__hint, .slots__notice {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0;
  padding: 32px 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}
.slots__notice {
  color: oklch(0.45 0.08 25);
  background: var(--bad-soft);
  border-color: oklch(0.60 0.14 25 / .2);
  border-style: solid;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.slot {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, transform .08s;
  display: flex; align-items: center; justify-content: space-between;
}
.slot:hover:not(:disabled) {
  border-color: var(--ink);
}
.slot.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.slot:disabled {
  cursor: not-allowed;
  background: var(--bg);
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.slot__tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-3);
  border: 1px solid var(--line);
  text-decoration: none;
}
.slot.is-selected .slot__tag {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.85);
  border-color: transparent;
}

/* ===== Form (step 3) ===== */
.form { display: flex; flex-direction: column; gap: 18px; }
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.field__opt {
  font-weight: 400;
  color: var(--ink-3);
}
.field__input {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field__input::placeholder { color: oklch(0.75 0.01 80); }
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 4px oklch(0.58 0.07 195 / .15);
}
.field__input.is-invalid {
  border-color: var(--bad);
  background: oklch(0.97 0.01 25);
}
.field__error {
  font-size: 12.5px;
  color: var(--bad);
  min-height: 1em;
}

.summary {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.summary__row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px;
}
.summary__key { color: var(--ink-3); }
.summary__val { font-weight: 600; color: var(--ink); }
.summary__row--total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
}

.consent {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  align-items: flex-start;
  line-height: 1.5;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.consent input {
  width: 18px; height: 18px;
  accent-color: oklch(0.58 0.07 195);
  margin-top: 1px;
  flex-shrink: 0;
}

/* ===== Confirmation (step 4) ===== */
.panel--center .panel__title { margin-top: 4px; }
.panel--center .panel__sub { max-width: 480px; margin: 0 auto 24px; }

.check {
  display: grid; place-items: center;
  margin: 8px auto 18px;
}
.check__ring {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--ok-soft);
  display: grid; place-items: center;
  position: relative;
  animation: pop .4s ease both;
}
.check__mark {
  width: 22px; height: 12px;
  border-left: 3px solid var(--ok);
  border-bottom: 3px solid var(--ok);
  transform: rotate(-45deg) translate(2px, -2px);
}
@keyframes pop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.receipt {
  margin: 22px auto 0;
  max-width: 460px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.receipt__row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px;
  gap: 16px;
}
.receipt__row span { color: var(--ink-3); }
.receipt__row strong { font-weight: 600; text-align: right; }

.payload {
  margin: 18px auto 0;
  max-width: 460px;
  text-align: left;
  font-size: 13px;
}
.payload summary {
  cursor: pointer;
  color: var(--ink-2);
  padding: 8px 0;
  user-select: none;
}
.payload pre {
  background: #16130f;
  color: #d4cfc4;
  padding: 14px 16px;
  border-radius: var(--r-md);
  overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .schedule { grid-template-columns: 1fr; gap: 18px; }
  .slots { min-height: auto; }
}
@media (max-width: 640px) {
  .page { padding: 20px 14px 40px; }
  .panel { padding: 22px 18px; }
  .panel__title { font-size: 22px; }
  .form__row { grid-template-columns: 1fr; }
  .stepper ol { padding: 6px; }
  .step { padding: 8px 10px; font-size: 13px; }
  .step__label { display: none; }
  .step.is-active .step__label { display: inline; }
  .services { grid-template-columns: 1fr; }
  .header__meta { display: none; }
  .panel__actions { flex-direction: column-reverse; }
  .panel__actions .btn { width: 100%; }
}
