/* BTZ Booking — implementation of the design handoff (design-handoff/README.md).
   White only, sharp rectangles, hairline borders. Fonts self-hosted. */

@font-face {
  font-family: 'Raleway';
  src: url('/fonts/Raleway-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/fonts/Barlow-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/fonts/Barlow-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/fonts/Barlow-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --navy: #0C1D2C;
  --gray: #5A6B7A;
  --hairline: #D4D9DD;
  --teal: #0A8B94;
  --gold: #B8895A;
  --mint: #E8F4F3;
  --mint-edge: #C8E6E4;
  --disabled: #B9C3CC;
  --hover-border: #8FA2AE;
  --danger-text: #A04848;
  --danger-border: #C99B9B;
  --heading: 'Raleway', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Barlow', 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--navy);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 64px 96px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 64px;
}
.site-header .wrap { padding-top: 22px; padding-bottom: 22px; }
.logo img { height: 46px; width: auto; display: block; }
.logo-small img { height: 34px; }

/* Type */
.eyebrow {
  font-family: var(--heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--teal);
}
h1, h2, h3 { font-family: var(--heading); color: var(--navy); margin: 0; }
h1 { font-size: 44px; font-weight: 700; line-height: 1.12; }
h2 { font-size: 26px; font-weight: 600; }
.title-row { display: flex; align-items: baseline; gap: 14px; margin: 14px 0 18px; }
.accent-square { width: 12px; height: 12px; background: var(--gold); flex: 0 0 auto; transform: translateY(-4px); }
.sub { color: var(--gray); font-size: 17px; max-width: 440px; margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { opacity: 0.72; text-decoration: underline; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; margin-bottom: 96px; }
.hero-media {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--navy);
}
.hero-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sections */
.step-section { margin-bottom: 88px; }
.step-section > h2 { margin: 10px 0 26px; }

/* Appointment cards */
#type-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--teal);
  padding: 26px;
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 0.18s ease-out;
}
.card:hover { border-color: var(--hover-border); border-left-color: var(--teal); }
.card:active { transform: translateY(1px); }
.card.selected { background: var(--mint); border-color: var(--mint-edge); border-left-color: var(--teal); }
.card .name { font-family: var(--heading); font-weight: 600; font-size: 17px; }
.card .meta { color: var(--gray); font-size: 13px; margin-top: 4px; }
.card .desc { color: var(--gray); font-size: 14px; margin-top: 12px; }

/* Calendar */
.calendar { max-width: 560px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-title { font-family: var(--heading); font-weight: 600; font-size: 18px; }
.cal-nav {
  width: 38px; height: 38px;
  background: #FFFFFF; border: 1px solid var(--hairline); color: var(--navy);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.cal-nav:hover:not(:disabled) { border-color: var(--hover-border); }
.cal-nav:active:not(:disabled) { transform: translateY(1px); }
.cal-nav:disabled { color: var(--disabled); cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { color: var(--gray); font-size: 11px; font-weight: 600; text-align: center; margin-bottom: 6px; }
.cal-dow div { padding: 3px 0; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--body); font-size: 15px; font-weight: 400;
  border: 1px solid transparent; color: var(--disabled); background: #FFFFFF;
}
.cal-day.blank { visibility: hidden; }
.cal-day.open {
  background: var(--mint); border-color: var(--mint-edge); color: var(--navy);
  font-weight: 600; cursor: pointer;
}
.cal-day.open:hover { border-color: var(--teal); }
.cal-day.open:active { transform: translateY(1px); }
.cal-day.open.selected { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.cal-loading { opacity: 0.5; pointer-events: none; }
.slot-day-label { font-weight: 500; font-size: 15px; margin: 26px 0 0; }

/* Time buttons */
.slot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.slot {
  border: 1px solid var(--hairline);
  padding: 13px 22px;
  cursor: pointer;
  font-family: var(--body); font-size: 14px; font-weight: 500;
  background: #FFFFFF; color: var(--navy);
}
.slot:hover { border-color: var(--hover-border); }
.slot:active { transform: translateY(1px); }
.slot.selected { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.tz-note { color: var(--gray); font-size: 13px; margin: 14px 0 0; }

/* Details: form + summary */
.details-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: start; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--navy); margin: 0 0 7px; }
.field { margin-bottom: 20px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
  font-family: var(--body); font-size: 15px; color: var(--navy);
  border: 1px solid var(--hairline); border-radius: 0; background: #FFFFFF;
  padding: 13px 14px; width: 100%;
}
input::placeholder { color: var(--gray); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint);
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

.summary {
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--gold);
  padding: 26px 30px;
  background: #FFFFFF;
}
.summary .row { padding: 9px 0; }
.summary .k { display: block; color: var(--gray); font-size: 13px; margin-bottom: 2px; }
.summary .row span:not(.k), .summary .v { font-size: 16px; font-weight: 500; color: var(--navy); }

/* Buttons */
.btn {
  font-family: var(--body); font-weight: 600; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--teal); color: #FFFFFF;
  border: none; border-radius: 0; padding: 16px 36px; cursor: pointer;
  transition: opacity 0.18s ease-out;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--hairline); color: var(--gray); cursor: default; opacity: 1; }
