/* The Wellness Club by Oshi - palette and type sampled from the client mockup. */

@font-face {
  font-family: 'Afta Sans';
  src: url('/fonts/AftaSansThin-Regular.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Trampolina';
  src: url('/fonts/FbTrampolina-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --topbar: #eae3d9;
  --nav: #c1b2af;
  --cream: #f3f0e7;
  --sand: #dad4c4;
  --ink: #2b2724;
  --ink-soft: #6b625d;
  --ink-faint: #8d827c;
  --btn: #3c3c3a;
  --line: rgba(43, 39, 36, 0.14);
  --white: #fffdfa;
  --danger: #9c4f43;
  --ok: #4f7355;
  --warn: #a8792f;

  --shell: 1180px;
  --gutter: 20px;
  --radius: 10px;

  --sans: 'Assistant', 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --display: 'Afta Sans', 'Trampolina', var(--sans);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* `height: auto` is essential: the width/height attributes on an <img> are
   applied as presentational hints, so overriding only the width stretches the
   image vertically. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- header */

.topbar {
  background: linear-gradient(105deg, #efe9e0 0%, #e7ded6 45%, #d9c9c6 100%);
  text-align: center;
  padding: 26px 16px 22px;
}
.topbar a {
  font-family: var(--display);
  font-size: clamp(17px, 4.6vw, 40px);
  letter-spacing: clamp(0.08em, 1.1vw, 0.2em);
  text-decoration: none;
  color: var(--ink);
  font-weight: 300;
  white-space: nowrap;
}

.nav {
  background: var(--nav);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px var(--gutter);
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 7px 13px;
  font-size: 15px;
  border-radius: 3px;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.nav a:hover { background: rgba(43, 39, 36, 0.1); }
.nav a[aria-current='page'],
.nav a.is-cta { background: var(--btn); color: #fff; }
.nav a.is-muted { color: rgba(43, 39, 36, 0.62); font-family: var(--display); letter-spacing: 0.12em; }
.nav a.is-muted:hover { background: none; cursor: default; }

/* Nav collapses into a disclosure on phones so it never wraps to 3 rows. */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  padding: 10px var(--gutter);
  width: 100%;
  text-align: start;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; align-items: center; gap: 10px; }
  .nav-inner {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 14px;
  }
  .nav.is-open .nav-inner { display: flex; }
  .nav a { padding: 11px 13px; }
}

/* ------------------------------------------------------------ book rows */

.book-row {
  padding: clamp(40px, 7vw, 86px) 0;
  background-color: var(--cream);
}
.book-row.is-sand { background-color: var(--sand); }

.book-row-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
}

.book-copy {
  max-width: 460px;
  /* The copy column sits on the left in the mockup; push it there. */
  margin-inline-start: auto;
}

.book-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(34px, 6.4vw, 62px);
  line-height: 1.16;
  letter-spacing: 0.07em;
  margin: 0 0 18px;
  text-transform: uppercase;
  /* Latin title, set flush left like the mockup. */
  direction: ltr;
  text-align: left;
}

.book-desc {
  color: var(--ink-soft);
  margin: 0 0 22px;
  font-size: clamp(14px, 1.6vw, 16px);
}

.book-art { position: relative; }
.book-art img {
  width: 100%;
  height: auto;
  filter: drop-shadow(18px 22px 34px rgba(43, 39, 36, 0.26));
}

/* Stands in for a book whose cover art does not exist yet. Deliberately not
   another book's cover, which would read as the same product. The spine and
   page edge keep it reading as a book next to the real 3-D mockup. */
.book-placeholder {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 76%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 10% 12%;
  background: linear-gradient(150deg, #4a4643 0%, #35312e 55%, #2b2724 100%);
  color: #ded6cd;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 16px 20px 32px rgba(43, 39, 36, 0.3);
}
/* The page block along the spine edge. */
.book-placeholder::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: -7px;
  width: 7px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #cfc7bd, #efe9e0 45%, #b9b0a6);
}
.book-placeholder-title {
  font-family: var(--display);
  font-size: clamp(20px, 3.4vw, 34px);
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.book-placeholder-note {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(222, 214, 205, 0.6);
}

.book-badge {
  display: inline-block;
  background: rgba(43, 39, 36, 0.08);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.book-badge.is-owned { background: var(--ok); color: #fff; border-color: transparent; }

@media (max-width: 860px) {
  .book-row-inner { grid-template-columns: 1fr; }
  .book-copy { max-width: none; margin-inline-start: 0; text-align: center; }
  .book-art { max-width: 340px; margin-inline: auto; }
  .book-title { text-align: center; }
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
  border: 0;
  padding: 13px 30px;
  font: inherit;
  font-size: 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: none;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------------------------------------------------------------- cards */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
}

.page-head {
  padding: clamp(28px, 5vw, 52px) 0 clamp(18px, 3vw, 28px);
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: 0.09em;
  font-size: clamp(28px, 5vw, 46px);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.page-head p { margin: 0; color: var(--ink-soft); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 18px;
}

/* Account and dashboard read better on a narrower measure than the 1180px
   marketing shell, and a lone book card does not get stranded on a wide row. */
.shell-narrow { max-width: 900px; }
.shell-narrow .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.3; }
.stat span { color: var(--ink-faint); font-size: 13px; }

/* ------------------------------------------------- marketing book page

   Deliberately NOT .stat/.panel. Those are dashboard furniture and earn their
   borders in /admin, where a card really is a discrete record. On the sales
   page the same chrome turned every block into an identical white rectangle,
   so the page read as a form rather than as a book. Here the structure is
   carried by type, rule and space instead: nothing is boxed.
*/

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}

/* Four figures set as newspaper columns. The hairlines sit *between* the
   columns, never around them, and are re-cut at each breakpoint so a wrapped
   row never leaves a rule dangling at its start edge. */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding-top: clamp(26px, 3.4vw, 40px);
}
.fact { padding-inline: clamp(14px, 2.2vw, 30px); }
.fact + .fact { border-inline-start: 1px solid var(--line); }
.fact:first-child { padding-inline-start: 0; }
.fact:last-child { padding-inline-end: 0; }

.fact b {
  display: block;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(40px, 5.4vw, 60px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  /* Afta Sans carries the digits; Hebrew has no glyphs there and falls through
     to Trampolina, which is why the label below looks different on purpose. */
  font-variant-numeric: lining-nums;
}
.fact strong {
  display: block;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.fact span {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); row-gap: clamp(24px, 5vw, 34px); }
  .fact { padding-inline: clamp(14px, 3vw, 24px); }
  .fact:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .fact:nth-child(even) { padding-inline-end: 0; }
}
@media (max-width: 430px) {
  .facts { grid-template-columns: 1fr; row-gap: 26px; }
  .fact,
  .fact:nth-child(even) { border-inline-start: 0; padding-inline: 0; }
  .fact b { font-size: 38px; }
}

/* A contents list, because the product is a book. The heading holds its own
   column so the list is not competing with it for the reader's first look. */
.contents {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) 1fr;
  gap: clamp(18px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 86px);
}
.contents h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin: 0;
}
.contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contents-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(14px, 2.4vw, 26px);
  align-items: baseline;
  padding: clamp(14px, 2vw, 19px) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.65;
}
.contents-list .n {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  /* Keeps 01-05 in one rhythm regardless of glyph widths. */
  font-variant-numeric: tabular-nums lining-nums;
}

