/* =========================================================================
   BOX AREA 51 — app
   Stessa identità del sito: nero, verde #81d700, titoli in Anton maiuscolo,
   contenuti su fondo chiaro. Forme moderne: angoli morbidi, ombre leggere,
   pensata prima per il telefono (barra in basso, finestre che salgono dal basso).
   ====================================================================== */

@font-face {
    font-family: "Anton";
    src: url("../fonts/anton-regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --green:       #81d700;
    --green-600:   #6fbd00;
    --green-700:   #4a8a00;
    --green-50:    #f2fae6;
    --green-glow:  rgba(129, 215, 0, .45);

    --ink:         #0b0b0b;
    --ink-2:       #151515;
    --ink-3:       #222;
    --ink-line:    rgba(255, 255, 255, .09);
    --ink-text:    #d6d6d6;
    --ink-muted:   #8a8a8a;

    --bg:          #f2f3f5;
    --surface:     #fff;
    --surface-2:   #f7f8f9;
    --line:        #e5e7ea;
    --text:        #1b1f24;
    --muted:       #6b7280;

    --amber:       #e07b00;
    --amber-50:    #fff4e2;
    --red:         #d93025;
    --red-50:      #fdecea;
    --blue:        #1e7bff;
    --blue-50:     #eaf3ff;

    --r-sm:        10px;
    --r:           14px;
    --r-lg:        20px;
    --shadow-sm:   0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
    --shadow:      0 8px 24px rgba(16, 24, 40, .08);
    --shadow-lg:   0 20px 50px rgba(16, 24, 40, .18);

    --font:        system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --display:     "Anton", "Arial Narrow", Impact, sans-serif;

    --sidebar-w:   252px;
    --tabbar-h:    64px;
    --safe-b:      env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 .6em; }
ul { margin: 0; padding: 0; list-style: none; }

.icon {
    width: 20px; height: 20px; flex: 0 0 auto;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.flip { transform: scaleX(-1); }
.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: .85em; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

/* =========================================================================
   Struttura: barra laterale (computer), barra in alto e in basso (telefono)
   ====================================================================== */

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: none;
    flex-direction: column;
    background: var(--ink);
    color: var(--ink-text);
    border-right: 1px solid #000;
    z-index: 30;
}
.sidebar__brand { display: block; padding: 22px 26px 10px; }
.sidebar__brand img { width: 150px; }
.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 12px 16px; }
.sidebar__account {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 14px 18px; border-top: 1px solid var(--ink-line);
}

.nav-group { padding: 10px 0 4px; }
.nav-group + .nav-group { border-top: 1px solid var(--ink-line); }
.nav-group__label {
    padding: 4px 12px 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-muted);
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0; border-radius: var(--r-sm);
    background: none;
    color: var(--ink-text);
    font-weight: 600;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.nav-link .icon { color: var(--ink-muted); transition: color .15s; }
