/* -----------------------------------------------------------------------
   calendar.typografie.be
   System fonts, off-white surface, mono labels — sibling to typografie.be
   and the JC chat app.
   ----------------------------------------------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --bg: #fbfbfb;
  --surface: #ffffff;
  --text: #000000;
  --muted: #999999;
  --soft: #cccccc;
  --hairline: #ececec;
  --hover: #f3f3f3;
  --selected: #000000;
  --selected-text: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}

a { color: inherit; }

/* -----------------------------------------------------------------------
   Logo — three-layer folder icon, fixed top-left (matches typografie.be)
   ----------------------------------------------------------------------- */

.logo {
  position: fixed;
  top: 32px;
  left: 32px;
  width: 32px;
  height: 31.6px;
  z-index: 100;
}
.logo a { display: block; width: 100%; height: 100%; }
.logo-layer {
  position: absolute;
  left: 0;
  width: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(.32,.72,.35,1);
}
.logo-back   { background-image: url("icon-back.png");   height: 28.7px; bottom: 2.87px; }
.logo-middle { background-image: url("icon-middle.png"); height: 25.4px; bottom: 2.87px; }
.logo-front  { background-image: url("icon-front.png");  height: 21.4px; bottom: 2.87px; }

.logo:hover .logo-back   { transform: translateY(0.86px); }
.logo:hover .logo-middle { transform: translateY(2.44px); }
.logo:hover .logo-front  { transform: translateY(5.02px); }

@media (max-width: 900px) {
  .logo { top: 24px; left: 24px; }
}

/* -----------------------------------------------------------------------
   Page layout — single column, centered, generous whitespace
   ----------------------------------------------------------------------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 96px 32px 96px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (max-width: 700px) {
  .page { padding: 88px 24px 64px; gap: 36px; }
}

/* -----------------------------------------------------------------------
   Section header (mono kicker + sans headline)
   ----------------------------------------------------------------------- */

.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.intro h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.15;
  margin: 0;
}
.intro .rate {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
}

/* -----------------------------------------------------------------------
   Calendar
   ----------------------------------------------------------------------- */

.cal { display: flex; flex-direction: column; gap: 16px; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cal-month {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12px;
  color: var(--text);
  text-transform: uppercase;
}
.cal-nav {
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
}
.cal-nav:hover:not(:disabled) { background: var(--hover); }
.cal-nav:disabled { opacity: 0.25; cursor: not-allowed; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.cal-day:hover:not(:disabled) { background: var(--hover); }
.cal-day:disabled,
.cal-day.is-blocked,
.cal-day.is-past,
.cal-day.is-weekend {
  color: var(--soft);
  cursor: not-allowed;
}
.cal-day.is-empty { background: transparent; pointer-events: none; }
.cal-day.is-selected {
  background: var(--selected);
  color: var(--selected-text);
}
.cal-day.is-partial::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.5;
}
.cal-day.is-selected.is-partial::after { background: var(--selected-text); opacity: 0.7; }

.cal-loading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
}
.cal-loading.is-hidden { display: none; }

/* -----------------------------------------------------------------------
   Bookings (per-day slot picker)
   ----------------------------------------------------------------------- */

.bookings { display: flex; flex-direction: column; gap: 12px; }

.booking-rows {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}

.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.booking-row:last-child { border-bottom: 0; }

.booking-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}

.booking-slots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.slot-pill {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 5px 11px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  line-height: 1.2;
}
.slot-pill:hover:not(:disabled):not(.is-selected) { background: var(--hover); }
.slot-pill.is-selected {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.slot-pill:disabled {
  color: var(--soft);
  border-color: var(--hairline);
  cursor: not-allowed;
}

.booking-remove {
  font-family: var(--font-mono);
  font-size: 16px;
  background: transparent;
  border: 0;
  color: var(--soft);
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s;
}
.booking-remove:hover { color: var(--text); }

@media (max-width: 600px) {
  .booking-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
  .booking-slots { justify-content: flex-start; align-self: stretch; }
}

/* -----------------------------------------------------------------------
   Form
   ----------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 16px; }

#bookingForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-transform: uppercase;
}
.field input,
.field textarea {
  font-family: var(--font-sans);
  font-size: 16px; /* >=16px stops iOS Safari from zooming on focus */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.12s, background 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field textarea:focus { border-color: var(--text); }
.field textarea { min-height: 88px; }

.loc-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.loc-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.loc-option:hover { background: var(--hover); }
.loc-option input[type="radio"] {
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--text);
  cursor: pointer;
}
.loc-option input[type="radio"]:disabled { cursor: not-allowed; opacity: 0.4; }
.loc-option:has(input:disabled) { cursor: not-allowed; color: var(--soft); }
.loc-option:has(input:disabled):hover { background: var(--surface); }
.loc-name {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
}
.loc-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
  grid-column: 2;
}
.loc-option:has(input:disabled) .loc-note { color: var(--soft); }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.form-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
  flex: 1 1 auto;
}
.form-summary.is-error { color: #ff3b30; }

.cta {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--text);
  color: var(--surface);
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.12s, background 0.12s;
}
.cta:hover:not(:disabled) { opacity: 0.85; }
.cta:disabled {
  background: var(--soft);
  color: var(--surface);
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   Confirmation / error
   ----------------------------------------------------------------------- */

.confirm,
.error {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.confirm h2,
.error h2 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0;
}
.confirm p,
.error p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}
.confirm .note { color: var(--muted); font-size: 13px; }
.error h2 { color: #ff3b30; }

.error .cta { align-self: flex-start; background: var(--text); color: var(--surface); margin-top: 4px; }

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */

.foot {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* -----------------------------------------------------------------------
   Terms agreement (checkbox in form) + standalone /terms.html page
   ----------------------------------------------------------------------- */

.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.agree input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--text);
  cursor: pointer;
}
.agree a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* Standalone /terms.html page */
.legal { max-width: 720px; }
.legal h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0 0 8px;
}
.legal .updated {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 32px;
}
.legal h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12px;
  text-transform: uppercase;
  color: var(--text);
  margin: 32px 0 12px;
}
.legal p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.55;
}
.legal a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.legal .back {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.legal .back:hover { color: var(--text); }

/* -----------------------------------------------------------------------
   Mobile — bigger touch targets, looser spacing
   ----------------------------------------------------------------------- */

@media (max-width: 700px) {
  .cal-nav { width: 40px; height: 40px; font-size: 18px; }
  .cal-day { font-size: 15px; border-radius: 8px; }

  .slot-pill {
    font-size: 14px;
    padding: 9px 14px;
    min-height: 36px;
  }
  .booking-remove {
    font-size: 22px;
    padding: 4px 10px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .booking-row { padding: 14px 14px; gap: 10px; }

  .cta { padding: 14px 22px; font-size: 15px; min-height: 44px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .cta { width: 100%; text-align: center; }
  .form-summary { text-align: center; }

  .intro h1 { font-size: 24px; }
  .legal h1 { font-size: 24px; }
}