@media (max-width: 700px) {
  .contents { grid-template-columns: 1fr; gap: 18px; }
}

/* Fine print is fine print. It had the same border and background as the
   contents above it, which gave a legal note the weight of a selling point. */
.fineprint {
  margin-top: clamp(26px, 3.6vw, 38px);
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--line);
  color: var(--ink-faint);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 70ch;
}
.fineprint strong { color: var(--ink-soft); font-weight: 600; }

/* Running prose. Body copy does not need a card around it - the measure and the
   leading do the containing. (The contact form keeps its .panel: grouping a set
   of inputs is what a panel is actually for.) */
.prose {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.85;
}
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose .lede {
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.7;
}

/* The closing line is a credo, not an afterthought - it was set in muted grey
   at the bottom of a box, which buried it. */
.credo {
  margin: clamp(30px, 4.5vw, 44px) 0 0;
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--ink);
  max-width: 64ch;
}

.quiet-note {
  max-width: 44ch;
  margin-inline: auto;
  text-align: center;
  color: var(--ink-faint);
  line-height: 1.8;
}

/* --------------------------------------------------------------- forms */

label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font: inherit;
  color: var(--ink);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--btn);
  outline-offset: 2px;
}

.field { margin-bottom: 16px; }

.code-input {
  letter-spacing: 0.6em;
  text-align: center;
  font-size: 26px;
  padding-inline-start: 0.6em; /* balance the trailing letter-spacing */
}

