:root {
  --ink: #171717;
  --paper: #fbfaf6;
  --white: #ffffff;
  --amber: #b7f34b;
  --amber-dark: #6f8f12;
  --green: #1fa67a;
  --green-dark: #123f36;
  --red: #c84630;
  --blue: #263f7c;
  --line: rgba(23, 23, 23, 0.14);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
  --gutter: clamp(18px, 4vw, 56px);
  --panel-space: clamp(16px, 3vw, 34px);
  --title-size: clamp(2.8rem, 7.8vw, 5.6rem);
  --lead-size: clamp(1rem, 1.6vw, 1.2rem);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.invite-hero {
  position: relative;
  display: grid;
  min-height: 92svh;
  align-items: center;
  overflow: hidden;
  padding: var(--gutter);
  background: url("assets/gym-training.png") center / cover no-repeat;
  isolation: isolate;
}

.invite-hero::before,
.plan-visual::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(0, 0, 0, 0.46);
}

.invite-copy {
  width: min(680px, 100%);
  color: var(--white);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--amber);
}

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

.invite-copy h1,
.plan-copy h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: var(--title-size);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead,
.plan-copy p {
  max-width: 56ch;
  margin-bottom: 28px;
  font-size: var(--lead-size);
  line-height: 1.6;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  max-width: 440px;
}

.button {
  display: inline-flex;
  width: auto;
  min-width: 8rem;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button:focus-visible,
.icon-button:focus-visible,
.calendar-day:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(244, 166, 41, 0.86);
  outline-offset: 3px;
}

.button-primary {
  color: var(--ink);
  background: var(--amber);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.button-primary:hover {
  background: #ffbd4b;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
}

.button:disabled:hover {
  background: var(--amber);
  transform: none;
}

.button-secondary {
  color: var(--white);
  background: var(--red);
}

.button-secondary.is-evasive {
  position: fixed;
  z-index: 20;
  width: auto;
  min-width: 92px;
  max-width: calc(100vw - 32px);
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: left 190ms ease, top 190ms ease, transform 190ms ease;
}

.status-band {
  display: flex;
  min-height: 8svh;
  align-items: center;
  gap: 10px;
  padding: 18px var(--gutter);
  color: var(--white);
  background: var(--green-dark);
}

.top-bar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  font-weight: 800;
}

.back-link {
  border-radius: 8px;
  color: var(--green-dark);
  text-decoration: none;
}

.back-link:focus-visible {
  outline: 3px solid rgba(31, 122, 88, 0.35);
  outline-offset: 4px;
}

.plan-main {
  display: grid;
  min-height: calc(100svh - 64px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, min(42vw, 520px));
}

.plan-visual {
  position: relative;
  display: grid;
  align-items: end;
  min-height: calc(100svh - 64px);
  padding: var(--gutter);
  color: var(--white);
  background: url("assets/gym-training.png") center / cover no-repeat;
  isolation: isolate;
}

.plan-copy {
  max-width: 680px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.scheduler-panel {
  display: grid;
  align-items: center;
  padding: var(--panel-space);
  background:
    linear-gradient(135deg, rgba(244, 166, 41, 0.12), rgba(31, 122, 88, 0.10)),
    var(--paper);
}

.scheduler-panel form {
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--white);
  box-shadow: 0 18px 46px rgba(23, 23, 23, 0.12);
}

.panel-heading h2 {
  margin-bottom: 20px;
  font-size: clamp(1.45rem, 3.4vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.calendar-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-header h3 {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

.icon-button:disabled {
  color: rgba(23, 23, 23, 0.35);
  cursor: not-allowed;
  background: #f1f1ee;
}

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

.weekday {
  min-height: 26px;
  color: rgba(23, 23, 23, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day,
.calendar-blank {
  aspect-ratio: 1;
  min-width: 0;
}

.calendar-day {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-size: clamp(0.86rem, 1.2vw, 1rem);
  font-weight: 800;
  cursor: pointer;
}

.calendar-day:hover {
  border-color: var(--green);
  background: rgba(31, 122, 88, 0.08);
}

.calendar-day.is-today {
  border-color: var(--amber-dark);
}

.calendar-day.is-selected {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.calendar-day:disabled {
  color: rgba(23, 23, 23, 0.28);
  cursor: not-allowed;
  background: #f2f2ef;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

input::placeholder {
  color: rgba(23, 23, 23, 0.48);
}

.full-width {
  width: 100%;
}

.form-message {
  min-height: 48px;
  margin: 16px 0 0;
  color: var(--blue);
  font-weight: 800;
  line-height: 1.4;
}

@media (max-width: 920px) {
  .plan-main {
    grid-template-columns: 1fr;
  }

  .plan-visual {
    min-height: clamp(340px, 54svh, 520px);
    align-items: end;
    background-position: center 42%;
  }

  .plan-copy h1 {
    max-width: 14ch;
  }

  .scheduler-panel form {
    max-width: 640px;
  }
}

@media (max-width: 680px) {
  .status-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    display: grid;
    width: min(100%, 430px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .invite-hero {
    min-height: 86svh;
    align-items: end;
    padding-block: 56px 32px;
    background-position: 55% center;
  }

  .invite-copy h1 {
    max-width: 9ch;
  }

  .lead {
    margin-bottom: 22px;
  }

  .plan-visual {
    min-height: 330px;
    padding-block: 42px 28px;
    background-position: 54% center;
  }

  .top-bar {
    min-height: 58px;
  }

  .scheduler-panel form {
    box-shadow: 0 12px 30px rgba(23, 23, 23, 0.10);
  }

  .calendar-header {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .calendar-grid {
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .button-row {
    grid-template-columns: 1fr;
  }

  .button-secondary.is-evasive {
    width: auto;
    min-width: 92px;
  }

  .scheduler-panel {
    padding-inline: 8px;
  }

  .scheduler-panel form {
    padding: 14px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .weekday {
    font-size: 0.7rem;
  }
}

@media (hover: none) {
  .button:hover,
  .button:focus-visible {
    transform: none;
  }

  .calendar-day:hover {
    border-color: var(--line);
    background: var(--white);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
