/* =========================================================================
   Haarschnitt-Termine — warm boutique booking UI
   Display: Fraunces · Body: Hanken Grotesk
   ========================================================================= */

:root {
  --paper: #f6efe4;
  --paper-2: #efe4d3;
  --surface: #fffdf8;
  --surface-2: #fbf5ea;

  --ink: #2a201a;
  --ink-soft: #6c5d50;
  --muted: #9d8c7c;
  --line: #e7dac6;
  --line-strong: #d8c7ad;

  --accent: #b8542f;
  --accent-deep: #8f3f20;
  --accent-soft: #f4ddcf;

  --sage: #5f7050;
  --sage-soft: #e3ead7;
  --gold: #b3852f;
  --danger: #b23b32;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --r-lg: 26px;
  --r: 16px;
  --r-sm: 11px;

  --shadow-sm: 0 1px 2px rgba(60, 40, 25, 0.06);
  --shadow: 0 14px 34px -18px rgba(72, 45, 25, 0.42);
  --shadow-lg: 0 30px 70px -28px rgba(60, 35, 18, 0.5);

  --wrap: 680px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -10%, #fff7 , transparent 60%),
    radial-gradient(90% 60% at 85% 0%, #f7e3d2aa, transparent 55%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.5;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle film grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 40px) clamp(18px, 5vw, 34px) 80px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(18px, 6vw, 46px) 0 clamp(20px, 5vw, 34px);
}
.mark {
  width: 38px;
  height: 38px;
  color: var(--accent);
  margin: 0 auto 18px;
  display: block;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
  margin-bottom: 16px;
}
.kicker::before,
.kicker::after {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: clamp(2.3rem, 8vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.hero .tagline {
  margin: 0 auto;
  max-width: 30ch;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

/* ---------- Day sections ---------- */
.day {
  margin-top: clamp(26px, 5vw, 40px);
  animation: fadeUp 0.6s both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.day-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.day-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: capitalize;
  white-space: nowrap;
}
.day-head .rel {
  color: var(--accent);
  font-style: italic;
}
.day-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.day-head .count {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

/* ---------- Slot chip ---------- */
.chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  border-radius: var(--r);
  padding: 13px 17px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-width: 116px;
}
.chip:hover {
  transform: translateY(-3px);
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip .t {
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.chip .d {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- States ---------- */
.loading {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 30px;
}
.skel {
  height: 58px;
  width: 122px;
  border-radius: var(--r);
  background: linear-gradient(100deg, var(--surface-2) 30%, #fff8ee 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite;
}
.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--ink-soft);
}
.empty svg { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 12px; }
.empty strong { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; color: var(--ink); margin-bottom: 4px; }

.notice {
  text-align: center;
  padding: 40px 20px;
  color: var(--danger);
}

/* ---------- Footer ---------- */
.foot {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.foot a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.foot a:hover { color: var(--accent); }

/* ---------- Demo banner ---------- */
.demo-banner {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 0.82rem;
  padding: 9px 16px;
  background: #f6e7c8;
  color: #6e5212;
  border-bottom: 1px solid #e7d3a6;
}
.demo-banner b { font-weight: 700; }

/* ---------- Sheet / modal ---------- */
.sheet-overlay { position: fixed; inset: 0; z-index: 40; }
.sheet-overlay[hidden] { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 26, 16, 0.42);
  backdrop-filter: blur(3px);
  animation: fade 0.25s both;
}
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 26px clamp(20px, 5vw, 30px) max(26px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  max-height: 92dvh;
  overflow-y: auto;
  animation: sheetUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.sheet-grip {
  width: 42px; height: 4px; border-radius: 99px;
  background: var(--line-strong);
  margin: -8px auto 18px;
}
@media (min-width: 640px) {
  .sheet-overlay { display: grid; place-items: center; padding: 24px; }
  .sheet-panel {
    position: relative;
    bottom: auto; left: auto; right: auto;
    width: 460px; max-width: 100%;
    border-radius: var(--r-lg);
    animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .sheet-grip { display: none; }
}

.sheet-head { margin-bottom: 20px; }
.sheet-head .eyebrow {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 600;
}
.sheet-head h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 6px 0 0;
}
.sheet-head .when { color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 0.76rem; color: var(--muted); margin-top: 5px; }

.form-error {
  background: #fbe6e2;
  color: var(--danger);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s, box-shadow 0.18s, background 0.18s, color 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff7ef;
  box-shadow: 0 10px 22px -10px var(--accent);
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-sm { padding: 8px 13px; font-size: 0.85rem; border-radius: 9px; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; padding: 8px 0 4px; }
.confirm .seal {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage);
  display: grid; place-items: center;
  margin: 0 auto 18px;
  animation: pop 0.45s cubic-bezier(0.22, 1.4, 0.4, 1) both;
}
.confirm .seal svg { width: 32px; height: 32px; }
.confirm h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.8rem; margin: 0 0 6px; }
.confirm p { color: var(--ink-soft); margin: 0 0 4px; }
.confirm .card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin: 18px 0;
  font-variant-numeric: tabular-nums;
}
.confirm .card .big { font-family: var(--font-display); font-size: 1.25rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 99px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-free { background: var(--sage-soft); color: var(--sage); }
.badge-booked { background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- Admin ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0; letter-spacing: -0.02em; }
.admin-head .sub { color: var(--ink-soft); font-size: 0.9rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 28px);
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 18px;
}
.grid2 { display: grid; gap: 14px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .span2 { grid-column: 1 / -1; } }

.login-wrap { max-width: 380px; margin: 8vh auto 0; }
.login-card { text-align: center; }
.login-card .lock {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.login-card .lock svg { width: 24px; height: 24px; }

.slot-row {
  display: flex; align-items: center; gap: 10px 12px;
  flex-wrap: wrap;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.slot-row:last-child { border-bottom: none; }
.slot-row .time { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 104px; }
.slot-row .info { flex: 1 1 150px; min-width: 150px; }
.slot-row .info .who { font-size: 0.9rem; color: var(--ink-soft); margin-top: 3px; word-break: break-word; }
.slot-row .info .who b { color: var(--ink); font-weight: 600; }
.slot-row .actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.admin-day { font-family: var(--font-display); font-size: 1.1rem; margin: 22px 0 4px; text-transform: capitalize; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s both;
  max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }
.toast.err { background: var(--danger); }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- Calendar-native: landing + booking page ---------- */
.wrap.narrow { max-width: 520px; }

.hero-mini { padding: 30px 0 6px; text-align: center; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; letter-spacing: -0.01em;
}
.mark-sm { width: 26px; height: 26px; margin: 0; color: var(--accent); }

.steps { list-style: none; margin: 4px 0 22px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 13px; color: var(--ink-soft); font-size: 1.02rem; }
.steps li span {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 700; font-size: 0.9rem; display: grid; place-items: center;
}
.steps li b { color: var(--ink); font-weight: 600; }

.embed-wrap {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface);
}
.embed-wrap iframe { display: block; width: 100%; height: 640px; }
@media (max-width: 640px) { .embed-wrap iframe { height: 520px; } }

.card-loading { color: var(--muted); text-align: center; padding: 30px 0; }
.lead { color: var(--ink-soft); margin: 0 0 16px; font-size: 1.05rem; }
