/* App dei soci — tema chiaro bianco e verde tennis (OG-01).
   Colore del circolo: basta impostare --brand su <html> (es. style="--brand:#1f6f8b"):
   tinte chiare, bordi e varianti scure si ricavano da lì. */
:root {
  --brand: #2e7d4f;
  --brand-strong: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-2: color-mix(in srgb, var(--brand) 82%, #fff);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 30%, #fff);
  --ball: #d6ec34;

  --bg: #f6faf7; --paper: #ffffff; --line: #e3ece6; --line2: #d3e0d7;
  --ink: #15281e; --text: #2b3a31; --muted: #5d6c63; --dim: #9aa8a0;
  --amber: #a35f00; --amber-soft: #fff3dc; --amber-line: #f3c983;
  --bad: #c62a43; --bad-soft: #fdebee;
  --busy: #f0f2f1; --busy2: #e3e7e5;

  /* nomi storici ancora usati nel markup (stili in linea): restano come alias */
  --blue: var(--brand); --blue2: var(--brand-2); --blue-soft: var(--brand-soft);
  --green: var(--brand); --green2: var(--brand-2); --green-soft: var(--brand-soft); --green-line: var(--brand-line);
  --sun: var(--ball); --sun2: #e0a526; --sun-soft: #f5f9dc;
  --grad-blue: var(--brand); --grad-go: var(--brand); --grad-sun: var(--amber-soft);

  --r: 16px; --shadow: 0 10px 30px -18px rgba(21, 40, 30, .28); --shadow-s: 0 1px 2px rgba(21, 40, 30, .06);
  --ff: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --fd: var(--ff);
  --row: 46px; --tap: 44px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; color: var(--text); font: 15px/1.45 var(--ff); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background: var(--bg); overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:is(button, a, input, select):focus-visible { outline: 3px solid var(--brand-line); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

/* intestazione con la pallina in alto a destra */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 58px 10px 16px; position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top::after { content: ''; position: absolute; right: 12px; top: calc(50% + env(safe-area-inset-top) / 2); width: 32px; height: 32px; transform: translateY(-50%);
  background: url('/img/pallina.svg') center / contain no-repeat; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 44px; width: auto; flex: none; }
.brand > div { min-width: 0; }
.brand strong { display: block; font-weight: 700; font-size: 16px; line-height: 1.15; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-align: right; flex: none; }
.who .av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.who .tag-socio { display: block; font-weight: 650; color: var(--brand); }
.view { padding: 16px 16px 24px; flex: 1; animation: in .3s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

h1, h2, h3 { font-family: var(--fd); color: var(--ink); margin: 0; letter-spacing: -.015em; }
h1 { font-size: 27px; line-height: 1.12; font-weight: 750; }
h1 em, h2 em { font-style: normal; color: var(--brand); }
h2 { font-size: 19px; font-weight: 700; margin: 22px 0 10px; }
.lead { color: var(--muted); margin: 6px 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--brand); font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }

/* barra in basso */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(520px, calc(100% - 20px)); z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 5px; border-radius: 20px;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tabs button { position: relative; min-height: 52px; white-space: nowrap; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 4px; border-radius: 15px; font-size: 11.5px; font-weight: 650; transition: background .2s, color .2s; }
.tabs button.on { color: var(--brand-strong); background: var(--brand-soft); }
.tabs .dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--sun2); border: 2px solid #fff; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-s); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); border: 0; border-radius: 13px; padding: 12px 18px; font-weight: 650; font-size: 15px; transition: transform .12s, background .2s, opacity .2s; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-p { background: var(--brand); color: #fff; }
.btn-p:hover { background: var(--brand-strong); }
.btn-sun { background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line); }
.btn-g { background: #fff; color: var(--ink); border: 1px solid var(--line2); }
.btn-d { background: var(--bad-soft); color: var(--bad); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 12px 0 0; min-height: var(--tap); }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; min-height: var(--tap); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--busy); padding: 4px; border-radius: 13px; margin-bottom: 14px; }
.seg button { border: 0; background: none; min-height: 40px; padding: 9px; border-radius: 10px; color: var(--muted); font-weight: 650; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(21, 40, 30, .12); }

