/* TONUS — one stylesheet for every gym. Components use only tokens; brand values arrive at runtime. */
:root {
  --brand-primary: #1f3a5f; --brand-on-primary: #fff;
  --brand-secondary: #22303c; --brand-on-secondary: #fff;
  --brand-accent: #e0a526; --brand-on-accent: #111418;
  --brand-primary-soft: #eef2f7;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f6f7f9; --surface: #fff; --ink: #14181d; --ink-2: #4a5360; --ink-3: #6b7480;
  --line: #e3e6ea; --ok: #157347; --ok-soft: #e6f4ec; --ko: #b42318; --ko-soft: #fdecea; --warn: #8a5a00; --warn-soft: #fff4dc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; font-size: 16px; }
a { color: var(--brand-primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }

/* ---------- buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem;
  border-radius: var(--radius); border: 1px solid transparent; background: var(--brand-primary); color: var(--brand-on-primary);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); color: var(--brand-primary); border-color: var(--line); }
.btn.accent { background: var(--brand-accent); color: var(--brand-on-accent); }
.btn.danger { background: var(--surface); color: var(--ko); border-color: #f1c2bd; }
.btn.small { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .3rem; }
input[type=text], input[type=email], input[type=search], input[type=number], select {
  width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid #c9ced6; border-radius: var(--radius);
  font: inherit; background: var(--surface); color: var(--ink); }
input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1px solid #c9ced6; border-radius: 8px; background: var(--surface); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

/* ---------- cards, lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.stack > * + * { margin-top: 1rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-primary-soft); color: var(--brand-primary); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.ko { background: var(--ko-soft); color: var(--ko); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.flash.errore { background: var(--ko-soft); color: var(--ko); }
.empty { text-align: center; color: var(--ink-3); padding: 1.5rem .5rem; }
.demo-band { background: var(--brand-secondary); color: var(--brand-on-secondary); font-size: .8rem; text-align: center; padding: .3rem .5rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: .5rem; border-bottom: 1px solid var(--line); }
table.data td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- staff app */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.app-top { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--brand-primary); color: var(--brand-on-primary); position: sticky; top: 0; z-index: 5; }
.app-top .brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 700; }
.app-top .brand img { width: 32px; height: 32px; border-radius: 8px; }
.app-top .who { margin-left: auto; font-size: .85rem; opacity: .9; }
.app-top a.out { color: inherit; font-size: .85rem; }
.app-nav { display: flex; gap: .25rem; overflow-x: auto; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-nav a { padding: .5rem .75rem; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.app-nav a.on { background: var(--brand-primary-soft); color: var(--brand-primary); }
.app-main { padding: 1rem; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.1; }
.kpi span { font-size: .85rem; color: var(--ink-3); }
.cols { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.week { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.week .day h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: .4rem; }
.week .day.today h3 { color: var(--brand-primary); }
.slot { display: block; padding: .55rem .65rem; border-radius: calc(var(--radius) - 4px); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brand-primary)); text-decoration: none; color: var(--ink); margin-bottom: .45rem; font-size: .9rem; }
.slot b { display: block; }
.slot small { display: block; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: .35rem; }
.bar i { display: block; height: 100%; background: var(--c, var(--brand-primary)); }
.verdict { padding: .9rem 1rem; border-radius: var(--radius); font-weight: 700; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.ko { background: var(--ko-soft); color: var(--ko); }
.swatch-row { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: center; }
.preview-phone { width: 300px; max-width: 100%; border: 10px solid #1d2329; border-radius: 34px; overflow: hidden; background: var(--bg); margin: 0 auto; box-shadow: 0 12px 30px rgba(0,0,0,.18); }

@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: 2fr 1fr; }
  .cols.even { grid-template-columns: 1fr 1fr; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(6, 1fr); } }

/* ---------- members app */
.m { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }
.m-head { padding: 1rem 1rem 1.25rem; background: var(--brand-primary); color: var(--brand-on-primary); border-radius: 0 0 calc(var(--radius) + 8px) calc(var(--radius) + 8px); }
.m-head .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.m-head .brand img { width: 34px; height: 34px; border-radius: 9px; }
.m-head h1 { margin: 1rem 0 .2rem; font-size: 1.6rem; }
.m-head p { margin: 0; opacity: .92; }
.m-body { padding: 1rem; }
.m-tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 10; }
.m-tabs nav { display: flex; width: 100%; max-width: 560px; }
.m-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0; color: var(--ink-3); text-decoration: none; font-size: .75rem; font-weight: 600; }
.m-tabs a svg { width: 24px; height: 24px; }
.m-tabs a.on { color: var(--brand-primary); }
.m-tabs a.entry { color: var(--brand-on-accent); }
.m-tabs a.entry span.ic { background: var(--brand-accent); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; margin-top: -18px; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.m-tabs a.entry b { color: var(--ink-2); }
.days { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: .75rem; }
.days a { flex: none; width: 56px; padding: .45rem 0; text-align: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.days a small { display: block; font-size: .7rem; text-transform: uppercase; }
.days a b { font-size: 1.1rem; }
.days a.on { background: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }
.days a.on small { color: inherit; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chips a { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .85rem; font-weight: 600; }
.chips a.on { background: var(--brand-primary-soft); border-color: transparent; color: var(--brand-primary); }
.lesson { display: grid; grid-template-columns: 56px 1fr auto; gap: .75rem; align-items: center; }
.lesson .when { text-align: center; font-weight: 700; }
.lesson .when small { display: block; font-weight: 400; }
.qr-wrap { text-align: center; }
.qr-box { background: #fff; padding: 18px; border-radius: 18px; display: inline-block; box-shadow: var(--shadow); border: 1px solid var(--line); }
.qr-box canvas, .qr-box img { display: block; width: 260px; height: 260px; image-rendering: pixelated; }
.qr-timer { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: 260px; margin: 1rem auto 0; }
.qr-timer i { display: block; height: 100%; background: var(--brand-accent); transition: width 1s linear; }
.powered { text-align: center; font-size: .75rem; color: var(--ink-3); padding: 1rem 0 0; }
.status-big { display: flex; align-items: center; gap: .75rem; }
.status-big .ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; }
.status-big.ok .ic { background: var(--ok-soft); color: var(--ok); }
.status-big.ko .ic { background: var(--ko-soft); color: var(--ko); }

/* ---------- reception gate (tablet) */
.gate { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--brand-secondary); color: var(--brand-on-secondary); }
.gate header { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; }
.gate header img { width: 40px; height: 40px; border-radius: 10px; }
.gate header a { margin-left: auto; color: inherit; }
.gate main { display: grid; place-items: center; padding: 1rem; text-align: center; }
.gate .result { width: min(640px, 100%); border-radius: 24px; padding: 2rem 1.5rem; background: rgba(255,255,255,.08); }
.gate .result.ok { background: var(--ok); color: #fff; }
.gate .result.ko { background: var(--ko); color: #fff; }
.gate .result h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 .5rem; }
.gate .result p { font-size: clamp(1.1rem, 3vw, 1.6rem); margin: 0; }
.gate video { width: min(420px, 100%); border-radius: 16px; margin-top: 1rem; background: #000; }
.gate footer { padding: 1rem 1.25rem; }
.gate footer form { display: flex; gap: .5rem; max-width: 640px; margin: 0 auto; }
.gate footer input { background: rgba(255,255,255,.95); }

/* ---------- neutral pages and public site */
.neutral { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.neutral .card { width: min(420px, 100%); }
.neutral .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: 1rem; }
.neutral .brand img { width: 40px; height: 40px; border-radius: 10px; }
.otp { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.demo-box { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.demo-box .row .btn { flex: 1 1 140px; }
.site { --brand-primary: #16324f; --brand-on-primary: #fff; --brand-accent: #e0a526; --brand-on-accent: #111418; --brand-primary-soft: #e8eef5; }
.site-top { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; max-width: 1100px; margin: 0 auto; }
.site-top .logo { font-weight: 800; letter-spacing: .14em; color: var(--brand-primary); text-decoration: none; font-size: 1.2rem; }
.hero { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 18ch; letter-spacing: -.01em; }
.hero p { font-size: 1.15rem; color: var(--ink-2); max-width: 56ch; }
.section { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.grid3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.demo-card { display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.demo-card .top { padding: 1.25rem; color: #fff; }
.demo-card .top b { font-size: 1.3rem; display: block; }
.demo-card .body { padding: 1rem 1.25rem; }
.price b { font-size: 2rem; }
.site-foot { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; color: var(--ink-3); font-size: .85rem; }
/* brand marks */
img.mark { width: auto !important; height: 30px !important; border-radius: 0 !important; }
.m-head img.mark { height: 34px !important; }
.gate img.mark { height: 40px !important; }
.login-logo { text-align: center; margin: .25rem 0 1rem; }
.login-logo img { max-width: 200px; max-height: 180px; width: auto; height: auto; }

/* ======================================================================= members' app · «Performance»
   Dark like a weight room; the gym's accent colour (--brand-accent) is the only light.
   Oswald for big athletic type, Archivo for reading; both self-hosted (no request to Google). */
@font-face { font-family: 'Oswald'; src: url(font/oswald.woff2) format('woff2'); font-weight: 200 700; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url(font/archivo.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

body.ma {
  --ferro: #0A0B12; --ghisa: #14161F; --ghisa2: #1C1F2B; --riga: #262A38; --testo: #F2F2F6; --tenue: #A3A7B8;
  --acc: var(--brand-accent); --on-acc: var(--brand-on-accent); --ok: #3DD68C; --ko: #FF6B6B;
  --ease-out: cubic-bezier(.2,.9,.25,1); --ease-spring: cubic-bezier(.34,1.56,.64,1);
  margin: 0; background: var(--ferro); color: var(--testo); font-family: 'Archivo', system-ui, sans-serif; color-scheme: dark;
}
.ma a { color: inherit }
.ma-app { max-width: 520px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
.ma :focus-visible { outline: 3px solid var(--acc); outline-offset: 3px }
.ma-banner { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: #3A1D22; color: #FFD7D9; font-size: 14px; line-height: 1.4 }
.ma-flash { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--ghisa2); font-size: 14px }
.ma-flash.errore { background: #3A1D22; color: #FFD7D9 }

/* hero */
.ma-hero { position: relative; min-height: 340px; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  background: linear-gradient(180deg, rgba(10,11,18,.35) 0%, rgba(10,11,18,.1) 38%, var(--ferro) 97%), var(--cover, linear-gradient(160deg, var(--brand-primary), var(--ferro))) center 22% / cover; }
.ma-top { display: flex; justify-content: space-between; align-items: center }
.ma-top img { height: 30px; width: auto }
.ma-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--acc); background: rgba(10,11,18,.55); color: var(--acc); font-weight: 700; display: grid; place-items: center; text-decoration: none; backdrop-filter: blur(6px) }
.ma-h { margin: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: clamp(46px, 14vw, 58px); line-height: .9; text-transform: uppercase; letter-spacing: .005em }
.ma-h .ln { display: block; overflow: hidden; padding-bottom: .04em }
.ma-h .ln > span { display: block; animation: ma-up .7s var(--ease-out) both }
.ma-h .ln:nth-child(2) > span { animation-delay: .08s; color: var(--acc) }
.ma-sub { margin: 10px 0 0; font-size: 15px; color: #D9DBE6; line-height: 1.4 }
.ma-state { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; padding: 7px 12px 7px 10px; border-radius: 999px; background: rgba(61,214,140,.14); color: var(--ok) }
.ma-state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor }
.ma-state.ko { background: rgba(255,107,107,.14); color: var(--ko) }

/* stats */
.ma-stats { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 4px 20px 18px }
.ma-ring { position: relative; width: 120px; height: 120px }
.ma-ring svg { width: 100%; height: 100%; transform: rotate(-90deg) }
.ma-ring .track { stroke: var(--ghisa2) }
.ma-ring .val { stroke: var(--acc); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out) }
.ma-ring .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center }
.ma-ring b { font-family: 'Oswald', sans-serif; font-size: 44px; line-height: 1; font-weight: 700 }
.ma-ring small { font-size: 12px; color: var(--tenue) }
.ma-kv { display: flex; flex-direction: column; gap: 10px }
.ma-kv div { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--tenue) }
.ma-kv b { font-family: 'Oswald', sans-serif; font-size: 26px; color: var(--testo); min-width: 2ch; font-weight: 600; font-variant-numeric: tabular-nums }

/* cards */
.ma-card { margin: 0 16px; background: var(--ghisa); border: 1px solid var(--riga); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 6px }
.ma-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.ma-lab { font-size: 13px; font-weight: 700; color: var(--acc) }
.ma-tag { font-size: 12px; font-weight: 700; color: var(--on-acc); background: var(--acc); padding: 4px 9px; border-radius: 999px; white-space: nowrap }
.ma-tag.soft { background: var(--ghisa2); color: var(--testo) }
.ma-card h3 { margin: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: .01em; text-transform: uppercase; line-height: 1.05 }
.ma-card p { margin: 0; font-size: 14px; color: var(--tenue); line-height: 1.45 }
.ma-card .lnk { color: var(--acc); font-weight: 700; text-decoration: none; font-size: 14px }

.ma-cta { margin: 14px 16px 0; display: flex; align-items: center; justify-content: center; gap: 10px; height: 58px; border-radius: 16px; background: var(--acc); color: var(--on-acc) !important; text-decoration: none; font: 700 20px 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 10px 24px rgba(0,0,0,.35); transition: transform .15s var(--ease-out) }
.ma-cta:active { transform: scale(.97) }
.ma-cta svg { width: 22px; height: 22px }

/* live crowd */
.ma-live { margin: 14px 16px 0; background: var(--ghisa); border: 1px solid var(--riga); border-radius: 22px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: end }
.ma-live .row { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--tenue) }
.ma-live .row span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--testo) }
.ma-dot { width: 7px; height: 7px; border-radius: 50%; background: #FF6B3D; animation: ma-blink 2s infinite }
.ma-live .big { font-family: 'Oswald', sans-serif; font-size: 40px; font-weight: 700; line-height: 1; display: flex; align-items: baseline; gap: 6px }
.ma-live .big small { font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 600; color: var(--tenue) }
.ma-bars { display: flex; align-items: flex-end; gap: 3px; height: 46px }
.ma-bars span { flex: 1; min-height: 3px; background: var(--ghisa2); border-radius: 3px 3px 1px 1px; transform-origin: bottom; animation: ma-grow .7s var(--ease-out) both }
.ma-bars span.now { background: var(--acc) }

/* sections and class cards */
.ma-sec { margin: 24px 20px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px }
.ma-sec h2 { margin: 0; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 21px; text-transform: uppercase; letter-spacing: .02em }
.ma-sec span, .ma-sec a { font-size: 13.5px; color: var(--tenue) }
.ma-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 16px 6px; scrollbar-width: none }
.ma-rail::-webkit-scrollbar { display: none }
.ma-cls { flex: none; width: 164px; scroll-snap-align: start; background: var(--ghisa); border: 1px solid var(--riga); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 3px; transition: border-color .3s }
.ma-cls .t { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700 }
.ma-cls .n { font-size: 15px; font-weight: 700 }
.ma-cls .s { font-size: 12.5px; color: var(--tenue) }
.ma-cls.booked { border-color: var(--acc) }
.ma-cls form { margin-top: auto; padding-top: 10px }
.ma-book { width: 100%; height: 40px; border-radius: 12px; border: 1.5px solid var(--acc); background: transparent; color: var(--acc); font: 700 14px 'Archivo', sans-serif; cursor: pointer; display: grid; place-items: center; transition: background .25s, color .25s }
.ma-book.done { background: var(--acc); color: var(--on-acc) }
.ma-book.wait { background: var(--ghisa2); border-color: var(--riga); color: var(--testo) }
.ma-book[disabled] { opacity: .45; cursor: default }
.ma-book .sp { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: ma-spin .7s linear infinite }
.ma-book svg { width: 18px; height: 18px }
.ma-book svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ma-draw .35s .05s var(--ease-out) forwards }
.ma-empty { margin: 0 16px; padding: 18px; border-radius: 18px; border: 1px dashed var(--riga); color: var(--tenue); font-size: 14px; line-height: 1.45 }
.ma-empty a { color: var(--acc); font-weight: 700 }
.ma-pw { text-align: center; margin: 26px 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #6D7185; display: flex; justify-content: center; align-items: center; gap: 6px }
.ma-pw img { width: 12px; height: 12px; opacity: .7 }

/* page header for the other tabs */
.ma-head { padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 8px; display: flex; flex-direction: column; gap: 6px }
.ma-head .ma-top { margin-bottom: 10px }
.ma-head h1 { margin: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 40px; text-transform: uppercase; line-height: 1 }
.ma-head p { margin: 0; color: var(--tenue); font-size: 14.5px }

/* schedule */
.ma-days { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 4px; scrollbar-width: none }
.ma-days::-webkit-scrollbar { display: none }
.ma-days a { flex: none; width: 54px; padding: 8px 0; border-radius: 14px; background: var(--ghisa); border: 1px solid var(--riga); text-align: center; text-decoration: none; display: flex; flex-direction: column }
.ma-days small { font-size: 10.5px; font-weight: 700; color: var(--tenue); text-transform: uppercase }
.ma-days b { font-family: 'Oswald', sans-serif; font-size: 22px }
.ma-days a.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc) }
.ma-days a.on small { color: var(--on-acc) }
.ma-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 4px }
.ma-chips a { font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--ghisa); border: 1px solid var(--riga); text-decoration: none; color: var(--tenue) }
.ma-chips a.on { color: var(--acc); border-color: var(--acc) }
.ma-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px }
.ma-lesson { display: grid; grid-template-columns: 62px minmax(0,1fr) 112px; gap: 12px; align-items: center; background: var(--ghisa); border: 1px solid var(--riga); border-radius: 18px; padding: 14px }
.ma-lesson.booked { border-color: var(--acc) }
.ma-lesson .t { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 700; line-height: 1 }
.ma-lesson .t small { display: block; font-family: 'Archivo', sans-serif; font-size: 11.5px; font-weight: 600; color: var(--tenue); margin-top: 4px }
.ma-lesson .n { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 7px }
.ma-lesson .n i { width: 9px; height: 9px; border-radius: 50%; flex: none }
.ma-lesson .s { font-size: 12.5px; color: var(--tenue); margin-top: 2px }
.ma-fill { height: 4px; background: var(--ghisa2); border-radius: 2px; margin-top: 8px; overflow: hidden }
.ma-fill i { display: block; height: 100%; background: var(--acc); border-radius: 2px }

/* membership card */
.ma-cardwrap { padding: 8px 20px 0; perspective: 1400px }
.ma-tessera { position: relative; width: 100%; aspect-ratio: 1.586; max-width: 100%; border: none; padding: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .7s var(--ease-out); display: block; font: inherit; color: inherit; text-align: left }
.ma-tessera.flipped { transform: rotateY(180deg) }
.ma-tessera .face { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08) }
.ma-tessera .front { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 92%, transparent), color-mix(in srgb, var(--brand-secondary) 70%, transparent)), var(--card-photo, var(--brand-secondary)) center / cover }
.ma-tessera .front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.22) 46%, transparent 60%); transform: translateX(-120%); animation: ma-sheen 1.6s .6s var(--ease-out) both }
.ma-tessera .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1 }
.ma-tessera .logo { height: 56px; width: auto; max-width: 60% }
.ma-tessera .logo-txt { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; text-transform: uppercase }
.ma-tessera .chip { font-size: 11px; font-weight: 800; letter-spacing: .14em; background: var(--acc); color: var(--on-acc); padding: 5px 9px; border-radius: 7px }
.ma-tessera .who { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px }
.ma-tessera .name { font-family: 'Oswald', sans-serif; font-size: clamp(22px, 6.6vw, 30px); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.05 }
.ma-tessera .plan { font-size: 13.5px; opacity: .92 }
.ma-tessera .num { position: relative; z-index: 1; display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .14em; opacity: .85; font-variant-numeric: tabular-nums }
.ma-tessera .back { transform: rotateY(180deg); background: #fff; color: #10121C; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px 18px }
.ma-tessera .back canvas { width: min(42vw, 170px); height: auto; aspect-ratio: 1; image-rendering: pixelated; display: block }
.ma-tessera .back .txt { display: block; font-size: 13.5px; line-height: 1.4; color: #3C4050 }
.ma-tessera .back b { display: block; font-family: 'Oswald', sans-serif; font-size: 20px; color: #10121C; text-transform: uppercase; margin-bottom: 4px }
.ma-tessera .back .bar { display: block; height: 4px; background: #E6E8EF; border-radius: 2px; margin-top: 10px; overflow: hidden }
.ma-tessera .back .bar i { display: block; height: 100%; width: 100%; background: var(--acc); transition: width 1s linear }
.ma-hint { text-align: center; color: var(--tenue); font-size: 13px; line-height: 1.45; margin: 14px 0 0; padding: 0 24px }
.ma-actions { display: flex; gap: 10px; padding: 14px 16px 0 }
.ma-btn { flex: 1; height: 48px; border-radius: 14px; border: 1.5px solid var(--riga); background: var(--ghisa); color: var(--testo); font: 700 14.5px 'Archivo', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none }
.ma-btn svg { width: 18px; height: 18px }
.ma-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px }
.ma-kvs div { background: var(--ghisa); border: 1px solid var(--riga); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px }
.ma-kvs small { font-size: 12px; color: var(--tenue) }
.ma-kvs b { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 600 }
.ma-rows { margin: 0 16px; background: var(--ghisa); border: 1px solid var(--riga); border-radius: 18px; padding: 4px 16px }
.ma-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--riga); font-size: 14.5px }
.ma-rows > div:first-child { border-top: none }
.ma-rows small { display: block; font-size: 12.5px; color: var(--tenue) }
.ma-pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--ghisa2); color: var(--tenue); white-space: nowrap }
.ma-pill.ok { background: rgba(61,214,140,.14); color: var(--ok) }
.ma-pill.ko { background: rgba(255,107,107,.14); color: var(--ko) }

