@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 800;
}
:root {
  --navy: #061724;
  --navy-raised: #0b1e2c;
  --paper: #f8faf7;
  --muted: #aeb8bf;
  --line: rgba(248, 250, 247, 0.16);
  --line-strong: rgba(248, 250, 247, 0.46);
  --blue: #4291d7;
  --sky: #00bfff;
  --orange: #f89b20;
  --yellow: #ffc71f;
  --accent: var(--blue);
  --focus: var(--yellow);
  color-scheme: dark;
}

html[data-brand="fields"] { --accent: var(--yellow); }
html[data-brand="kyriarch"] { --accent: var(--blue); }
html[data-brand="dalefield"] { --accent: var(--sky); }

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #d9d8d4;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(rgba(6, 23, 36, 0.58), rgba(6, 23, 36, 0.58)),
    #d9d8d4;
  color: var(--paper);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.scheduler-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
}

.scheduler-shell {
  width: min(1240px, 100%);
  min-height: min(720px, calc(100svh - 48px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--navy);
  box-shadow: none;
}

.scheduler-topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}

.scheduler-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.scheduler-brand img {
  width: auto;
  max-width: 190px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}

.scheduler-brand span {
  color: var(--muted);
  font-size: 0.875rem;
}

.scheduler-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  text-decoration: none;
  transition: border-color 180ms ease-out, background 180ms ease-out;
}

.scheduler-close:hover,
.scheduler-close:focus-visible {
  border-color: var(--paper);
  background: rgba(248, 250, 247, 0.08);
}

.scheduler-grid {
  display: grid;
  min-height: 590px;
  grid-template-columns: minmax(240px, 0.78fr) minmax(430px, 1.45fr) minmax(250px, 0.82fr);
}

.meeting-summary,
.calendar-panel,
.time-panel {
  min-width: 0;
  padding: clamp(24px, 3vw, 32px);
}

.meeting-summary,
.calendar-panel {
  border-right: 1px solid var(--line);
}

.meeting-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 800;
}

.meeting-company {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.meeting-summary h1 {
  max-width: 11ch;
  margin: 0 0 32px;
  font-size: clamp(1.65rem, 2.4vw, 2.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.meeting-facts {
  display: grid;
  gap: 16px;
  margin: 0;
}

.meeting-facts div {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
}

.meeting-facts svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.meeting-facts dt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.meeting-facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.meeting-note {
  max-width: 30ch;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.calendar-toolbar h2,
.time-panel h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.calendar-toolbar h2 span {
  color: var(--muted);
  font-weight: 500;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 180ms ease-out, color 180ms ease-out;
}

.calendar-nav button:hover:not(:disabled),
.calendar-nav button:focus-visible {
  background: rgba(248, 250, 247, 0.08);
  color: var(--paper);
}

.calendar-nav button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 12px;
}

.calendar-weekdays span {
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
}

.calendar-days {
  gap: 4px;
}

.calendar-day {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 52px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
}

.calendar-day:hover:not(:disabled) {
  background: rgba(248, 250, 247, 0.09);
  transform: translateY(-1px);
}

.calendar-day.is-selected {
  background: var(--paper);
  color: var(--navy);
  font-weight: 800;
}

.calendar-day.is-selected::after {
  position: absolute;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.calendar-day.is-outside {
  color: rgba(248, 250, 247, 0.3);
}

.calendar-day:disabled {
  color: rgba(248, 250, 247, 0.18);
  cursor: not-allowed;
}

.calendar-legend {
  margin: auto 0 0;
  padding-top: 32px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.time-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.time-heading {
  margin-bottom: 16px;
}

.time-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.time-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  margin: 0;
  padding: 0 4px 4px 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.time-slot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.time-slot.is-selected {
  grid-template-columns: 1fr 0.72fr;
}

.time-button,
.time-next,
.form-submit,
.form-back {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease-out, background 160ms ease-out, color 160ms ease-out;
}

.time-button:hover,
.time-button:focus-visible {
  border-color: var(--paper);
}

.time-slot.is-selected .time-button {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--navy);
}

.time-next {
  display: none;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--navy);
}

.time-slot.is-selected .time-next {
  display: block;
}

.time-next:hover,
.time-next:focus-visible,
.form-submit:hover,
.form-submit:focus-visible {
  filter: brightness(1.08);
}

.booking-form {
  display: grid;
  gap: 16px;
}

.booking-form[hidden],
.time-list[hidden] {
  display: none;
}

.booking-selection {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.booking-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.booking-form input,
.booking-form textarea,
.booking-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--navy-raised);
  color: var(--paper);
}

.booking-form input,
.booking-form select {
  min-height: 46px;
  padding: 0 12px;
}

.booking-form textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.booking-form input::placeholder,
.booking-form textarea::placeholder {
  color: #7f8d96;
}

.booking-form input:focus,
.booking-form textarea:focus,
.booking-form select:focus {
  border-color: var(--accent);
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.form-actions {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 8px;
  margin-top: 4px;
}

.form-submit {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--navy);
}

.form-status {
  min-height: 2.8em;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-status[data-state="ready"] {
  color: var(--paper);
}

.scheduler-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

@media (max-width: 1024px) {
  .scheduler-grid {
    grid-template-columns: minmax(230px, 0.72fr) minmax(420px, 1.28fr);
  }

  .calendar-panel {
    border-right: 0;
  }

  .time-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .time-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 270px;
  }
}

@media (max-width: 768px) {
  .scheduler-page {
    display: block;
    padding: 0;
  }

  .scheduler-shell {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .scheduler-topbar {
    position: sticky;
    z-index: 5;
    top: 0;
    background: var(--navy);
  }

  .scheduler-brand img {
    max-width: 145px;
    height: 24px;
  }

  .scheduler-brand span {
    display: none;
  }

  .scheduler-grid {
    display: block;
    min-height: 0;
  }

  .meeting-summary,
  .calendar-panel,
  .time-panel {
    padding: 28px 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .meeting-summary h1 {
    max-width: 15ch;
    font-size: 2rem;
  }

  .meeting-note {
    max-width: 42ch;
  }

  .calendar-day {
    min-height: 48px;
  }

  .time-list {
    grid-template-columns: 1fr 1fr;
    max-height: none;
    overflow: visible;
  }

  .time-slot.is-selected {
    grid-column: 1 / -1;
  }

  .scheduler-footer {
    min-height: 72px;
  }
}

@media (max-width: 560px) {
  .scheduler-topbar {
    padding-inline: 16px;
  }

  .calendar-toolbar {
    align-items: flex-start;
  }

  .calendar-day {
    min-height: 44px;
  }

  .time-list {
    grid-template-columns: 1fr;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