.btn.secondary { background: #FFFFFF; color: var(--navy); border: 1px solid var(--hairline); }
.btn.secondary:hover { opacity: 1; border-color: var(--hover-border); }
.btn.small { padding: 10px 18px; font-size: 12px; }
.btn.danger { background: #FFFFFF; color: var(--danger-text); border: 1px solid var(--danger-border); }
.btn.danger:hover { opacity: 0.88; }

/* Trust band */
.trust-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 96px; }
.trust-band figure { margin: 0; }
.trust-band img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border: 1px solid var(--hairline);
}
.trust-band figcaption { font-size: 14px; font-weight: 500; color: var(--navy); margin-top: 12px; }

/* Editorial rule (confirmation screens only) */
.editorial-rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 28px; }
.editorial-rule::before, .editorial-rule::after { content: none; }
.editorial-rule .line { width: 140px; height: 1px; background: var(--hairline); }
.editorial-rule .dot { width: 7px; height: 7px; background: var(--gold); }

.confirm-col { max-width: 560px; margin: 0 auto; padding-top: 88px; text-align: center; }
.confirm-col h2 { font-family: var(--heading); font-size: 38px; font-weight: 700; margin: 0 0 30px; }
.confirm-col .summary { text-align: left; margin-bottom: 22px; }
.confirm-col .note { color: var(--gray); font-size: 15px; margin: 0 0 30px; }