/* the pass: full screen QR, opened from the gold button */
.ma-pass { position: fixed; inset: 0; z-index: 50; background: var(--ferro); color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(18px + env(safe-area-inset-top, 0px)) 24px calc(26px + env(safe-area-inset-bottom, 0px)) }
.ma-pass[hidden] { display: none !important }
.ma-pass .x { align-self: flex-end; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--ghisa2); color: #fff; font-size: 24px; cursor: pointer; display: grid; place-items: center; text-decoration: none }
.ma-pass .mark { height: 30px; margin-top: -26px }
.ma-pass h2 { margin: 6px 0 4px; font-family: 'Oswald', sans-serif; font-size: 34px; font-weight: 700; text-transform: uppercase }
.ma-pass .sub { margin: 0; font-size: 14px; color: var(--tenue); text-align: center }
.ma-qrbox { position: relative; margin-top: 24px; width: min(276px, 76vw); aspect-ratio: 1; display: grid; place-items: center }
.ma-qrbox svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg) }
.ma-qrbox .t-track { stroke: var(--ghisa2) }
.ma-qrbox .t-val { stroke: var(--acc); stroke-linecap: round }
.ma-qrcard { width: 64%; aspect-ratio: 1; background: #fff; border-radius: 20px; padding: 12px; position: relative; overflow: hidden; box-sizing: border-box }
.ma-qrcard canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated }
.ma-qrcard .shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--acc) 60%, transparent) 50%, transparent 65%); transform: translateX(-120%) }
.ma-qrcard.refresh .shine { animation: ma-shine .7s var(--ease-out) }
.ma-pass .count { margin-top: 14px; font-size: 13.5px; color: var(--tenue); font-variant-numeric: tabular-nums }
.ma-pass .who { margin-top: auto; text-align: center; font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em }
.ma-pass .who small { display: block; font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--tenue); margin-top: 4px }
.ma-result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; clip-path: circle(0% at 50% 45%); background: var(--acc); color: var(--on-acc) }
.ma-result.ko { background: #B4232C; color: #fff }
.ma-result.show { animation: ma-reveal .55s var(--ease-out) forwards }
.ma-result .check { width: 96px; height: 96px; border-radius: 50%; background: rgba(0,0,0,.85); display: grid; place-items: center }
.ma-result .check svg { color: var(--acc) }
.ma-result.ko .check { background: rgba(255,255,255,.18) }
.ma-result.ko .check svg { color: #fff }
.ma-result .check path { stroke-dasharray: 40; stroke-dashoffset: 40 }
.ma-result.show .check path { animation: ma-draw .45s .3s var(--ease-out) forwards }
.ma-result h2 { margin: 0; font-family: 'Oswald', sans-serif; font-size: 40px; font-weight: 700; text-transform: uppercase; line-height: 1 }
.ma-result p { margin: 0; font-size: 15.5px; font-weight: 600; max-width: 30ch }
.ma-bit { position: absolute; left: 50%; top: 42%; width: 8px; height: 8px; border-radius: 2px; background: var(--ferro); opacity: 0 }
.ma-result.ko .ma-bit { display: none }
.ma-result.show .ma-bit { animation: ma-burst .9s .35s var(--ease-out) forwards }

/* toast */
.ma-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: min(488px, calc(100% - 28px)); transform: translate(-50%, calc(100% + 140px)); visibility: hidden; background: #F2F2F6; color: #0A0B12; border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; z-index: 40; transition: transform .35s var(--ease-spring), visibility 0s .35s }
.ma-toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease-spring), visibility 0s }
.ma-toast.errore { background: #FFD7D9; color: #5C0A10 }
.ma-toast button { background: none; border: none; color: var(--brand-primary); font: 800 14px 'Archivo', sans-serif; cursor: pointer; padding: 6px }

/* tab bar */
.ma-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(10,11,18,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--riga); padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) }
.ma-tabs nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr) }
.ma-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 4px; font-size: 11.5px; font-weight: 600; color: #7A7E92; text-decoration: none }
.ma-tabs a svg { width: 23px; height: 23px }
.ma-tabs a.on { color: var(--acc) }
.ma-tabs a.on::before { content: ''; position: absolute; top: -6px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: var(--acc); animation: ma-tab .38s var(--ease-spring) both }