.note {
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.note-error { background: #f7e9e6; color: var(--danger); border-color: #e5cdc7; }
.note-ok { background: #e8f0e9; color: var(--ok); border-color: #cfe0d2; }
.note-info { background: #f0ece3; color: var(--ink-soft); border-color: var(--line); }
.note-warn { background: #f7efdf; color: var(--warn); border-color: #ecdcbd; }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: rgba(43, 39, 36, 0.03); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.pill-ok { background: #e8f0e9; color: var(--ok); }
.pill-warn { background: #f7efdf; color: var(--warn); }
.pill-crit { background: #f7e9e6; color: var(--danger); }
.pill-muted { background: rgba(43, 39, 36, 0.07); color: var(--ink-soft); }

/* -------------------------------------------------------------- footer */

.footer {
  background: var(--btn);
  color: #cfc7c0;
  padding: 34px var(--gutter);
  text-align: center;
  font-size: 13px;
  margin-top: 60px;
}
.footer a { color: #fff; }
.footer .strap { letter-spacing: 0.2em; margin-bottom: 8px; font-family: var(--display); }

.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.narrow { max-width: 440px; margin-inline: auto; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

@media print {
  /* The reader is not a printable document. */
  body { display: none !important; }
}

/* ------------------------------------------------------------- checkout */

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-bottom: 70px;
}

.checkout-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}

.checkout-login-hint {
  font-size: 14px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-section {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}
.form-section legend {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0 12px;
  margin-bottom: 4px;
  width: 100%;
  border-bottom: 1px solid var(--line);
}

/* City and postcode share a row on anything wider than a small phone. */
.field-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.field-hint,
.field-error {
  display: block;
  font-size: 12.5px;
  margin-top: 5px;
  line-height: 1.5;
}
.field-hint { color: var(--ink-faint); }
.field-error { color: var(--danger); }

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
  background: #fdf7f6;
}

label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  cursor: pointer;
}
label.check input {
  width: auto;
  margin-top: 4px;
  flex: none;
  accent-color: var(--btn);
}
label.check.has-error span { color: var(--danger); }

.invoice-fields {
  margin-top: 14px;
  padding-inline-start: 26px;
  border-inline-start: 2px solid var(--line);
}

.checkout-submit { margin-top: 22px; font-size: 16px; padding: 15px 30px; }
.checkout-secure { font-size: 12.5px; margin: 12px 0 0; }

/* --------------------------------------------------------- order summary */

.checkout-summary-inner {
  background: var(--sand);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 76px;
}
.checkout-summary h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 17px;
  text-transform: uppercase;
}
.checkout-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(43, 39, 36, 0.16);
}
.checkout-item img {
  width: 62px;
  flex: none;
  filter: drop-shadow(4px 6px 10px rgba(43, 39, 36, 0.28));
}
.checkout-item strong { display: block; font-size: 15px; }
.checkout-item .muted { font-size: 12.5px; }

.checkout-lines { margin: 16px 0; font-size: 14px; }
.checkout-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.checkout-lines dt { color: var(--ink-soft); margin: 0; }
.checkout-lines dd { margin: 0; }
.checkout-lines .is-total {
  border-top: 1px solid rgba(43, 39, 36, 0.16);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 600;
}

.checkout-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.checkout-perks li {
  padding-inline-start: 20px;
  position: relative;
  margin-bottom: 7px;
}
.checkout-perks li::before {
  content: '✓';
  position: absolute;
  inset-inline-start: 0;
  color: var(--ok);
  font-weight: 700;
}

.success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 30px;
  line-height: 58px;
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid var(--line);
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

@media (max-width: 880px) {
  .checkout { grid-template-columns: 1fr; }
  /* The summary leads on a phone, so the price is seen before the form. */
  .checkout-summary { order: -1; }
  .checkout-summary-inner { position: static; }
}

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

.cta-pair {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 860px) {
  .cta-pair { justify-content: center; }
}

.form-consents {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 26px;
}

/* -------------------------------------------------------- video uploader */

.video-upload {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 18, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.video-upload[hidden] { display: none; }

.video-upload-inner {
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
}
.video-upload-inner h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-family: var(--display);
  letter-spacing: 0.06em;
}
.video-upload-inner input[type='file'] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--cream);
  font: inherit;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.upload-bar {
  flex: 1;
  height: 7px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
  border-radius: 99px;
  transition: width 200ms linear;
}
.upload-progress .muted {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  min-width: 40px;
}