.nav-link:hover { background: var(--ink-3); color: #fff; }
.nav-link:hover .icon { color: #fff; }
.nav-link.is-active { background: rgba(129, 215, 0, .12); color: var(--green); }
.nav-link.is-active .icon { color: var(--green); }

.account { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.account__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account__text strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account__text small { color: var(--ink-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: var(--ink);
    font: 15px/1 var(--display);
    letter-spacing: .04em;
}
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }
.avatar--lg { width: 64px; height: 64px; font-size: 24px; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
    background: var(--ink);
    box-shadow: 0 1px 0 #000;
}
.topbar__brand img { width: 76px; }
.topbar__menu {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--ink-line); border-radius: 999px;
    background: var(--ink-2); color: #fff; cursor: pointer;
}

.main { padding: 0 0 calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 0; }
.page__title {
    margin: 4px 0 18px;
    font: 30px/1.05 var(--display);
    letter-spacing: .01em;
    text-transform: uppercase;
}
.page__title::after {
    content: ""; display: block; width: 40px; height: 4px; margin-top: 10px;
    border-radius: 2px; background: var(--green);
}
.page__lead { margin: -6px 0 16px; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: flex; justify-content: space-around;
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding: 6px 4px var(--safe-b);
    background: rgba(11, 11, 11, .96);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid #000;
}
.tabbar__item {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-muted);
    font-size: 11px; font-weight: 600;
    text-decoration: none;
}
.tabbar__icon { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background-color .15s; }
.tabbar__item.is-active { color: var(--green); }
.tabbar__item.is-active .tabbar__icon { background: rgba(129, 215, 0, .14); }
.tabbar__item--cta .tabbar__icon {
    width: 46px; height: 46px; margin-top: -20px;
    background: var(--green); color: var(--ink);
    box-shadow: 0 6px 16px var(--green-glow), 0 0 0 4px var(--ink);
}
.tabbar__item--cta .icon { width: 24px; height: 24px; stroke-width: 2.6; }
.tabbar__item--cta.is-active .tabbar__icon { background: var(--green); }

/* Menu completo a scomparsa (telefono) */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fade .2s ease; }
.drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(340px, 88vw);
    display: flex; flex-direction: column;
    background: var(--ink); color: var(--ink-text);
    padding-top: env(safe-area-inset-top, 0px);
    animation: slide-in .25s cubic-bezier(.2, .8, .2, 1);
    overflow-y: auto;
}
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 1px solid var(--ink-line); }
.drawer__head .account__text { flex: 1 1 auto; }
.drawer__nav { padding: 6px 12px calc(20px + var(--safe-b)); }
.nav-link--button { font: inherit; font-weight: 600; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

@media (min-width: 1024px) {
    .sidebar { display: flex; }
    .topbar, .tabbar, .drawer { display: none !important; }
    .main { margin-left: var(--sidebar-w); padding-bottom: 48px; }
    .page { padding: 34px 40px 0; }
    .page__title { font-size: 38px; margin-bottom: 26px; }
}

/* =========================================================================
   Pulsanti e badge
   ====================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1.5px solid transparent; border-radius: 999px;
    background: var(--surface-2); color: var(--text);
    font-weight: 700; letter-spacing: .01em;
    text-decoration: none; line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active:not([disabled]) { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: default; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--green); color: #0c1400; box-shadow: 0 4px 14px rgba(129, 215, 0, .35); }
.btn--primary:hover:not([disabled]) { background: var(--green-600); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover:not([disabled]) { background: var(--ink-3); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover:not([disabled]) { border-color: var(--text); }
.btn--danger { background: var(--red); color: #fff; }
.btn--on-dark { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn--on-dark:hover { border-color: #fff; }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
@media (max-width: 640px) { .btn--block-mobile { display: flex; width: 100%; } }
.btn.is-busy::after {
    content: ""; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; flex: 0 0 auto;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--surface); color: var(--text);
    cursor: pointer; text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--text); }
.icon-btn--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.icon-btn--dark { background: transparent; border-color: var(--ink-line); color: var(--ink-text); }
.icon-btn--dark:hover { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2); color: var(--muted);
    font-size: 12px; font-weight: 700; line-height: 1.4;
    white-space: nowrap; vertical-align: middle;
}
.badge .icon { width: 13px; height: 13px; }
.badge--green { background: var(--green-50); color: var(--green-700); }
.badge--red   { background: var(--red-50); color: var(--red); }
.badge--amber { background: var(--amber-50); color: var(--amber); }
.badge--blue  { background: var(--blue-50); color: var(--blue); }
.badge--grey  { background: #eceef1; color: var(--muted); }
.badge--dark  { background: var(--ink); color: var(--green); }
.badge--solid { background: var(--green); color: #0c1400; }

/* =========================================================================
   Blocchi di base
   ====================================================================== */

.card {
    position: relative;
    margin: 0 0 16px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card__title {
    margin: 0 0 12px;
    font: 19px/1.15 var(--display);
    letter-spacing: .015em;
    text-transform: uppercase;
}
.card__title--spaced { margin-top: 22px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__head .card__title { margin: 0; }
.card__eyebrow { display: flex; align-items: center; gap: 6px; color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card__eyebrow .icon { width: 16px; height: 16px; }
.card__meta { color: var(--muted); font-size: 14px; }
.card--link { display: block; color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.card--link:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.wod-teaser .card__title { margin: 6px 40px 4px 0; font-size: 22px; }

.grid-2 { display: grid; gap: 16px; }
.grid-2 > .card { margin: 0; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.grid-sidebar { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .grid-sidebar { grid-template-columns: minmax(0, 1fr) 360px; } }
.stack > * + * { margin-top: 16px; }
.stack > .card { margin-bottom: 0; }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-head__title { font: 20px/1.1 var(--display); text-transform: uppercase; }
.section-head__sub { margin: 4px 0 0; color: var(--muted); }

.notice {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid transparent;
}
.notice__icon { width: 22px; height: 22px; margin-top: 1px; color: var(--muted); }
.notice__body { flex: 1 1 auto; min-width: 0; }
.notice__title { font-weight: 800; }
.notice a { color: inherit; font-weight: 700; }
.notice--info    { background: var(--blue-50); border-color: #cfe2ff; }
.notice--info    .notice__icon { color: var(--blue); }
.notice--success { background: var(--green-50); border-color: #d6efb0; }
.notice--success .notice__icon { color: var(--green-700); }
.notice--warn    { background: var(--amber-50); border-color: #ffe0b0; }
.notice--warn    .notice__icon { color: var(--amber); }
.notice--error   { background: var(--red-50); border-color: #f8c9c4; }
.notice--error   .notice__icon { color: var(--red); }

.empty {
    padding: 36px 20px;
    border: 2px dashed var(--line); border-radius: var(--r-lg);
    background: var(--surface);
    text-align: center; color: var(--muted);
}
.empty__icon { width: 40px; height: 40px; margin: 0 auto 10px; color: #c4c8ce; }
.empty__title { color: var(--text); font: 20px/1.2 var(--display); text-transform: uppercase; margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto; }

.rows { margin: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.row__main { flex: 1 1 auto; min-width: 0; }
.row__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.row__meta { color: var(--muted); font-size: 13px; }
.rows--compact .row { padding: 9px 0; }
@media (max-width: 420px) { .row__icon { display: none; } }

.back-link { display: inline-block; margin: -6px 0 14px; color: var(--muted); font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--text); }

/* =========================================================================
   Riquadri di stato (abbonamento, ingressi, certificato)
   ====================================================================== */

.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
@media (min-width: 860px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; } }
.tile {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 112px;
    padding: 14px 14px 13px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.tile__icon { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; opacity: .35; }
.tile__label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile__value { margin-top: auto; font: 30px/1.05 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.tile__value--sm { font-size: 22px; }
.tile__note { font-size: 13px; color: var(--muted); }
.tile--success::before { background: var(--green); }
.tile--success .tile__value { color: var(--green-700); }
.tile--warn::before { background: var(--amber); }
.tile--warn .tile__value { color: var(--amber); }
.tile--error::before { background: var(--red); }
.tile--error .tile__value { color: var(--red); }
.tile--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.tile--dark::before { background: var(--green); }
.tile--dark .tile__label, .tile--dark .tile__note { color: var(--ink-muted); }
.tile--dark .tile__value { color: var(--green); }
.tile--dark .tile__icon { color: var(--green); opacity: .8; }
.tile--link { transition: transform .15s, box-shadow .15s; }
/* su telefono un riquadro rimasto da solo nell'ultima riga occupa tutta la larghezza */
@media (max-width: 859px) { .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 96px; } }
.tile--link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tiles--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tiles--compact .tile { min-height: 86px; padding: 10px 12px; }
.tiles--compact .tile__value { font-size: 22px; }

/* =========================================================================
   Home
   ====================================================================== */

.today {
    margin: 0 0 16px;
    padding: 16px;
    border-radius: var(--r-lg);
    background: radial-gradient(120% 140% at 100% 0%, #1d2a08 0%, var(--ink) 55%);
    color: #fff;
    box-shadow: var(--shadow);
}
.today__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.today__label { font: 24px/1 var(--display); text-transform: uppercase; color: var(--green); }
.today__date { color: var(--ink-text); font-weight: 600; text-transform: capitalize; }
.today__cta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px;
    border-radius: var(--r);
    background: linear-gradient(135deg, #95e61a, var(--green) 50%, #69b300);
    color: #0c1400; text-decoration: none;
    box-shadow: 0 10px 26px rgba(129, 215, 0, .3);
    transition: transform .15s;
}
.today__cta:active { transform: scale(.99); }
.today__cta strong { display: block; font: 24px/1.05 var(--display); text-transform: uppercase; }
.today__cta small { font-weight: 700; opacity: .75; }
.today__cta .icon { width: 28px; height: 28px; stroke-width: 2.5; }
.today__empty { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--ink-3); }
.today__empty span { color: var(--ink-muted); }
.today .myslot { margin: 0; box-shadow: none; }

/* =========================================================================
   Prenotazione
   ====================================================================== */

.daybar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 14px;
}
.daybar__when { font: 26px/1 var(--display); text-transform: uppercase; color: var(--green-700); }
.daybar__date { font-weight: 700; text-transform: capitalize; }
.daybar__live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green-glow); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(129, 215, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(129, 215, 0, 0); } }

/* La tua prenotazione: nera con anello verde luminoso */
.myslot {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 16px;
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 0 0 2px var(--green), 0 12px 32px rgba(129, 215, 0, .3);
}
.myslot__mark {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--green); color: var(--ink);
    box-shadow: 0 0 18px var(--green-glow);
}
.myslot__mark .icon { width: 24px; height: 24px; stroke-width: 3; }
.myslot__main { flex: 1 1 auto; min-width: 0; }
.myslot__label { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.myslot__time { font: 30px/1.05 var(--display); letter-spacing: .01em; }
.myslot__meta { color: var(--ink-text); font-size: 14px; }
.myslot__countdown { margin-top: 2px; color: var(--green); font-size: 13px; font-weight: 700; }
.myslot__countdown:empty { display: none; }

.slots { display: grid; gap: 12px; }
@media (min-width: 700px) { .slots { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; } }

.slot {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    width: 100%;
    padding: 16px;
    border: 0; border-radius: var(--r-lg);
    background: linear-gradient(150deg, #92e31d 0%, var(--green) 45%, #66b000 100%);
    color: #0c1400;
    text-align: left;
    box-shadow: 0 8px 22px rgba(116, 194, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.slot:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(116, 194, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .35); }
.slot:active:not(:disabled) { transform: scale(.985); }
.slot__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.slot__time { font: 34px/1 var(--display); letter-spacing: .01em; }
.slot__time small { font-size: 20px; opacity: .65; }
.slot__type {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(12, 20, 0, .12);
    font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}
.slot__caps { display: grid; gap: 8px; }
.slot__flag {
    position: absolute; top: -9px; right: 14px;
    padding: 3px 10px; border-radius: 999px;
    background: var(--ink); color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}

.cap__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cap__label { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.cap__num { font: 20px/1 var(--display); }
.cap__num small { font-size: 14px; opacity: .6; }
.cap__bar { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: rgba(12, 20, 0, .16); overflow: hidden; }
.cap__fill { display: block; height: 100%; border-radius: 3px; background: var(--ink); transition: width .4s; }
.cap.is-warning .cap__num { color: #7a3d00; }
.cap.is-warning .cap__fill { background: var(--amber); }
.cap.is-danger .cap__num { color: #8f150d; }
.cap.is-danger .cap__fill { background: var(--red); }

.slot.is-mine {
    background: var(--ink); color: #fff;
    box-shadow: 0 0 0 2px var(--green), 0 12px 30px rgba(129, 215, 0, .35);
}
.slot.is-mine .slot__type { background: rgba(129, 215, 0, .18); color: var(--green); }
.slot.is-mine .cap__bar { background: rgba(255, 255, 255, .12); }
.slot.is-mine .cap__fill { background: var(--green); }
.slot.is-mine .cap__num { color: var(--green); }
.slot.is-mine .slot__flag { background: var(--green); color: #0c1400; box-shadow: 0 0 14px var(--green-glow); }
.slot.is-full {
    background: #e9ebee; color: #6b7280;
    box-shadow: none; cursor: not-allowed;
}
.slot.is-full .slot__flag { background: var(--red); }
.slot.is-full .cap__bar { background: rgba(0, 0, 0, .08); }
.slot.is-locked { cursor: default; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend__dot--ok { background: var(--ink); }
.legend__dot--warning { background: var(--amber); }
.legend__dot--danger { background: var(--red); }

/* Telefono: card a riga, più compatte */
@media (max-width: 699px) {
    .slot { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
    .slot__top { flex-direction: column; align-items: flex-start; gap: 6px; flex: 0 0 auto; }
    .slot__time { font-size: 30px; }
    .slot__type { max-width: 120px; font-size: 11px; }
    .slot__caps { flex: 1 1 auto; }
}

/* Scelta classe / open nella finestra */
.choices { display: grid; gap: 10px; }
.choice {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--line); border-radius: var(--r);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__dot { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.choice__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); transform: scale(0); transition: transform .15s; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-50); }
.choice:has(input:checked) .choice__dot { border-color: var(--green); }
.choice:has(input:checked) .choice__dot::after { transform: scale(1); }
.choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }
.choice.is-disabled { opacity: .5; cursor: not-allowed; }
.choice__name { display: block; font-weight: 800; }
.choice__hint { display: block; color: var(--muted); font-size: 14px; }

/* =========================================================================
   Finestre e notifiche
   ====================================================================== */

.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fade .2s; }
.modal__box {
    position: relative;
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    padding: 22px 20px calc(20px + var(--safe-b));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: rise .25s cubic-bezier(.2, .8, .2, 1);
}
.modal__box::before { content: ""; display: block; width: 40px; height: 4px; margin: -10px auto 14px; border-radius: 2px; background: var(--line); }
.modal__title { margin: 0 0 12px; font: 24px/1.1 var(--display); text-transform: uppercase; }
.modal__body { margin-bottom: 18px; }
.modal__actions { display: flex; flex-direction: column-reverse; gap: 8px; }
.modal--error .modal__title { color: var(--red); }
@media (min-width: 600px) {
    .modal { align-items: center; padding: 20px; }
    .modal__box { border-radius: var(--r-lg); padding-bottom: 22px; }
    .modal__box::before { display: none; }
    .modal__actions { flex-direction: row; justify-content: flex-end; }
}

.toasts {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
    z-index: 90;
    display: flex; flex-direction: column; gap: 8px;
    width: min(440px, calc(100% - 24px));
    pointer-events: none;
}
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; bottom: 24px; transform: none; } }
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--ink); color: #fff;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: rise .25s cubic-bezier(.2, .8, .2, 1);
    transition: opacity .2s, transform .2s;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast__bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--green); flex: 0 0 auto; }
.toast--warn .toast__bar { background: var(--amber); }
.toast--error .toast__bar { background: var(--red); }

/* =========================================================================
   Orari della settimana
   ====================================================================== */

.week-tabs { display: none; }
.week { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; } }
.week__day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.week__day.is-today { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.week__name {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 12px 14px;
    background: var(--ink); color: #fff;
    font: 17px/1 var(--display); letter-spacing: .03em; text-transform: uppercase;
}
.week__day.is-today .week__name { color: var(--green); }
.week__lesson { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line); }
.week__lesson:first-of-type { border-top: 0; }
.week__hour { font: 20px/1.1 var(--display); }
.week__hour small { font-size: 14px; color: var(--muted); }
.week__type { color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.week__empty { padding: 18px 14px; color: var(--muted); text-align: center; font-style: italic; }

@media (max-width: 899px) {
    .week-tabs {
        display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
        margin: 0 0 12px; padding: 4px;
        background: var(--ink); border-radius: 999px;
    }
    .week-tabs label {
        display: grid; place-items: center; height: 38px;
        border-radius: 999px; color: var(--ink-text);
        font-size: 13px; font-weight: 800; cursor: pointer;
    }
    .week-tabs label.is-today { color: var(--green); }
    .week__day { display: none; }
    #wd-LUN:checked ~ .week-tabs label[for="wd-LUN"], #wd-MAR:checked ~ .week-tabs label[for="wd-MAR"],
    #wd-MER:checked ~ .week-tabs label[for="wd-MER"], #wd-GIO:checked ~ .week-tabs label[for="wd-GIO"],
    #wd-VEN:checked ~ .week-tabs label[for="wd-VEN"], #wd-SAB:checked ~ .week-tabs label[for="wd-SAB"],
    #wd-DOM:checked ~ .week-tabs label[for="wd-DOM"] { background: var(--green); color: var(--ink); }
    #wd-LUN:checked ~ .week [data-day="LUN"], #wd-MAR:checked ~ .week [data-day="MAR"],
    #wd-MER:checked ~ .week [data-day="MER"], #wd-GIO:checked ~ .week [data-day="GIO"],
    #wd-VEN:checked ~ .week [data-day="VEN"], #wd-SAB:checked ~ .week [data-day="SAB"],
    #wd-DOM:checked ~ .week [data-day="DOM"] { display: block; }
    .week-wrap input:focus-visible + * { outline: none; }
}

/* =========================================================================
   Moduli
   ====================================================================== */

.form { display: block; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .card .form-grid:not(.form-grid--2) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 639px) { .form-actions .btn { width: 100%; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 0; }
.form > .field + .field, .form > .field + .btn { margin-top: 14px; }
.field__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 16px; /* niente zoom automatico su iPhone */
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
select.input {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.input:hover { border-color: #cfd3d8; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(129, 215, 0, .2); }
.input:user-invalid { border-color: var(--red); }

.password { position: relative; }
.password .input { padding-right: 84px; }
.password__toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    padding: 6px 10px; border: 0; border-radius: 8px;
    background: var(--surface-2); color: var(--muted);
    font-size: 12px; font-weight: 800; text-transform: uppercase; cursor: pointer;
}

.fieldset { margin: 0 0 20px; padding: 0; border: 0; }
.fieldset legend { margin-bottom: 12px; padding: 0; font: 18px/1 var(--display); text-transform: uppercase; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; font-size: 14px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 24px; height: 24px; margin-top: 1px;
    border: 2px solid #c9cdd2; border-radius: 7px;
    color: transparent; transition: all .15s;
}
.check__box .icon { width: 16px; height: 16px; stroke-width: 3; }
.check input:checked + .check__box { background: var(--green); border-color: var(--green); color: var(--ink); }
.check input:focus-visible + .check__box { outline: 3px solid var(--green); outline-offset: 2px; }
.check__text em { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 14px; transition: all .15s; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--green); }
.chip input:disabled + span { opacity: .7; cursor: not-allowed; }
.chip input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }

.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch__track { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #cfd3d8; transition: background-color .2s; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--green); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .6; }

.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 120px; padding: 18px;
    border: 2px dashed #cfd3d8; border-radius: var(--r);
    background: var(--surface-2); color: var(--muted);
    text-align: center; cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--green); background: var(--green-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 30px; height: 30px; color: var(--green-700); }
.dropzone__text { font-weight: 700; word-break: break-all; }
.dropzone.has-file { border-style: solid; border-color: var(--green); color: var(--text); }

/* Barra dei filtri */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 16px; }
.toolbar .field { flex: 1 1 160px; }
.toolbar .field--grow { flex: 3 1 240px; }
.toolbar__actions { display: flex; gap: 8px; margin-left: auto; }
.toolbar--end { justify-content: flex-end; }
@media (max-width: 639px) { .toolbar__actions { width: 100%; } .toolbar__actions .btn { flex: 1 1 0; } .toolbar--end .btn { flex: 1 1 0; } }
.search { position: relative; }
.search .input { padding-left: 42px; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .input { width: 172px; flex: 0 0 auto; }

.summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.summary:empty { display: none; }
.summary__item { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.summary__item strong { margin-left: 4px; color: var(--text); }
.summary__item--main { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.summary__item--main strong { color: var(--green); }

/* =========================================================================
   Staff: prenotati
   ====================================================================== */

.slot-pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 6px; scrollbar-width: none; }
.slot-pills::-webkit-scrollbar { display: none; }
.slot-pill {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    min-width: 108px; padding: 10px 14px;
    border: 1.5px solid var(--line); border-radius: var(--r);
    background: var(--surface); text-align: left; cursor: pointer;
    transition: all .15s;
}
.slot-pill__time { font: 20px/1 var(--display); }
.slot-pill__type { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-pill__count { font-size: 12px; font-weight: 700; color: var(--green-700); }
.slot-pill.is-off { opacity: .55; }
.slot-pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 0 0 2px var(--green); }
.slot-pill.is-active .slot-pill__type { color: var(--ink-muted); }
.slot-pill.is-active .slot-pill__count { color: var(--green); }

.roster { display: grid; gap: 16px; }
@media (min-width: 860px) { .roster { grid-template-columns: 1fr 1fr; } }
.roster .card { margin: 0; }
.roster__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.roster__head .card__title { margin: 0; }
.roster__count { font: 22px/1 var(--display); color: var(--green-700); }
.person-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.person-row:first-child { border-top: 0; }
.person-row .avatar { width: 34px; height: 34px; font-size: 13px; background: var(--ink); color: var(--green); }
.person-row__name { flex: 1 1 auto; min-width: 0; font-weight: 700; }

/* =========================================================================
   Staff: gestione orari
   ====================================================================== */

.day-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--ink); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.day-tabs__tab { flex: 1 0 auto; padding: 9px 12px; border: 0; border-radius: 999px; background: none; color: var(--ink-text); font-weight: 800; font-size: 13px; cursor: pointer; }
.day-tabs__tab.is-active { background: var(--green); color: var(--ink); }
.day-tabs__long { display: none; }
@media (min-width: 900px) { .day-tabs__long { display: inline; } .day-tabs__short { display: none; } }

.ts-list { display: grid; gap: 12px; }
.ts-row {
    display: grid; gap: 12px;
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: border-color .2s, box-shadow .2s;
}
.ts-row.is-dirty { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-50); }
.ts-row.is-off { background: var(--surface-2); }
.ts-row__head { display: flex; align-items: center; gap: 10px; }
.ts-row__time { width: 120px; }
.ts-row__type { flex: 1 1 auto; }
.ts-row__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ts-row__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ts-row__foot .btn-group { display: flex; gap: 8px; }
.ts-row .input { min-height: 42px; }
.ts-row__time .input { font: 22px/1 var(--display); }
@media (max-width: 560px) {
    .ts-row__head { flex-wrap: wrap; }
    .ts-row__time { width: 110px; }
    .ts-row__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================================
   Amministrazione: soci
   ====================================================================== */

.people { display: grid; gap: 8px; }
.person {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--surface); border: 1px solid var(--line);
    color: inherit; text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.person:hover { border-color: var(--green); box-shadow: var(--shadow-sm); }
.person__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.person__name { font-weight: 800; }
.person__meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.person__go { color: var(--muted); }
@media (max-width: 640px) {
    .person { flex-wrap: wrap; }
    .person__tags { order: 3; width: 100%; justify-content: flex-start; padding-left: 50px; }
    .person__go { display: none; }
}
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head__name { font: 26px/1.1 var(--display); text-transform: uppercase; }

/* Certificato */
.cert-status {
    display: flex; align-items: center; gap: 16px;
    margin: 0 0 16px; padding: 18px;
    border-radius: var(--r-lg);
    background: var(--ink); color: #fff;
}
.cert-status__icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; box-sizing: content-box; flex: 0 0 auto; }
.cert-status__title { font: 24px/1.1 var(--display); text-transform: uppercase; }
.cert-status__text { color: var(--ink-text); }
.cert-status--success .cert-status__icon { background: var(--green); color: var(--ink); box-shadow: 0 0 20px var(--green-glow); }
.cert-status--success .cert-status__title { color: var(--green); }
.cert-status--warn .cert-status__icon { background: var(--amber); color: #fff; }
.cert-status--warn .cert-status__title { color: #ffb24d; }
.cert-status--error .cert-status__icon { background: var(--red); color: #fff; }
.cert-status--error .cert-status__title { color: #ff7a70; }

/* Tabella generica (certificati staff) */
.table-host { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table th { padding: 12px 14px; background: var(--ink); color: var(--ink-text); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .input { min-height: 38px; padding: 6px 10px; font-size: 15px; }
@media (max-width: 720px) {
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table { border: 0; background: none; }
    .table thead { display: none; }
    .table tr { margin-bottom: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
    .table td { padding: 4px 0; border: 0; }
    .table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
    .table .actions { justify-content: flex-start; padding-top: 8px; }
}

/* Report */
.export { text-align: left; }
.export__icon { width: 34px; height: 34px; padding: 9px; box-sizing: content-box; margin-bottom: 10px; border-radius: 14px; background: var(--ink); color: var(--green); }
.export .field { margin: 14px 0 16px; }
.export .form-grid { margin: 14px 0 16px; }
.export .form-grid .field { margin: 0; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Grafici */
.charts { display: grid; gap: 16px; }
@media (min-width: 900px) { .charts { grid-template-columns: 1fr 1fr; } }
.charts .card { margin: 0; }
.chart__canvas { position: relative; height: 260px; }

/* =========================================================================
   Pagine pubbliche: accesso, iscrizione, errori
   ====================================================================== */

body.auth {
    min-height: 100vh;
    background:
        radial-gradient(90% 60% at 50% 0%, rgba(129, 215, 0, .16) 0%, rgba(129, 215, 0, 0) 60%),
        var(--ink);
    color: var(--text);
}
.auth__main { width: 100%; max-width: 440px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top, 0px)) 16px 32px; }
.auth__main--wide { max-width: 760px; }
.auth__logo { display: block; width: 190px; margin: 0 auto 22px; }
.auth__card {
    padding: 26px 22px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(129, 215, 0, .15);
}
@media (min-width: 640px) { .auth__card { padding: 32px; } }
.auth__title { font: 32px/1.05 var(--display); text-transform: uppercase; }
.auth__title::after { content: ""; display: block; width: 40px; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--green); }
.auth__sub { margin: 12px 0 18px; color: var(--muted); }
.auth__code { font: 64px/1 var(--display); color: var(--green); margin-bottom: 6px; }
.auth__card .form .btn { margin-top: 20px; }
.auth__card .notice { margin-top: 4px; }
.auth__links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; text-align: center; }
.auth__links a { color: var(--text); text-decoration: none; font-weight: 600; }
.auth__links a:hover { color: var(--green-700); }
.auth__foot { margin-top: 22px; text-align: center; color: var(--ink-muted); font-size: 13px; }
.auth__foot a { color: var(--ink-text); }

@media print {
    .sidebar, .topbar, .tabbar, .toasts { display: none !important; }
    .main { margin: 0; padding: 0; }
    body { background: #fff; }
}

/* Collegamento con lo shop e conferma email */
.notice__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notice__actions .btn { text-decoration: none; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.profile-head .badge { margin-top: 6px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--green-700); font-weight: 700; text-decoration: underline; cursor: pointer; }
.auth__card--center { text-align: center; }
.auth__title--center::after { margin-left: auto; margin-right: auto; }
.spinner {
    width: 44px; height: 44px; margin: 0 auto 16px;
    border-radius: 50%; border: 4px solid var(--green-50); border-top-color: var(--green);
    animation: spin .8s linear infinite;
}

/* Ambiente di prova */
.env-banner {
    position: sticky; top: 0; z-index: 70;
    padding: 6px 12px; background: #ffd400; color: #1b1f24;
    font-size: 13px; font-weight: 800; text-align: center; letter-spacing: .02em;
}
.env-banner + .topbar { top: 31px; }
@media (min-width: 1024px) { .app .env-banner { margin-left: var(--sidebar-w); } }

/* =========================================================================
   Installazione come app (PWA)
   ====================================================================== */

.install { text-align: center; margin-bottom: 16px; }
.install__icon { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 20px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.install__steps { margin: 4px 0 18px; padding: 0; list-style: none; counter-reset: passo; text-align: left; }
.install__steps li {
    counter-increment: passo;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 0; border-top: 1px solid var(--line);
}
.install__steps li:first-child { border-top: 0; }
.install__steps li::before {
    content: counter(passo);
    display: grid; place-items: center; flex: 0 0 auto;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ink); color: var(--green); font: 15px/1 var(--display);
}
.install-glyph { width: 22px; height: 22px; vertical-align: -5px; color: var(--blue); }
.install__how { margin: 4px 0 18px; }
.install__skip, .install__link {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 14px; padding: 8px; border: 0; background: none;
    color: var(--muted); font-weight: 700; cursor: pointer; text-decoration: underline;
}
.install__link { margin: 0; color: var(--green-700); }
.install__link .icon { width: 18px; height: 18px; }

.install-bar {
    position: fixed; left: 10px; right: 10px; z-index: 26;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px 10px 12px;
    border-radius: var(--r);
    background: var(--ink); color: #fff;
    box-shadow: 0 0 0 1px rgba(129, 215, 0, .35), var(--shadow-lg);
    animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}
.install-bar img { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; }
.install-bar__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.install-bar__text span { color: var(--ink-muted); font-size: 12px; }
.install-bar .btn { min-height: 34px; white-space: nowrap; flex: 0 0 auto; }
@media (min-width: 1024px) { .install-bar { display: none !important; } }
body.has-install-bar .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }

/* =========================================================================
   WOD del giorno (soci)
   ====================================================================== */

.daystrip { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.daystrip::-webkit-scrollbar { display: none; }
.daystrip__day {
    flex: 1 0 46px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px; border-radius: var(--r);
    background: var(--surface); border: 1px solid var(--line);
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.daystrip__day strong { font: 22px/1 var(--display); color: var(--text); }
.daystrip__day.is-today { border-color: var(--green); }
.daystrip__day.is-future { border-style: dashed; }
.daystrip__day.is-active { background: var(--ink); border-color: var(--ink); color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.daystrip__day.is-active strong { color: #fff; }

.wod-day { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.wod-day__date { font-weight: 800; text-transform: capitalize; }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ink); }
.seg__item {
    padding: 8px 16px; border: 0; border-radius: 999px; background: none;
    color: var(--ink-text); font: 15px/1 var(--display); letter-spacing: .04em; text-decoration: none; cursor: pointer;
}
.seg__item.is-active { background: var(--green); color: var(--ink); }
.seg--light { background: var(--surface-2); border: 1px solid var(--line); }
.seg--light .seg__item { color: var(--muted); }
.seg--light .seg__item.is-active { background: var(--ink); color: var(--green); }

.wod-list { display: grid; gap: 14px; }
.wod-list__edit { justify-self: start; }

.wodcard {
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.wodcard__head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 16px 18px;
    background: var(--ink); color: #fff;
}
.wodcard__tipo {
    padding: 4px 10px; border-radius: 999px; background: var(--green); color: var(--ink);
    font: 13px/1 var(--display); letter-spacing: .08em;
}
.wodcard--hyrox .wodcard__tipo { background: #ffd400; }
.wodcard__title { flex: 1 1 auto; margin: 0; font: 24px/1.1 var(--display); text-transform: uppercase; }
.wodcard__empty { padding: 16px 18px; margin: 0; }

.wodb { padding: 16px 18px; border-top: 1px solid var(--line); }
.wodcard__head + .wodb { border-top: 0; }
.wodb__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.wodb__title { margin: 0; font: 20px/1.1 var(--display); text-transform: uppercase; }
.wodb__format { font: 20px/1.1 var(--display); color: var(--green-700); text-transform: uppercase; }
.wodb__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.wodb__meta span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.wodb__moves { margin: 0; padding: 0; list-style: none; }
.wodm { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.wodm:first-child { border-top: 0; }
.wodm__min { flex: 0 0 auto; min-width: 48px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.wodm__qty { flex: 0 0 auto; min-width: 44px; font: 22px/1 var(--display); color: var(--green-700); }
.wodm__name { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 700; }
.wodm__name small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.wodm__load { flex: 0 0 auto; padding: 3px 9px; border-radius: 8px; background: var(--ink); color: var(--green); font-size: 13px; font-weight: 800; white-space: nowrap; }
.wodb__note { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-size: 15px; }

/* =========================================================================
   WOD: programmazione e configuratore (staff)
   ====================================================================== */

.plan { display: grid; gap: 8px; margin: 0 0 24px; }
.plan__day {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px; border-radius: var(--r);
    background: var(--surface); border: 1px solid var(--line);
}
.plan__day.is-today { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.plan__date { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.plan__date strong { font: 26px/1 var(--display); color: var(--text); }
.plan__items { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.plan__wod {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: var(--r-sm); background: var(--surface-2); color: inherit; text-decoration: none;
    border: 1px solid transparent;
}
.plan__wod:hover { border-color: var(--green); }
.plan__wod { min-width: 0; }
.plan__tipo { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; background: var(--green); color: var(--ink); font: 12px/1 var(--display); letter-spacing: .06em; }
.plan__wod--hyrox .plan__tipo { background: #ffd400; }
.plan__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.plan__text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan__add { display: flex; gap: 6px; }
.chip-link { padding: 5px 10px; border-radius: 999px; border: 1px dashed #c9cdd2; color: var(--muted); font-size: 12px; font-weight: 800; text-decoration: none; }
.chip-link:hover { border-color: var(--green); color: var(--green-700); }
.plan--past .plan__add { display: none; }

.wodedit { display: grid; gap: 16px; align-items: start; padding-bottom: 80px; }
@media (min-width: 1100px) { .wodedit { grid-template-columns: minmax(0, 1fr) 380px; } }
.wodedit__sticky { position: sticky; top: 16px; }
.wodedit__previewlabel { margin: 0 0 8px; font: 16px/1 var(--display); text-transform: uppercase; }
.wodedit__previewlabel small { font: 12px var(--font); color: var(--muted); text-transform: none; margin-left: 6px; }
.wodedit__preview:empty::before { content: "L'anteprima compare qui"; color: var(--muted); }
.wodedit__addblock { display: flex; flex-wrap: wrap; gap: 8px; }
.wodedit__head .form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.wblock { padding: 16px; }
.wblock__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wblock__num { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--green); font: 15px/1 var(--display); }
.wblock__title { flex: 1 1 auto; font: 18px/1.2 var(--display) !important; text-transform: uppercase; }
.wblock__tools, .mv__tools { display: flex; gap: 4px; flex: 0 0 auto; }
.wblock__tools .icon-btn, .mv__tools .icon-btn { width: 34px; height: 34px; font-weight: 800; }
.wblock__params { margin: 12px 0 4px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; }
.wblock__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wblock__notes { margin-top: 10px; }

.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchips--team { margin-top: 10px; }
.fchip {
    padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
    font-weight: 800; font-size: 14px; cursor: pointer; transition: all .15s;
}
.fchip:hover { border-color: var(--text); }
.fchip.is-active { background: var(--ink); border-color: var(--ink); color: var(--green); }
.fchip--sm { padding: 6px 10px; font-size: 13px; }

.range { display: flex; align-items: center; gap: 6px; }
.range span { color: var(--muted); }

.mvlist { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.mv {
    display: grid; gap: 6px; align-items: center;
    grid-template-columns: 34px minmax(0, 2.4fr) 78px 92px minmax(0, 1.2fr) auto;
    padding: 8px; border-radius: var(--r-sm); background: var(--surface-2);
}
.mv .input { min-height: 40px; padding: 8px 10px; }
.mv__n { font: 14px/1 var(--display); color: var(--muted); text-align: center; text-transform: uppercase; }
.mv__note { grid-column: 2 / 6; }
/* la riga si adatta allo spazio del blocco, non dello schermo (con la barra laterale il blocco è stretto) */
.wblock { container-type: inline-size; }
@container (max-width: 680px) {
    .mv { grid-template-columns: 28px 1fr 1fr auto; }
    .mv__ex { grid-column: 2 / 5; }
    .mv__qty { grid-column: 2; }
    .mv__unit { grid-column: 3; }
    .mv__load { grid-column: 2 / 4; }
    .mv__note { grid-column: 2 / 5; }
    .mv__tools { grid-column: 4; grid-row: 2 / 4; flex-direction: column; }
}

.combo { position: relative; }
.combo__list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
    max-height: 320px; overflow-y: auto;
    border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.combo__cat { position: sticky; top: 0; padding: 6px 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.combo__opt { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.combo__opt small { color: var(--muted); font-weight: 500; }
.combo__opt:hover, .combo__opt.is-active { background: var(--green-50); }
.combo__opt--add { color: var(--green-700); font-weight: 800; border-top: 1px solid var(--line); }
.combo__empty { padding: 10px 12px; color: var(--muted); }

.savebar {
    position: fixed; z-index: 24; left: 0; right: 0;
    bottom: calc(var(--tabbar-h) + var(--safe-b));
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 16px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.savebar__actions { display: flex; align-items: center; gap: 8px; }
.savebar .switch { min-height: 40px; }
@media (max-width: 440px) {
    .savebar { padding: 10px 12px; }
    .savebar__lbl { display: none; }
    .savebar .btn--sm { padding: 7px 10px; }
}
@media (min-width: 1024px) { .savebar { left: var(--sidebar-w); bottom: 0; padding: 12px 40px; } }

.exgroup .exrow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.exgroup .exrow:first-of-type { border-top: 0; }
.exrow .input { min-height: 40px; padding: 7px 10px; }
.exrow.is-off .exrow__name { color: var(--muted); text-decoration: line-through; }
.exrow.is-saved .exrow__name { border-color: var(--green); }
@media (max-width: 600px) { .exgroup .exrow { grid-template-columns: 1fr 1fr auto; } .exrow__name { grid-column: 1 / -1; } }

/* =========================================================================
   Shop e ordini
   ====================================================================== */

.shop-group { margin: 0 0 22px; }
.prods { display: grid; gap: 12px; }
@media (min-width: 640px) { .prods { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; } }
.prod {
    position: relative;
    display: flex; flex-direction: column; gap: 4px;
    min-height: 160px; padding: 16px;
    border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.prod:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--green); }
.prod__tag { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.prod__name { margin-top: 6px; font: 22px/1.1 var(--display); text-transform: uppercase; }
.prod__desc { color: var(--muted); font-size: 14px; }
.prod__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.prod__price { font: 30px/1 var(--display); }
.prod__go { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--ink); }
.prod--dark {
    background: linear-gradient(160deg, rgba(129, 215, 0, .16), rgba(129, 215, 0, 0) 55%), var(--ink);
    border-color: var(--ink); color: #fff;
}
.prod--dark:hover { border-color: var(--green); box-shadow: 0 10px 30px rgba(129, 215, 0, .18); }
.prod--dark .prod__tag { background: rgba(129, 215, 0, .16); color: var(--green); }
.prod--dark .prod__desc { color: var(--ink-text); }
.prod--dark .prod__price { color: var(--green); }
@media (max-width: 639px) { .prod { min-height: 0; } }

.order-sum__name { margin: 4px 0 6px; font: 24px/1.1 var(--display); text-transform: uppercase; }
.order-sum__total { font: 24px/1 var(--display); color: var(--green-700); }
.rows .row--total { border-top: 2px solid var(--text); }
.pay-info { margin-bottom: 14px; }
.pay-info td strong { word-break: break-all; }
.cert-status__main { flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) { .cert-status { flex-wrap: wrap; } .cert-status > .btn { width: 100%; } }

.field--spaced { margin-top: 16px; }
.field--full { grid-column: 1 / -1; }
.btn--spaced { margin-top: 10px; }
.card--spaced { margin-top: 20px; }
.form-narrow { max-width: 760px; }
.stack-sm > * + * { margin-top: 12px; }
.link-more { display: inline-block; margin-top: 8px; font-weight: 700; text-decoration: none; }
.summary__item--link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; text-decoration: none; }
.summary__item--link:hover { border-color: var(--text); }
.summary__item--link .icon { width: 15px; height: 15px; }
.table td a { color: inherit; }
.table--orders tr.is-open td { background: #fffaf0; }
@media (max-width: 720px) { .table--orders tr.is-open { border-color: #ffd28a; background: #fffaf0; } }
.timeline .row { align-items: flex-start; }
.period-row + .period-row { margin-top: 12px; }
.people--spaced { margin-bottom: 22px; }
.person--off { opacity: .6; }
.price-tag { font: 20px/1 var(--display); }

/* Nuovo ordine in segreteria */
.pick-list { display: grid; gap: 8px; }
.pick {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--line); border-radius: var(--r);
    transition: border-color .15s, background-color .15s;
}
.pick.is-on { border-color: var(--green); background: var(--green-50); }
.pick__main { display: flex; flex-direction: column; min-width: 0; }
.pick__price { position: relative; width: 108px; }
.pick__eur { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.pick__price .input { min-height: 40px; padding: 6px 10px 6px 26px; text-align: right; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .input { width: 52px; min-height: 40px; padding: 6px; text-align: center; -moz-appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .icon-btn { font-size: 19px; font-weight: 800; line-height: 1; }
@media (max-width: 560px) {
    .pick { grid-template-columns: minmax(0, 1fr) auto; }
    .pick__main { grid-column: 1 / -1; }
}
.order-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; border-top: 2px solid var(--text); }
.order-total strong { font: 30px/1 var(--display); color: var(--green-700); }
@media (min-width: 1100px) { .sticky-side { position: sticky; top: 24px; } }
.row__title a { color: inherit; text-decoration: none; }
.row__title a:hover { color: var(--green-700); text-decoration: underline; }
