/* ==========================================================================
   T4SL Booking — book.css
   Mobile-first. Brand: charcoal/orange/cream.
   ========================================================================== */

/* The HTML hidden attribute must always win over class-level display rules. */
[hidden] { display: none !important; }

/* Honeypot field — visually offscreen, kept in tab order out of the way. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

:root {
  --black: #1A1A1A;
  --orange: #F75D17;
  --orange-deep: #D74A0F;
  --cream: #F5EFE6;
  --charcoal: #4D4D4D;
  --charcoal-soft: #6B6B6B;
  --border: #E5E0D6;
  --white: #FFFFFF;
  --error: #B3261E;
  --gray-disabled: #C9C4BC;

  --font: "Aptos", "Calibri", "Arial", sans-serif;
  --fs-body: 1rem;       /* ~16px → readable on mobile; 11pt body equiv at desktop scale */
  --fs-small: 0.875rem;
  --fs-h1: 1.5rem;       /* 24px mobile */
  --fs-h2: 1.0625rem;
  --radius: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.08);
  --focus-ring: 0 0 0 3px rgba(247, 93, 23, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--orange-deep); }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

button { font-family: inherit; cursor: pointer; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.aria-live { position: absolute; left: -9999px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 3px solid var(--orange);
}
.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
}
.site-header__logo-link { display: inline-block; }
.site-header__logo {
  display: block;
  width: 120px;
  height: auto;
}

/* ---------- Main ---------- */
.booking {
  flex: 1 0 auto;
  padding: 24px 16px 40px;
}
.booking__inner {
  max-width: 720px;
  margin: 0 auto;
}
.booking__intro {
  text-align: center;
  margin-bottom: 24px;
}
.booking__headline {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--black);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.booking__subhead {
  font-size: var(--fs-body);
  color: var(--charcoal);
  margin: 0;
}

.section-label {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--black);
  margin: 0 0 12px;
}

/* ---------- Retry banner ---------- */
.retry-banner {
  background: #FFF4EE;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.retry-banner__text { color: var(--black); font-size: var(--fs-small); }
.retry-banner__btn {
  background: var(--orange);
  color: var(--white);
  border: 0;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 600;
  font-size: var(--fs-small);
}
.retry-banner__btn:hover { background: var(--orange-deep); }
.retry-banner__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Day strip ---------- */
.day-strip-wrap { margin-bottom: 24px; }

.day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.day-strip::-webkit-scrollbar { height: 6px; }
.day-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.day-pill {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 64px;
  padding: 10px 6px 12px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.day-pill__dow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  font-weight: 600;
}
.day-pill__dom {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
}
.day-pill:hover:not(:disabled):not(.is-selected) {
  border-color: var(--charcoal);
}
.day-pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.day-pill.is-today {
  border-color: var(--orange);
  border-width: 2px;
  padding: 9px 5px 11px; /* compensate border */
}
.day-pill.is-today::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}
.day-pill.is-selected {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.day-pill.is-selected .day-pill__dow,
.day-pill.is-selected .day-pill__dom { color: var(--white); }
.day-pill.is-selected.is-today::after { background: var(--white); }

.day-pill:disabled {
  background: var(--cream);
  color: var(--gray-disabled);
  border-color: var(--border);
  cursor: not-allowed;
}
.day-pill:disabled .day-pill__dow,
.day-pill:disabled .day-pill__dom { color: var(--gray-disabled); }

/* skeleton state for day strip on load */
.day-pill.is-skeleton {
  background: linear-gradient(90deg, var(--cream) 0%, #ECE6DA 50%, var(--cream) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  pointer-events: none;
}
.day-pill.is-skeleton .day-pill__dow,
.day-pill.is-skeleton .day-pill__dom { visibility: hidden; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---------- Time list ---------- */
.time-list-wrap { margin-bottom: 24px; }
.time-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.time-pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--black);
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.time-pill:hover:not(:disabled):not(.is-selected) { border-color: var(--charcoal); }
.time-pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.time-pill.is-selected {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.time-empty {
  color: var(--charcoal);
  padding: 16px 0;
  font-size: var(--fs-small);
}

.time-skeleton {
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--cream) 0%, #ECE6DA 50%, var(--cream) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

/* ---------- Form ---------- */
.form-wrap {
  margin-bottom: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}
.field label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}
.field-optional { color: var(--charcoal-soft); font-weight: 400; }
.field input,
.field textarea {
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: var(--focus-ring);
}
.field textarea { resize: vertical; min-height: 72px; }
.field-error {
  color: var(--error);
  font-size: 0.8125rem;
  margin-top: 4px;
  min-height: 1em;
}
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }

.form-server-error {
  background: #FBE9E8;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: var(--fs-small);
  margin-bottom: 14px;
}

.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  border: 0;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  width: 100%;
  transition: background 120ms ease, transform 60ms ease;
}
.btn-primary:hover { background: var(--orange-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary:disabled {
  background: var(--gray-disabled);
  cursor: not-allowed;
}

/* ---------- Confirmation ---------- */
.confirmation {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-bottom: 24px;
}
.confirmation__check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 auto 12px;
}
.confirmation__headline {
  font-size: var(--fs-h1);
  margin: 0 0 8px;
  color: var(--black);
}
.confirmation__when {
  font-size: var(--fs-body);
  color: var(--black);
  margin: 0 0 4px;
  font-weight: 600;
}
.confirmation__sent {
  font-size: var(--fs-small);
  color: var(--charcoal);
  margin: 0 0 20px;
}
.confirmation .btn-primary {
  display: inline-block;
  width: auto;
  min-width: 220px;
  margin-bottom: 16px;
}
.confirmation__reschedule {
  font-size: var(--fs-small);
  color: var(--charcoal);
  margin: 0;
}

/* ---------- TZ line ---------- */
.tz-line {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--charcoal);
  margin: 24px 0 0;
}
.tz-toggle {
  background: transparent;
  border: 0;
  color: var(--orange-deep);
  text-decoration: underline;
  font-size: var(--fs-small);
  padding: 4px 6px;
  margin-left: 4px;
}
.tz-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cream);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--charcoal);
}
.site-footer__inner a { color: var(--charcoal); text-decoration: none; }
.site-footer__inner a:hover { color: var(--orange-deep); text-decoration: underline; }
.site-footer__sep { margin: 0 8px; color: var(--gray-disabled); }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  :root {
    --fs-h1: 1.75rem; /* 28px */
  }
  .site-header__inner { padding: 16px 28px; }
  .site-header__logo { width: 170px; }

  .booking { padding: 40px 24px 60px; }
  .booking__intro { margin-bottom: 32px; }

  .day-strip {
    justify-content: center;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 10px;
  }
  .day-pill { min-width: 72px; }

  .time-list { grid-template-columns: repeat(4, 1fr); }

  .form-wrap { padding: 28px; }
  .btn-primary { width: auto; min-width: 220px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
