/* -----------------------------------------------------------------------
   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; }

: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; }

/* -----------------------------------------------------------------------
   Slots
   ----------------------------------------------------------------------- */

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

.slots-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}

.slot {
  font-family: var(--font-sans);
  background: var(--surface);
  border: 0;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}
.slot:hover:not(:disabled) { background: var(--hover); }
.slot:disabled {
  background: var(--surface);
  color: var(--soft);
  cursor: not-allowed;
}
.slot.is-selected { background: var(--selected); color: var(--selected-text); }

.slot-name {
  font-size: 14px;
  font-weight: 500;
}
.slot-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
}
.slot.is-selected .slot-meta { color: var(--selected-text); opacity: 0.7; }
.slot:disabled .slot-meta { color: var(--soft); }

/* -----------------------------------------------------------------------
   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: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.12s, background 0.12s;
}
.field input:focus,
.field textarea:focus { border-color: var(--text); }
.field textarea { min-height: 88px; }

.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); }
