/* The gym landing page (index.html). DravoFit's web palette, as the operator
   site (apps/operator_web/styles.css, legal.css) and the design system's
   neutrals use it: ink #141414 on a warm canvas #f6f5f1, the focus ring
   #2b55d6 (DfColors.focusRingLight). The gym's seed colour is deliberately
   not used: decision 68 (see landing.js). No web font is loaded -- the
   system stack keeps every request on this origin and covers Arabic. */
:root {
  --canvas: #f6f5f1;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #4e4e4e;
  --line: #d4d3cf;
  --link: #244bc1;
  --focus: #2b55d6;
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
.is-loading body {
  visibility: hidden;
}
body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
  min-height: 100vh;
  margin-inline: auto;
  padding: 40px 16px 28px;
}

.gym {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 12px;
  text-align: center;
}
.gym-mark img,
.gym-mark span {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 20px;
}
.gym-mark img {
  object-fit: contain;
  background: var(--surface);
}
.gym-mark span {
  background: var(--ink);
  color: #fff;
  font-size: 40px;
  font-weight: 700;
  line-height: 88px;
  text-align: center;
}
.gym h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.card p.hint {
  margin-top: 12px;
}
.team {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.team h2 {
  margin: 0;
}

.join {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.qr-code svg {
  display: block;
  width: 200px;
  height: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.qr-light {
  fill: #fff;
}
.qr-dark {
  fill: var(--ink);
}
.qr figcaption {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s;
}
.button-primary {
  align-self: stretch;
  background: var(--ink);
  color: #fff;
}
.button-primary:hover {
  background: var(--focus);
  border-color: var(--focus);
}
.button-secondary {
  background: transparent;
  color: var(--ink);
}
.button-secondary:hover {
  background: var(--ink);
  color: #fff;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 20px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  text-underline-offset: 3px;
}

/* Arabic: any tracking pulls joined letters apart (legal.css), and the
   script wants more line height. */
html[dir='rtl'] .gym h1,
html[dir='rtl'] .card h2 {
  letter-spacing: 0;
  line-height: 1.4;
}
html[dir='rtl'] .card p {
  line-height: 1.9;
}

@media (min-width: 720px) {
  .page {
    max-width: 680px;
    padding-top: 72px;
  }
  /* Side by side on a desktop, where the QR code is the way across to a
     phone: the code first, the words and the button beside it. */
  .members {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 32px;
  }
  .members h2,
  .members > p {
    grid-column: 2;
  }
  .members .join {
    display: contents;
  }
  .members .qr {
    grid-column: 1;
    grid-row: 1 / span 3;
  }
  .members .button-primary {
    grid-column: 2;
    align-self: end;
    justify-self: start;
    margin-top: 20px;
  }
  .members .qr-code svg {
    width: 176px;
    height: 176px;
  }
}

/* Printed, the page is a poster for reception: the gym, the words and a
   large QR code, on white. The staff card, the buttons and the footer are
   for a screen and go; the Staff App's "Open printable page" leads here. */
@media print {
  :root,
  body,
  .card {
    background: #fff;
  }
  .page {
    max-width: none;
    padding: 0;
  }
  .card {
    border: 0;
    padding: 0;
  }
  .members {
    display: block;
    text-align: center;
  }
  .members .join {
    display: flex;
  }
  .members .qr-code svg,
  .qr-code svg {
    width: 320px;
    height: 320px;
    border: 0;
  }
  .team,
  .footer,
  .button,
  .hint {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