/* Notices */
.error-note {
  border: 1px solid var(--hairline); padding: 20px 24px; margin: 20px 0; font-size: 14px;
}
.error-note .err-title { font-family: var(--heading); font-weight: 600; font-size: 19px; display: block; margin-bottom: 8px; }
.error-note a { display: inline-block; margin: 4px 14px 0 0; }
.ok-note { border: 1px solid var(--mint-edge); background: var(--mint); padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.gate-err { color: var(--danger-text); font-size: 12px; margin-top: 8px; }

/* Footer */
footer { border-top: 1px solid var(--hairline); padding-top: 28px; color: var(--gray); font-size: 14px; }
footer .credential { font-family: var(--heading); font-weight: 600; font-size: 15px; color: var(--navy); }
footer .tagline { font-style: italic; margin-top: 10px; }

.hidden { display: none !important; }

/* Assistant button + chat panel */
#chat-toggle {
  position: fixed; right: 28px; bottom: 28px; z-index: 50;
  background: var(--navy); color: #FFFFFF;
  font-family: var(--body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: none; border-radius: 0; padding: 15px 22px; cursor: pointer;
}
#chat-toggle:hover { opacity: 0.88; }
#chat-toggle:active { transform: translateY(1px); }
#chat-panel {
  position: fixed; right: 28px; bottom: 84px; z-index: 50;
  width: 360px; max-width: calc(100vw - 56px);
  height: 500px; max-height: calc(100vh - 130px);
  background: #FFFFFF; border: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(12, 29, 44, 0.04), 0 8px 24px rgba(12, 29, 44, 0.06);
}
#chat-head { padding: 16px 20px; background: var(--navy); }
#chat-head .t { font-family: var(--heading); font-weight: 600; font-size: 16px; color: #FFFFFF; }
#chat-head .s { color: #A8B4BE; font-size: 12px; margin-top: 2px; }
#chat-log { flex: 1; overflow-y: auto; padding: 20px; }
.msg { margin: 0 0 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { text-align: right; }
.msg.user .bubble {
  background: var(--mint); border: 1px solid var(--mint-edge);
  display: inline-block; padding: 11px 14px; text-align: left; max-width: 86%; color: var(--navy);
}
.msg.bot .bubble {
  background: #FFFFFF; border: 1px solid var(--hairline); border-left: 3px solid var(--teal);
  display: inline-block; padding: 11px 14px; max-width: 86%; color: var(--navy);
}
.msg.typing .bubble { color: var(--gray); }
.typing-label { font-size: 12px; font-style: italic; margin-right: 8px; }
.typing-dots span {
  display: inline-block; width: 5px; height: 5px; background: var(--teal);
  margin: 0 1.5px; vertical-align: middle;
  animation: typing-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
#chat-form { display: flex; border-top: 1px solid var(--hairline); }
#chat-input { flex: 1; border: none; padding: 14px 16px; font-family: var(--body); font-size: 14px; }
#chat-input:focus { outline: none; box-shadow: none; }
#chat-send {
  background: var(--teal); color: #FFFFFF; border: none; padding: 0 20px;
  font-family: var(--body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
}
#chat-send:hover { opacity: 0.88; }
.chat-gate { padding: 4px; }
.chat-gate input[type="text"], .chat-gate input[type="email"] { margin-bottom: 8px; font-size: 14px; padding: 11px 12px; }
.chat-gate .btn.small { width: 100%; }

/* Admin (utilitarian, same tokens) */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--hairline); margin: 24px 0; flex-wrap: wrap; }
.tab {
  font-family: var(--heading); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 16px; cursor: pointer; color: var(--gray);
}
.tab.active { color: var(--navy); border-bottom-color: var(--teal); }
table.admin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin th { text-align: left; color: var(--gray); font-weight: 500; border-bottom: 1px solid var(--hairline); padding: 8px 10px; }
table.admin td { border-bottom: 1px solid var(--hairline); padding: 9px 10px; vertical-align: top; }
.admin-card { border: 1px solid var(--hairline); border-left: 4px solid var(--teal); padding: 18px 20px; margin: 12px 0; }
.admin-card .name { font-family: var(--heading); font-weight: 600; font-size: 17px; }
.admin-card .meta { color: var(--gray); font-size: 14px; margin-top: 2px; }
.admin-card .desc { color: var(--gray); font-size: 14px; margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .wrap { padding: 0 20px 64px; }
  .site-header { margin-bottom: 36px; }
  h1 { font-size: 34px; }
  .hero { grid-template-columns: 1fr; gap: 28px; margin-bottom: 64px; }
  #type-list { grid-template-columns: 1fr; gap: 16px; }
  .details-grid { grid-template-columns: 1fr; gap: 28px; }
  .trust-band { grid-template-columns: repeat(2, 1fr); margin-bottom: 64px; }
  .step-section { margin-bottom: 56px; }
}
@media (max-width: 480px) {
  h1 { font-size: 30px; }
  .trust-band { grid-template-columns: 1fr; }
  .slot { flex: 1 1 40%; text-align: center; }
  #confirm-btn, #resched-btn { width: 100%; }
  #chat-toggle { right: 0; bottom: 0; left: 0; width: 100%; padding: 17px; }
  #chat-panel {
    right: 0; bottom: 48px; left: 0; top: 0;
    width: 100%; max-width: none; height: auto; max-height: none;
    border: none; border-bottom: 1px solid var(--hairline);
  }
}