/* accesso: campo stilizzato in verde chiaro, nessun gradiente */
.hero { position: relative; margin: 4px 0 18px; padding: 22px 20px 20px; border-radius: 20px; overflow: hidden; color: var(--ink); background: var(--brand-soft); border: 1px solid var(--brand-line); }
.hero .ball { display: none; } /* la pallina è già nell'intestazione */
.hero .court { position: absolute; right: -10px; bottom: -36px; width: 180px; height: 120px; border: 2px solid var(--brand-line); border-radius: 4px; transform: perspective(240px) rotateX(48deg); }
.hero .court::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid var(--brand-line); }
.hero .court::after { content: ''; position: absolute; left: 14%; right: 14%; top: 26%; bottom: 26%; border: 2px solid var(--brand-line); }
.hero > *:not(.court):not(.ball) { position: relative; }
.hero .eyebrow { color: var(--brand); }
.hero h1 { color: var(--ink); font-size: 27px; margin-top: 8px; max-width: 92%; }
.hero h1 em { color: var(--brand); }
.hero p { color: var(--text); margin: 10px 0 14px; max-width: 92%; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hero .chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #fff; color: var(--brand-strong); border: 1px solid var(--brand-line); font-size: 12px; font-weight: 600; }
.hero .chips .ico { width: 15px; height: 15px; }
.demo-acc { margin-top: 18px; }
.demo-acc .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.demo-acc button { text-align: left; min-height: var(--tap); border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 10px 11px; transition: border-color .2s; }
.demo-acc button:hover { border-color: var(--brand); }
.demo-acc b { display: block; font-size: 13.5px; color: var(--ink); }
.demo-acc small { color: var(--muted); font-size: 11.5px; }

/* prenota */
.courts { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 6px; padding: 2px 16px 6px; scrollbar-width: none; }
.courts::-webkit-scrollbar, .dates::-webkit-scrollbar { display: none; }
.courts button { flex: none; min-height: var(--tap); border: 1px solid var(--line2); background: #fff; border-radius: 12px; padding: 9px 13px; font-weight: 650; }
.courts button.on { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.dates { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 6px; padding: 4px 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.date { flex: none; width: 58px; padding: 9px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: center; transition: background .2s, border-color .2s; scroll-snap-align: center; }
.date small { display: block; font-size: 11px; color: var(--muted); text-transform: capitalize; font-weight: 600; }
.date b { display: block; font-weight: 750; font-size: 20px; line-height: 1.15; color: var(--ink); }
.date i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.date.on { background: var(--brand); border-color: var(--brand); }
.date.on small, .date.on b, .date.on i { color: #fff; }
.date.we:not(.on) small { color: var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin: 8px 0 12px; font-weight: 550; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.legend .l-free { background: #fff; border: 1.5px solid var(--brand-line); }
.legend .l-busy { background: var(--busy2); }
.legend .l-mine { background: var(--brand); }
.legend .l-pend { background: var(--amber-soft); border: 1.5px dashed var(--amber-line); }
.daysum { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 2px 0 10px; }
.daysum b { font-weight: 700; font-size: 17px; color: var(--ink); text-transform: capitalize; }
.daysum span { font-size: 12.5px; color: var(--brand-strong); font-weight: 650; background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; }
.daysum span.none { color: var(--muted); background: var(--busy); }

.tl { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-auto-rows: var(--row); column-gap: 10px; row-gap: 6px; position: relative; }
.tl .hr { font: 600 12.5px/var(--row) var(--ff); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tl .hr.full { color: var(--ink); font-weight: 700; }
.tl .gap { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.tl .gap::before, .tl .gap::after { content: ''; flex: 1; border-top: 1px dashed var(--line2); }
.cell { grid-column: 2; border-radius: 12px; border: 1px solid transparent; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; text-align: left; min-width: 0; transition: transform .12s, border-color .2s, background .2s; }
.cell b { font-size: 14px; font-weight: 700; }
.cell small { font-size: 12px; opacity: .85; }
.cell .lab { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.2; }
.cell .lab small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.libero { background: #fff; border-color: var(--brand-line); color: var(--brand-strong); }
.cell.libero .ico { color: var(--brand); width: 22px; height: 22px; }
.cell.libero:active { transform: scale(.99); }
.cell.libero:hover { background: var(--brand-soft); border-color: var(--brand); }
.cell.occupato { background: var(--busy); color: #6f7a74; border-color: var(--busy2); }
.cell.mio { background: var(--brand); color: #fff; }
.cell.da_pagare { background: var(--amber-soft); border: 1.5px dashed var(--amber-line); color: var(--amber); }
.cell.passato { background: transparent; color: var(--dim); border-color: var(--line); }
.cell.corto { background: transparent; border: 1px dashed var(--line2); color: var(--muted); }
.cell.block { align-items: flex-start; padding-top: 11px; }
.cell .pill { flex: none; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line2); border-radius: 16px; background: #fff; }
.empty .ico { width: 34px; height: 34px; color: var(--dim); margin-bottom: 8px; }

/* pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--busy); color: var(--muted); }
.pill.ok { background: var(--brand-soft); color: var(--brand-strong); }
.pill.blue { background: var(--brand-soft); color: var(--brand-strong); }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.cell.mio .pill { background: rgba(255, 255, 255, .2); color: #fff; }
.pill.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* prenotazioni */
.bk { position: relative; overflow: hidden; margin-bottom: 14px; padding: 0; }
.bk-h { display: flex; gap: 14px; align-items: center; padding: 16px 16px 12px; }
.bk .day { flex: none; width: 58px; text-align: center; border-radius: 13px; padding: 7px 0; background: var(--brand-soft); color: var(--brand-strong); }
.bk .day small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bk .day b { display: block; font-weight: 750; font-size: 23px; line-height: 1.1; color: var(--ink); }
.bk .day i { display: block; font-style: normal; font-size: 11px; text-transform: capitalize; }
.bk .info { flex: 1; min-width: 0; }
.bk h3 { font-size: 18px; font-weight: 750; }
.bk .meta { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.bk-b { padding: 0 16px 16px; }
.bk.paid { border-color: var(--brand-line); }
.bk.pend { border-color: var(--amber-line); }
.bk.pend .day { background: var(--amber-soft); color: var(--amber); }
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; font-size: 13px; margin-bottom: 12px; }
.notice .ico { width: 18px; height: 18px; margin-top: 1px; }
.notice.wait { background: var(--amber-soft); color: #7d4800; }
.notice.info { background: var(--brand-soft); color: var(--brand-strong); }
.notice.bad { background: var(--bad-soft); color: #9b1631; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.past { margin-top: 6px; }
.past .li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.past .li b { color: var(--text); font-weight: 600; }

/* pulsante Apri cancello */
.gate { border-radius: 18px; padding: 3px; background: var(--busy); }
.gate .gbtn { width: 100%; min-height: 72px; border: 0; border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; color: var(--muted); transition: transform .12s; }
.gate .gbtn .gi { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--busy); flex: none; }
.gate .gbtn .gi .ico { width: 26px; height: 26px; }
.gate .gbtn b { display: block; font-weight: 750; font-size: 18px; line-height: 1.15; color: var(--ink); }
.gate .gbtn small { display: block; font-size: 12.5px; margin-top: 2px; }
.gate .gbtn[disabled] { cursor: default; }
.gate.on { background: var(--brand); box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--brand) 85%, transparent); }
.gate.on .gbtn { background: transparent; color: rgba(255, 255, 255, .92); }
.gate.on .gbtn b { color: #fff; font-size: 20px; }
.gate.on .gbtn .gi { background: rgba(255, 255, 255, .2); color: #fff; }
.gate.on .gbtn:active { transform: scale(.99); }
.gate.on .gbtn .go { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; flex: none; }
.gate.off .gbtn .gi { color: var(--dim); }
.gate.admin { background: var(--brand-strong); box-shadow: none; }
.gate.admin .gbtn b, .gate.admin .gbtn { color: #fff; }
.gate.admin .gbtn .gi { background: rgba(255, 255, 255, .18); color: #fff; }
.gate.admin .gbtn .go { color: var(--brand-strong); }
.quick { margin-bottom: 18px; }
.quick .lbl { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.geo-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.geo-note .ico { width: 14px; height: 14px; }

/* profilo */
.profile { display: flex; gap: 14px; align-items: center; min-width: 0; }
.profile > div { min-width: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line); display: grid; place-items: center; font-weight: 750; font-size: 20px; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-strong); margin-top: 6px; }
.badge.off { background: var(--busy); color: var(--muted); }
.badge .ico { width: 15px; height: 15px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.steps li:last-child { border: 0; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; font-size: 13px; }
.steps b { color: var(--ink); }
.install { display: flex; gap: 12px; align-items: center; }
.install .ii { width: 46px; height: 46px; border-radius: 13px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-strong); flex: none; }

/* scheda (pannello che sale dal basso) */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(21, 40, 30, .38); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet-in { width: min(560px, 100%); background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2, .9, .3, 1) both; max-height: 92dvh; overflow: auto; box-shadow: 0 -20px 50px -24px rgba(21, 40, 30, .35); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line2); margin: 0 auto 14px; }
.sheet h2 { margin: 6px 0 4px; font-size: 22px; }
.durs { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 14px 0; }
.dur { min-height: var(--tap); border: 1px solid var(--line2); background: #fff; border-radius: 14px; padding: 12px 8px; text-align: center; transition: border-color .15s, background .15s; }
.dur b { display: block; font-weight: 750; font-size: 18px; color: var(--ink); }
.dur small { display: block; font-size: 12px; color: var(--muted); }
.dur .p { display: block; margin-top: 6px; font-weight: 750; color: var(--brand); font-size: 14px; }
.dur.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand-line); }
.dur[disabled] { opacity: .45; }
.paysel { display: grid; gap: 8px; margin: 6px 0 12px; }
.payopt { display: flex; gap: 12px; align-items: center; min-height: var(--tap); border: 1px solid var(--line2); background: #fff; border-radius: 14px; padding: 12px 14px; text-align: left; }
.payopt .rb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--dim); flex: none; position: relative; }
.payopt.on { border-color: var(--brand); background: var(--brand-soft); }
.payopt.on .rb { border-color: var(--brand); }
.payopt.on .rb::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.payopt b { display: block; font-size: 14.5px; color: var(--ink); }
.payopt small { color: var(--muted); font-size: 12.5px; }
.sum { margin: 10px 0 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.sum div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum div:last-child { border: 0; }
.sum span { color: var(--muted); }
.sum .tot { font-size: 17px; font-weight: 750; }
.sum .tot b { color: var(--brand); }
.cardform { border-radius: 16px; padding: 16px; background: #fff; border: 1px solid var(--line2); color: var(--text); margin: 12px 0; }
.cardform .field span { color: var(--muted); }
.cardform .field input { background: #fff; border-color: var(--line2); color: var(--ink); }
.cardform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-note { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--busy); color: var(--muted); font-size: 12.5px; }
.demo-note .ico { width: 18px; height: 18px; }

/* apertura del cancello */
.opening { text-align: center; padding: 6px 0 4px; }
.opening .big { width: 104px; height: 104px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); position: relative; }
.opening .big .ico { width: 50px; height: 50px; stroke-width: 2.2; }
.opening .big.ok { background: var(--brand); color: #fff; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.opening .big.ko { background: var(--bad-soft); color: var(--bad); animation: shake .4s both; }
.opening .big.wait::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--brand); animation: rot .9s linear infinite; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.steps-live { list-style: none; padding: 0; margin: 14px auto; max-width: 320px; text-align: left; }
.steps-live li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--muted); font-size: 14px; }
.steps-live li .st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--busy); flex: none; }
.steps-live li .st .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.steps-live li.run { color: var(--ink); font-weight: 600; }
.steps-live li.run .st { background: var(--brand-soft); }
.steps-live li.run .st::after { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); border-top-color: transparent; animation: rot .8s linear infinite; }
.steps-live li.done { color: var(--brand-strong); }
.steps-live li.done .st { background: var(--brand-soft); color: var(--brand); }
.steps-live li.fail { color: var(--bad); }
.steps-live li.fail .st { background: var(--bad-soft); color: var(--bad); }
.success { text-align: center; padding: 14px 0 6px; }
.success .big { width: 90px; height: 90px; margin: 4px auto 14px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; color: #fff; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.success .big .ico { width: 46px; height: 46px; stroke-width: 2.6; }
/* «in attesa di pagamento»: il markup imposta background:var(--grad-sun) e color:#3a2a00 */
.success .big[style*="grad-sun"] { color: var(--amber) !important; }

/* QR (solo se attivo per l'impianto) */
.qrwrap { text-align: center; }
.qrbox { width: min(300px, 78vw); margin: 10px auto 14px; padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 0 0 6px var(--brand-soft); }
.qrbox svg { display: block; width: 100%; height: auto; }

.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); }
.toast { padding: 12px 15px; border-radius: 13px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; font-weight: 550; animation: in .3s both; transition: opacity .4s, transform .4s; border-left: 4px solid var(--brand); }
.toast-err { border-left-color: var(--bad); color: #8f1530; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.spin { width: 24px; height: 24px; border: 3px solid var(--line2); border-top-color: var(--brand); border-radius: 50%; animation: rot .8s linear infinite; margin: 30px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.foot { text-align: center; font-size: 11.5px; color: var(--dim); margin-top: 26px; }

/* tipo di partita e compagni nella prenotazione (OG-06) */
.sheet .subh { font-size: 16px; margin: 4px 0 8px; }
.seg.fmts { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 4px; }
.seg.fmts button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.seg.fmts button small { font-size: 11.5px; font-weight: 500; }
.mates { display: grid; gap: 6px; margin: 0 0 12px; }
.mate { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; min-width: 0; }
.mate > span:not(.mate-av) { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.mate b { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.mate small { font-size: 12px; color: var(--muted); }
.mate-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--busy); color: var(--muted); flex: none; }
.mate-av.on { background: var(--brand-soft); color: var(--brand); }
.mate-av .ico { width: 18px; height: 18px; }
.mate.guest input { width: 100%; min-width: 0; border: 0; border-bottom: 1px dashed var(--line2); padding: 6px 0; background: transparent; outline: none; font-size: 14px; }
.mate.guest input:focus { border-bottom-color: var(--brand); }
.mate-x { width: 44px; height: 44px; margin: -6px -6px -6px auto; border: 0; background: none; color: var(--muted); border-radius: 12px; display: grid; place-items: center; flex: none; }
.mate-find { margin-top: 4px; }
.mate-res { display: grid; gap: 4px; margin-top: 6px; }
.mate-res button { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand-strong); border-radius: 12px; font-weight: 650; text-align: left; }
.mate-res button .ico { width: 18px; height: 18px; }

/* schermi più larghi: la scheda diventa una finestra al centro */
@media (min-width: 600px) {
  .sheet { align-items: center; padding: 20px; }
  .sheet-in { border-radius: 22px; }
  h1, .hero h1 { font-size: 30px; }
}
@media (min-width: 1024px) {
  body { background: linear-gradient(180deg, var(--brand-soft) 0, var(--bg) 320px) no-repeat, var(--bg); }
  .app { max-width: 600px; }
}
@media (max-width: 374px) {
  .top { padding-right: 52px; gap: 8px; }
  .top::after { right: 10px; width: 28px; height: 28px; }
  .who > div:first-child { display: none; } /* su schermi molto stretti resta solo l'avatar */
  .brand img { height: 38px; }
  .row2, .cardform .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* OG-12: nome e cognome di chi ha prenotato negli orari occupati.
   Markup previsto: <span class="lab"><b class="nome">Mario Rossi</b><small>10:00–11:00</small></span> */
.cell.occupato .nome { color: var(--ink); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.occupato .lab { min-width: 0; }

/* OG-10: campi per il nome degli ospiti comodi da toccare */
.mate.guest input { min-height: 44px; }

/* OG-13/OG-14: menu a tendina nei moduli, giorni della settimana e blocchi ricorrenti */
.field select { width: 100%; min-height: var(--tap); padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; outline: none; }
.field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .seg { margin-bottom: 0; }
.field .seg button { min-height: var(--tap); }
.wdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wdays button { min-height: var(--tap); border: 1px solid var(--line2); background: #fff; border-radius: 11px; font-weight: 650; font-size: 13px; color: var(--muted); padding: 0; }
.wdays button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.blk { margin-bottom: 12px; }
.blk-h { display: flex; align-items: flex-start; gap: 10px; }
.blk-h .grow { flex: 1; min-width: 0; }
.blk-h h3 { margin: 0 0 2px; font-size: 16px; color: var(--ink); }
.blk-h .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.blk-dates { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.blk-dates li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.blk-dates li[hidden] { display: none; }
.blk-when { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.blk-when small { color: var(--muted); font-size: 13px; }
.blk-acts { display: flex; gap: 6px; flex: none; }
.blk-acts .btn { padding: 8px 12px; font-size: 13.5px; min-width: var(--tap); }
.blk-acts .ico { width: 18px; height: 18px; }
.pill .ico { width: 13px; height: 13px; }

/* OG-18: categoria di ogni ospite (adulto non socio / bambino) nella scheda di prenotazione */
.mate > span.cat { display: inline-grid; flex-direction: row; flex: none; line-height: normal; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: 11px; background: var(--busy); flex: none; }
.mate .cat button { min-height: var(--tap, 44px); min-width: 44px; padding: 6px 9px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.mate .cat button.on { background: #fff; color: var(--brand-strong); box-shadow: 0 1px 3px rgba(21, 40, 30, .12); }
@media (max-width: 400px) {
  .mate.guest:has(.cat) { flex-wrap: wrap; }
  .mate.guest:has(.cat) > span.grow { flex-basis: calc(100% - 42px); }
  .mate.guest:has(.cat) > span.cat { width: 100%; }
}

/* OG-20 · pagamenti in contanti al circolo */
.duebar { width: 100%; border: 0; text-align: left; align-items: center; cursor: pointer; min-height: 44px; font: inherit; }
.duebar span { flex: 1; }
.dues .dues-tot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dues .dues-tot span { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.dues .dues-tot b { font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dues .past .li span { text-align: right; }
