@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4efe7;
  --surface: rgba(253, 250, 244, 0.86);
  --surface-strong: #fbf8f2;
  --text: #22211f;
  --muted: #706d68;
  --line: rgba(34, 33, 31, 0.13);
  --accent: #242321;
  --accent-deep: #050505;
  --sage: #54514c;
  --sage-soft: #e7e2da;
  --danger: #252320;
  --danger-soft: #e6e0d8;
  --shadow: 0 22px 52px rgba(28, 27, 25, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.88), transparent 28%),
    radial-gradient(circle at 94% 30%, rgba(80, 77, 72, 0.1), transparent 26%),
    linear-gradient(145deg, #f7f3ec 0%, #ece7de 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.33;
  filter: blur(10px);
}

body::before {
  top: 8%;
  right: -6rem;
  background: rgba(47, 45, 42, 0.1);
}

body::after {
  bottom: 8%;
  left: -7rem;
  background: rgba(255, 255, 255, 0.7);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: rgba(252, 249, 243, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand small,
.section-copy,
.helper-copy,
.activity-meta,
.muted-copy,
.empty-state {
  color: var(--muted);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, #0b0b0a, #393734);
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.nav,
.topbar-actions,
.hero-actions,
.hero-stats,
.card-title-row,
.metric-grid,
.admin-grid,
.auth-grid {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.user-chip,
.badge,
.label-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.82rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1.1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: white;
  box-shadow: 0 15px 28px rgba(18, 18, 17, 0.2);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
}

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

.section,
.info-card,
.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section {
  margin-top: 1.35rem;
  padding: clamp(1.3rem, 2vw, 2rem);
  border-radius: var(--radius-xl);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Caveat", cursive;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.12;
}

h1 {
  font-size: clamp(3.8rem, 6vw, 6.3rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(2.8rem, 4vw, 4.2rem);
}

h3 {
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 800;
}

.hero-copy p,
.section-copy,
.feature-list li,
.activity-meta,
.helper-copy,
.empty-state,
.class-meta,
.info-card p {
  line-height: 1.65;
}

.hero-panel {
  position: relative;
}

.accent-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(235, 230, 221, 0.9));
}

.feature-list,
.stack-list {
  padding-left: 1.1rem;
  margin: 0;
}

.feature-list li,
.stack-list li {
  margin: 0.45rem 0;
}

.hero-stats article,
.metric-card,
.class-card,
.rate-card,
.booking-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.hero-stats article {
  min-width: 9rem;
  padding: 1rem 1.1rem;
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
}

.section-heading,
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.auth-grid,
.admin-grid {
  margin-top: 1.2rem;
}

.auth-grid > *,
.admin-grid > * {
  flex: 1;
}

/* Prioritise returning students before the longer account creation form. */
#login-card {
  order: -1;
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.classes-grid,
.rates-grid,
.bookings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.class-card,
.rate-card,
.booking-card,
.metric-card,
.info-card {
  padding: 1.25rem;
}

.class-card,
.rate-card,
.booking-card {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.meta-row,
.card-footer,
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.class-meta,
.stack-form,
.activity-list {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field span {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(34, 33, 31, 0.18);
  background: #fffdf9;
  font: inherit;
}

.field textarea {
  min-height: 6rem;
  resize: vertical;
}

.waiver-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.44);
}

.waiver-details > h4 {
  margin: 0;
  padding: 0.9rem;
  font-size: 1rem;
}

.waiver-copy {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0 0.9rem 0.9rem;
  font-size: 0.88rem;
}

.modal-waiver-copy {
  max-height: none;
  padding: 0.4rem 0;
}

.waiver-copy h4 {
  margin: 1rem 0 0.3rem;
  font-size: 0.92rem;
}

.waiver-copy p {
  margin: 0.35rem 0;
  line-height: 1.55;
}

.waiver-contact {
  font-weight: 700;
}

.waiver-agreement {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.45;
}

.waiver-agreement input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent-deep);
}

.metric-grid {
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.metric-card {
  flex: 1;
  min-width: 10rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
}

.activity-list {
  margin-top: 1rem;
}

.activity-item {
  align-items: flex-start;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.activity-item:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.class-control-item {
  padding: 1.05rem 0;
}

.class-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.class-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.modal-class-description {
  line-height: 1.7;
}

.attendance-block {
  margin-top: 0.8rem;
}

.attendance-count {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 33, 31, 0.09);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.attendee-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.attendee-list li {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
}

.attendee-list span,
.empty-attendee {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-pill.ready {
  background: rgba(34, 33, 31, 0.1);
  color: var(--accent-deep);
}

.status-pill.pending {
  background: rgba(112, 109, 104, 0.13);
  color: var(--muted);
}

.status-pill.cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 26, 23, 0.36);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(40rem, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 1.35rem;
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
}

.toast {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  z-index: 60;
  max-width: min(24rem, calc(100% - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: #2d2a26;
  color: white;
  box-shadow: 0 22px 48px rgba(37, 31, 27, 0.3);
}

@media (max-width: 980px) {
  .topbar,
  .section-heading,
  .auth-grid,
  .admin-grid,
  .hero {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .nav {
    overflow-x: auto;
  }

  .classes-grid,
  .rates-grid,
  .bookings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .topbar {
    border-radius: 26px;
    align-items: flex-start;
  }

  .topbar-actions,
  .hero-actions,
  .hero-stats,
  .nav,
  .class-control-actions {
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  h1 {
    font-size: 2.8rem;
  }
}

