:root {
  --paper: #fffaf3;
  --cream: #f7f1e8;
  --mist: #eef3ec;
  --sage: #7d947b;
  --sage-deep: #2f5545;
  --sage-dark: #1f3b32;
  --terracotta: #bb735b;
  --line: rgba(47, 85, 69, 0.16);
  --ink: #24342f;
  --muted: #4a5f57;
  --danger: #a9473d;
  --shadow: 0 18px 44px rgba(48, 63, 55, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(125, 148, 123, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(125, 148, 123, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 56px 56px, 56px 56px, auto;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.58;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--sage-dark);
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1 {
  max-width: 760px;
  margin-bottom: 0.9rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.35rem, 11vw, 3.35rem);
  line-height: 1;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  line-height: 1.18;
}

h3 {
  margin-bottom: 0.85rem;
  font-size: 1rem;
}

p {
  color: var(--muted);
}

main,
.booking-layout,
.booking-flow,
.step-card,
.booking-summary,
.step-heading > div,
.appointment-types,
.type-card,
.field-grid,
.donation-options {
  min-width: 0;
}

.booking-topbar,
.booking-shell,
.confirmation-card {
  width: min(100% - 28px, 1180px);
  margin-inline: auto;
}

.booking-topbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.94);
  box-shadow: 0 12px 32px rgba(36, 52, 47, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand__mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--paper);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  color: var(--sage-dark);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
}

.brand small {
  display: none;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.topbar-link {
  flex: 0 0 auto;
  color: var(--sage-deep);
  font-size: 0.88rem;
  font-weight: 800;
}

.booking-shell {
  padding: 2rem 0 4rem;
}

.booking-hero {
  max-width: 760px;
  margin-bottom: 1.2rem;
}

.booking-hero p:last-child {
  max-width: 690px;
  margin-bottom: 0;
  font-size: 1rem;
}

.eyebrow,
.summary-kicker {
  margin-bottom: 0.75rem;
  color: var(--terracotta);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.alert,
.empty-state,
.step-card,
.booking-summary,
.confirmation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
}

.alert {
  margin-bottom: 1rem;
  padding: 1rem;
  border-color: rgba(169, 71, 61, 0.28);
  background: #fff5f0;
  color: var(--danger);
}

.alert ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.alert--success {
  border-color: rgba(47, 85, 69, 0.22);
  background: var(--mist);
  color: var(--sage-dark);
}

.alert--warning {
  border-color: rgba(187, 115, 91, 0.36);
  background: #fff8ed;
  color: #8b4a31;
}

.empty-state {
  padding: 1.15rem;
}

.booking-layout {
  display: grid;
  gap: 1rem;
}

.booking-summary {
  order: 2;
  padding: 1rem;
}

.booking-summary h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  line-height: 1;
}

.booking-summary dl,
.confirmation-details {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.booking-summary dl div,
.confirmation-details div {
  display: grid;
  gap: 0.15rem;
  padding: 0.82rem;
  border-radius: var(--radius);
  background: var(--mist);
}

dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--sage-dark);
  font-weight: 800;
}

.summary-note {
  margin-bottom: 0;
  color: #4d6259;
  font-size: 0.92rem;
}

.booking-flow {
  order: 1;
  display: grid;
  gap: 1rem;
}

.step-card {
  padding: 1rem;
}

.step-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  margin-bottom: 1rem;
}

.step-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--paper);
  font-weight: 800;
}

.step-heading p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.appointment-types,
.donation-options,
.field-grid {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.appointment-types > li {
  display: contents;
}

.type-card,
.donation-option,
.day-card,
.slot-button,
.icon-button,
.button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.type-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 0.22rem;
  min-height: 104px;
  padding: 1rem 1rem 1rem 1.15rem;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
}

.type-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--type-color, var(--sage));
}

.type-card strong {
  color: var(--sage-dark);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.type-card small {
  color: var(--terracotta);
  font-weight: 800;
}

.type-card p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  overflow-wrap: break-word;
}

