@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable.woff2") format("woff2");
}

:root {
  --flow-teal: #00c2a8;
  --teal-dark: #009e88;
  --ink-blue: #0f4c81;
  --bridge-blue: var(--ink-blue);
  --cloud: #f5f7fa;
  --surface-1: #fafbfc;
  --charcoal: #1a202c;
  --stone: #718096;
  --white: #ffffff;
  --danger: #e53e3e;
  --success: #38a169;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-feature-settings:
    "cv11",
    "ss01",
    "cv02";
  font-variant-numeric: tabular-nums;
  color: var(--charcoal);
  background: var(--surface-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-header {
  text-align: center;
  padding: 24px 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 6px;
}

.logo span {
  color: inherit;
}

.booking-container {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 16px;
}

.state-loading,
.state-error {
  text-align: center;
  padding: 80px 20px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 194, 168, 0.2);
  border-top-color: var(--flow-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.state-error h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.state-error p {
  color: var(--stone);
}

.booking-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Sidebar */
.event-sidebar {
  background: var(--cloud);
  padding: 32px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.event-host {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.event-title {
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--stone);
  background: var(--white);
  padding: 6px 12px;
  border-radius: 8px;
}

.event-desc {
  color: var(--stone);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Main booking area */
.booking-main {
  padding: 24px;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--bridge-blue);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}

.btn-text:hover {
  background: rgba(15, 76, 129, 0.08);
}

/* Calendar */
.calendar {
  max-width: 360px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--white);
  color: var(--charcoal);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}

.cal-nav:hover:not(:disabled) {
  background: var(--cloud);
  border-color: var(--stone);
}

.cal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#cal-month-year {
  font-weight: 700;
  font-size: 1rem;
}

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

.cal-dow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--white);
  transition: all 0.15s;
  font-family: inherit;
}

.cal-day:hover:not(.disabled):not(.selected) {
  background: var(--cloud);
  border-color: rgba(0, 0, 0, 0.08);
}

.cal-day.today {
  border-color: var(--bridge-blue);
  color: var(--bridge-blue);
  font-weight: 700;
}

.cal-day.selected {
  background: var(--flow-teal);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 194, 168, 0.35);
}

.cal-day.disabled {
  color: #cbd5e0;
  cursor: not-allowed;
  background: transparent;
}

/* Time slots */
.selected-date {
  font-size: 0.95rem;
  color: var(--stone);
  margin-bottom: 16px;
  font-weight: 500;
}

/* Cross-TZ awareness banner — shown only when visitor and host differ.
   Subtle; doesn't shout. */
.tz-banner {
  font-size: 0.8rem;
  color: var(--stone);
  background: rgba(15, 76, 129, 0.05);
  border-left: 2px solid var(--bridge-blue);
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.tz-banner.hidden {
  display: none;
}

/* Always-present timezone selector — lets the booker correct a wrong
   auto-detected zone. Sits above the slot grid. */
.tz-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.tz-control__label {
  color: var(--stone);
}

.tz-control__select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 0.8rem;
  padding: 6px 8px;
  border: 1px solid rgba(15, 76, 129, 0.2);
  border-radius: 4px;
  background: #fff;
  color: inherit;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.time-slot {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}

.time-slot:hover:not(.selected) {
  border-color: var(--flow-teal);
  color: var(--flow-teal);
  background: rgba(0, 194, 168, 0.04);
}

.time-slot.selected {
  background: var(--flow-teal);
  color: var(--white);
  border-color: var(--flow-teal);
  box-shadow: 0 2px 8px rgba(0, 194, 168, 0.3);
}

.no-slots {
  color: var(--stone);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px;
  background: var(--cloud);
  border-radius: 10px;
  grid-column: 1 / -1;
}

/* Form */
.selected-datetime {
  font-size: 0.95rem;
  color: var(--stone);
  margin-bottom: 20px;
  font-weight: 500;
}

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

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--charcoal);
}

.form-group .optional {
  font-weight: 400;
  color: var(--stone);
}

.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--white);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--flow-teal);
  box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a0aec0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--flow-teal);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 194, 168, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--bridge-blue);
  border: 1px solid var(--bridge-blue);
}

.btn-secondary:hover {
  background: var(--bridge-blue);
  color: var(--white);
}

.btn-submit {
  margin-top: 8px;
  padding: 14px 24px;
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* Confirmation */
.confirm-card {
  text-align: center;
  padding: 24px 8px;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.confirm-cancel-row {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--stone);
}

.confirm-cancel-row a {
  color: var(--bridge-blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 76, 129, 0.3);
}

.confirm-cancel-row a:hover {
  border-bottom-color: var(--bridge-blue);
}

.confirm-title {
  font-size: 1.5rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.confirm-subtitle {
  color: var(--stone);
  margin-bottom: 28px;
}

.confirm-details {
  background: var(--cloud);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  margin-right: 12px;
}

.confirm-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--charcoal);
  text-align: right;
  word-break: break-all;
}

.confirm-mono {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  font-size: 0.85rem;
}

.btn-home {
  width: 100%;
}

/* Scrollbar polish */
.time-slots::-webkit-scrollbar {
  width: 6px;
}

.time-slots::-webkit-scrollbar-track {
  background: transparent;
}

.time-slots::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

/* Desktop layout */
@media (min-width: 768px) {
  .booking-card {
    display: grid;
    grid-template-columns: 280px 1fr;
  }

  .event-sidebar {
    border-bottom: none;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 40px 28px;
  }

  .booking-main {
    padding: 40px;
  }

  .time-slots {
    grid-template-columns: repeat(3, 1fr);
    max-height: 400px;
  }
}