.ma-rise { animation: ma-rise .55s var(--ease-out) both }
.ma-roll { display: inline-block; animation: ma-roll .35s var(--ease-out) }
@keyframes ma-up { from { transform: translateY(105%) } }
@keyframes ma-rise { from { opacity: 0; transform: translateY(14px) } }
@keyframes ma-grow { from { transform: scaleY(0) } }
@keyframes ma-spin { to { transform: rotate(360deg) } }
@keyframes ma-draw { to { stroke-dashoffset: 0 } }
@keyframes ma-blink { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
@keyframes ma-shine { to { transform: translateX(120%) } }
@keyframes ma-sheen { to { transform: translateX(120%) } }
@keyframes ma-reveal { to { clip-path: circle(150% at 50% 45%) } }
@keyframes ma-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0) } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(220deg) } }
@keyframes ma-roll { from { transform: translateY(60%); opacity: 0 } }
@keyframes ma-tab { from { transform: scaleX(0) } }
@media (prefers-reduced-motion: reduce) {
  body.ma *, body.ma *::before, body.ma *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important }
}

/* ======================================================================= staff forms in a grid (Abbonamento Grynta) */
input:not([type]), input[type=tel], input[type=date] { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid #c9ced6; border-radius: 8px; font: inherit; background: var(--surface); color: inherit; box-sizing: border-box; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
.form-grid > div { margin-top: 1rem; }
.form-grid .span2 { grid-column: 1 / -1; }
.field-err { display: block; color: var(--ko); font-weight: 600; margin-top: .3rem; }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; margin: 1rem 0; }
label.check input { margin-top: .2rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* the gym's billing form (viste/_fatturazione.php), on the Abbonamento Grynta page */
.bp-form [hidden] { display: none !important; }
.bp-t { display: block; font-weight: 700; margin: 1rem 0 .3rem; }
.bp-natura { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.bp-natura .bp-t { flex-basis: 100%; margin-bottom: 0; }
.bp-natura .field-err { flex-basis: 100%; }
.bp-scelta { display: inline-flex; align-items: center; gap: .5rem; margin: 0; min-height: 44px; padding: 0 1rem; border: 1px solid #c9ced6; border-radius: 999px; cursor: pointer; }
.bp-scelta:has(input:checked) { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.bp-titolare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; margin-top: .75rem; padding: 0 0 .5rem 1rem; border-left: 3px solid var(--brand-primary-soft); }
.bp-titolare .bp-t, .bp-titolare > .field-err { grid-column: 1 / -1; }
.bp-esito { display: block; margin-top: .3rem; font-weight: 600; }
.bp-esito[data-stato=ok] { color: var(--ok); }
.bp-esito[data-stato=ko] { color: var(--ko); }
.bp-form [data-cf], .bp-form [name=codice_sdi], .bp-form [name=provincia] { text-transform: uppercase; }
.bp-avviso { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.bp-avviso a { color: inherit; }
@media (max-width: 640px) { .bp-titolare { grid-template-columns: 1fr; } }