.type-card.is-selected,
.day-card.is-selected,
.slot-button.is-selected,
.donation-option:has(input:checked) {
  border-color: var(--sage-deep);
  background: var(--mist);
  box-shadow: 0 0 0 3px rgba(47, 85, 69, 0.1);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.calendar-toolbar strong {
  color: var(--sage-dark);
  text-align: center;
  overflow-wrap: break-word;
}

.icon-button {
  min-height: 44px;
  color: var(--sage-deep);
  font-size: 1.7rem;
  font-weight: 800;
}

.days-strip {
  display: grid;
  grid-auto-columns: minmax(108px, 42%);
  grid-auto-flow: column;
  gap: 0.65rem;
  margin-inline: -1rem;
  padding: 0 1rem 0.9rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
}

.day-card {
  display: grid;
  gap: 0.25rem;
  min-height: 76px;
  padding: 0.75rem;
  scroll-snap-align: start;
  text-align: left;
}

.day-card:disabled {
  opacity: 0.48;
}

.day-card strong {
  color: var(--sage-dark);
  font-size: 0.92rem;
}

.day-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.slots-panel {
  margin-top: 0.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.slot-button {
  min-height: 48px;
  color: var(--sage-deep);
  font-weight: 900;
}

label,
legend {
  color: var(--sage-dark);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
}

input {
  min-height: 48px;
  padding: 0 0.85rem;
}

textarea {
  resize: vertical;
  padding: 0.8rem 0.85rem;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(187, 115, 91, 0.28);
  outline-offset: 2px;
}

.donation-fieldset {
  margin: 1rem 0;
  padding: 0;
  border: 0;
}

.donation-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.85rem;
}

.donation-option input {
  width: 18px;
  min-height: 18px;
  margin-top: 0.15rem;
}

.donation-option small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-weight: 500;
}

.notes-field {
  display: block;
}

.form-footer {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.form-footer p {
  margin-bottom: 0;
  color: var(--sage-deep);
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85rem 1.15rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
}

.button--primary {
  border-color: var(--sage-deep);
  background: var(--sage-deep);
  color: var(--paper);
}

.button--secondary {
  border-color: rgba(187, 115, 91, 0.35);
  color: var(--terracotta);
}

.button:disabled {
  border-color: rgba(47, 85, 69, 0.1);
  background: #d9ded7;
  color: #78867f;
}

.muted,
.loading,
.empty-inline {
  margin: 0;
  color: var(--muted);
}

.loading,
.empty-inline {
  padding: 0.9rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.7);
}

.confirmation-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem 0;
}

.confirmation-card {
  max-width: 760px;
  padding: 1.2rem;
}

.confirmation-card .brand {
  margin-bottom: 2rem;
}

.confirmation-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

@media (max-width: 430px) {
  .booking-topbar,
  .booking-shell,
  .confirmation-card {
    width: calc(100% - 24px);
  }

  .booking-topbar {
    padding: 9px 10px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 1.22rem;
  }

  .topbar-link {
    font-size: 0.82rem;
  }

  .step-card,
  .booking-summary {
    padding: 0.9rem;
  }

  .step-heading {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
  }

  .step-heading > span {
    width: 34px;
    height: 34px;
  }
}

@media (min-width: 620px) {
  body {
    font-size: 16px;
  }

  .brand small {
    display: block;
  }

  .booking-shell {
    padding-top: 2.6rem;
  }

  .field-grid,
  .donation-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .confirmation-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

@media (min-width: 960px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: clamp(3.2rem, 5vw, 4.15rem);
  }

  .booking-shell {
    padding-top: 3rem;
  }

  .booking-hero {
    margin-bottom: 1.8rem;
  }

  .booking-layout {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
  }

  .booking-summary {
    position: sticky;
    top: 96px;
    order: 1;
  }

  .booking-flow {
    order: 2;
  }

  .step-card,
  .booking-summary,
  .confirmation-card {
    padding: 1.25rem;
  }

  .appointment-types {
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  }

  .days-strip {
    grid-auto-columns: minmax(112px, 1fr);
    margin-inline: 0;
    padding-inline: 0;
  }
}

@media (min-width: 1280px) {
  .booking-topbar,
  .booking-shell {
    width: min(100% - 48px, 1240px);
  }

  .booking-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

/* Accessibility ----------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--sage-dark);
  color: var(--paper);
  font-weight: 900;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
main:focus-visible {
  outline: 3px solid rgba(187, 115, 91, 0.5);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.topbar-link,
.confirmation-actions a {
  text-underline-offset: 0.2em;
}

.topbar-link:hover,
.topbar-link:focus-visible {
  text-decoration: underline;
}

.rgpd-notice {
  font-size: .8rem;
  color: var(--muted);
  margin: .5rem 0 1rem;
}
.rgpd-notice a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: .2em;
}
