/* Davide style — stile del sito: bianco, pulito, rosso del logo come unico accento */

@font-face { font-family: "Great Vibes"; src: url("../fonts/great-vibes.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url("../fonts/inter-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500; src: url("../fonts/inter-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url("../fonts/inter-600.woff2") format("woff2"); font-display: swap; }

:root {
    --ds-red: #d0101a;
    --ds-red-dark: #a50d15;
    --ds-red-soft: #fdecec;
    --ds-ink: #222;
    --ds-muted: #6b6b6b;
    --ds-line: #e8e8e8;
    --ds-bg-soft: #faf9f8;
    --bs-primary: var(--ds-red);
    --bs-primary-rgb: 208, 16, 26;
    --bs-link-color: var(--ds-red);
    --bs-link-color-rgb: 208, 16, 26;
    --bs-link-hover-color: var(--ds-red-dark);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--ds-ink);
    --bs-border-radius: .6rem;
}

body { -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

.script { font-family: "Great Vibes", cursive; font-weight: 400; letter-spacing: .01em; }
h1.script, .h1.script { font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1.1; }
h2.script, .h2.script { font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1.15; }
.text-red { color: var(--ds-red) !important; }
.text-muted-ds { color: var(--ds-muted) !important; }
.bg-soft { background: var(--ds-bg-soft); }

.btn-primary {
    --bs-btn-bg: var(--ds-red); --bs-btn-border-color: var(--ds-red);
    --bs-btn-hover-bg: var(--ds-red-dark); --bs-btn-hover-border-color: var(--ds-red-dark);
    --bs-btn-active-bg: var(--ds-red-dark); --bs-btn-active-border-color: var(--ds-red-dark);
    --bs-btn-disabled-bg: var(--ds-red); --bs-btn-disabled-border-color: var(--ds-red);
}
.btn-outline-primary {
    --bs-btn-color: var(--ds-red); --bs-btn-border-color: var(--ds-red);
    --bs-btn-hover-bg: var(--ds-red); --bs-btn-hover-border-color: var(--ds-red);
    --bs-btn-active-bg: var(--ds-red-dark); --bs-btn-active-border-color: var(--ds-red-dark);
}
.btn { font-weight: 500; }
.btn-lg { padding: .8rem 1.6rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #e8888c; box-shadow: 0 0 0 .2rem rgba(208, 16, 26, .15);
}
.form-check-input:checked { background-color: var(--ds-red); border-color: var(--ds-red); }

/* Barra di navigazione */
.navbar-ds { background: #fff; border-bottom: 1px solid var(--ds-line); }
.navbar-ds .navbar-brand { font-family: "Great Vibes", cursive; font-size: 1.9rem; color: var(--ds-ink); padding: 0; }
.navbar-ds .navbar-brand img { height: 38px; width: auto; margin-right: .25rem; }
.navbar-ds .nav-link { color: var(--ds-ink); font-weight: 500; }
.navbar-ds .nav-link.active, .navbar-ds .nav-link:hover { color: var(--ds-red); }
.navbar-ds .badge-pending { font-size: .7rem; vertical-align: top; }

/* Home */
.hero { padding: 3rem 0 2.5rem; text-align: center; }
.hero img.logo { width: min(340px, 78vw); height: auto; }
.hero .lead { color: var(--ds-muted); max-width: 34rem; margin: 0 auto 1.6rem; }
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--ds-line); }
.hours-table td { padding: .4rem 0; }
.hours-table tr.today td { color: var(--ds-red); font-weight: 600; }
.map-frame { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--bs-border-radius); background: var(--ds-bg-soft); }
.contact-list li { margin-bottom: .6rem; }
.contact-list .bi { color: var(--ds-red); width: 1.6rem; display: inline-block; }
.social a { font-size: 1.6rem; color: var(--ds-ink); margin-right: 1rem; }
.social a:hover { color: var(--ds-red); }

/* Card e pannelli */
.card-ds { border: 1px solid var(--ds-line); border-radius: 1rem; background: #fff; }
.auth-wrap { max-width: 460px; margin: 2rem auto 3rem; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--ds-muted); font-size: .85rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--ds-line); }
.btn-social { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; border: 1px solid #d5d5d5; background: #fff; color: var(--ds-ink); }
.btn-social:hover { background: var(--ds-bg-soft); }
.btn-social[disabled] { opacity: .55; }
.btn-social .soon { font-size: .75rem; color: var(--ds-muted); }
.step-done { color: #198754; }
.step-todo { color: var(--ds-muted); }

/* Footer */
footer.site { border-top: 1px solid var(--ds-line); padding: 2rem 0 5rem; font-size: .9rem; color: var(--ds-muted); }
footer.site a { color: var(--ds-muted); }
footer.site a:hover { color: var(--ds-red); }

/* Banner "installa l'app" */
.install-banner {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1050; max-width: 520px; margin: 0 auto;
    background: #fff; border: 1px solid var(--ds-line); border-radius: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: 1rem 1.1rem;
}
.install-banner img { width: 44px; height: 44px; border-radius: .6rem; border: 1px solid var(--ds-line); }
.ios-steps li { margin-bottom: .5rem; }
.ios-steps .bi { color: #0a84ff; }

/* Avvisi */
.alert { border-radius: .8rem; }
.note-warning { background: #fff8db; border: 1px solid #f1e3a1; border-radius: .8rem; padding: .8rem 1rem; }

/* Stampa */
@media print {
    .navbar-ds, footer.site, .no-print, .install-banner { display: none !important; }
    body { font-size: 11pt; }
}

/* Calendario di prenotazione */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.cal-head div { text-align: center; font-size: .75rem; color: var(--ds-muted); text-transform: uppercase; }
.cal-day {
    aspect-ratio: 1 / 1; border: 1px solid var(--ds-line); border-radius: .6rem; background: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: .95rem; padding: 0;
}
.cal-day.free { border-color: #9bd3ae; background: #f1faf4; color: #146c43; cursor: pointer; }
.cal-day.free:hover { background: #dff3e6; }
.cal-day.full { background: #f6f6f6; color: #b0b0b0; text-decoration: line-through; }
.cal-day.closed, .cal-day.past { background: #fafafa; color: #c9c9c9; border-color: #f0f0f0; }
.cal-day.selected { background: var(--ds-red); border-color: var(--ds-red); color: #fff; }
.cal-day.empty { border: 0; background: none; }
.cal-legend { display: flex; gap: 1rem; flex-wrap: wrap; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: -1px; }
.dot-free { background: #9bd3ae; } .dot-full { background: #d6d6d6; } .dot-closed { background: #efefef; border: 1px solid #ddd; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .4rem; }
.slot-grid .btn { padding: .45rem 0; }
.slot-grid .btn.after-closing { border-style: dashed; }
.summary-box { position: sticky; bottom: .75rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.status-badge { font-size: .75rem; }
.slot-grid .btn.active, .slot-grid .btn.active:hover { background: var(--ds-red); border-color: var(--ds-red); color: #fff; }
.btn-check:checked + .btn-outline-secondary, .btn-check:checked + .btn-outline-secondary:hover {
    background: var(--ds-red-soft); border-color: var(--ds-red); color: var(--ds-ink); box-shadow: inset 0 0 0 1px var(--ds-red);
}
.btn-check:checked + .btn-outline-secondary .text-muted-ds { color: var(--ds-red) !important; }
.cap-first { display: inline-block; }
.cap-first::first-letter { text-transform: uppercase; }

/* ---------- Pannello staff ---------- */
.staff-tools { position: fixed; right: .75rem; bottom: .75rem; z-index: 1040; display: flex; gap: .4rem; }
.staff-tools .btn { border: 1px solid var(--ds-line); border-radius: 50%; width: 2.6rem; height: 2.6rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sound-banner { position: sticky; top: 0; z-index: 1035; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; }
.lg { display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; vertical-align: -1px; }
.lg-confirmed { background: #fdecec; border: 1px solid var(--ds-red); }
.lg-pending { background: #fff8db; border: 1px dashed #c99a06; }
.lg-pause { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #f1c9cb 3px, #f1c9cb 6px); border: 1px solid #e6a9ac; }

.agenda { position: relative; display: flex; border: 1px solid var(--ds-line); border-radius: .8rem; background: #fff; overflow: hidden; }
.agenda-times { position: relative; width: 3.4rem; flex: 0 0 3.4rem; border-right: 1px solid var(--ds-line); background: var(--ds-bg-soft); }
.agenda-time { position: absolute; left: 0; right: 0; font-size: .7rem; color: #aaa; text-align: right; padding: 2px 6px 0 0; }
.agenda-time.hour { color: var(--ds-ink); font-weight: 600; font-size: .8rem; border-top: 1px solid var(--ds-line); }
.agenda-body { position: relative; flex: 1; }
.agenda-slot { position: absolute; left: 0; right: 0; border-top: 1px dotted #eee; display: block; text-decoration: none; }
.agenda-slot.hour { border-top: 1px solid var(--ds-line); }
.agenda-slot:hover { background: #f6fbf7; }
.agenda-slot.closed { background: repeating-linear-gradient(-45deg, #fafafa, #fafafa 6px, #f3f3f3 6px, #f3f3f3 12px); }
.agenda-slot .free { position: absolute; right: 6px; top: 6px; font-size: .68rem; color: #5aa877; }
.agenda-slot .free.none { color: #c0c0c0; }
.agenda-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--ds-red); z-index: 3; pointer-events: none; }
.agenda-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ds-red); }
.appt {
    position: absolute; z-index: 2; border-radius: .5rem; background: #fdecec; border: 1px solid var(--ds-red);
    color: var(--ds-ink); text-decoration: none; overflow: hidden; font-size: .8rem; line-height: 1.2;
    border-left-width: 4px;
}
.appt:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 4; }
.appt-inner { position: relative; padding: 3px 6px; }
.appt-time { font-size: .72rem; color: var(--ds-muted); display: flex; gap: .3rem; align-items: center; }
.appt-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-tr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #555; }
.appt-flag { font-size: .7rem; font-weight: 600; text-transform: uppercase; color: #8a6d00; }
.appt.st-pending { background: #fff8db; border: 1px dashed #c99a06; border-left: 4px solid #c99a06; }
.appt.st-no_show { background: #f2f2f2; border-color: #aaa; color: #888; }
.appt.overtime { box-shadow: inset 0 -3px 0 #c99a06; }
.appt .pause { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.85), rgba(255,255,255,.85) 4px, rgba(208,16,26,.18) 4px, rgba(208,16,26,.18) 8px); border-top: 1px dashed var(--ds-red); border-bottom: 1px dashed var(--ds-red); }
.appt .pause span { position: absolute; right: 4px; bottom: 2px; font-size: .65rem; color: var(--ds-red); }

@media print {
    .agenda-slot .free, .agenda-slot.closed { display: none; }
    .appt { border: 1px solid #000 !important; background: #fff !important; }
}

/* ---------- Tessera fedeltà ---------- */
.loyalty { max-width: 420px; margin: 0 auto; }
.loyalty-flip { display: block; width: 100%; border: 0; background: none; padding: 0; perspective: 1200px; cursor: pointer; }
.loyalty-inner { position: relative; width: 100%; aspect-ratio: 1 / 1; transition: transform .6s; transform-style: preserve-3d; }
.loyalty.flipped .loyalty-inner { transform: rotateY(180deg); }
.loyalty-face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 1rem;
    background: #fdfdfb; border: 1px solid #e4e1dc; box-shadow: 0 10px 28px rgba(0, 0, 0, .10); padding: 7% 7% 6%;
    display: flex; flex-direction: column; align-items: center; color: var(--ds-ink);
}
.loyalty-front { transform: rotateY(180deg); justify-content: center; text-align: center;
    background: radial-gradient(circle at 50% 30%, #fff 0%, #fbf8f5 70%); }
.loyalty-logo { width: 62%; height: auto; }
.loyalty-brand { font-size: 2.4rem; line-height: 1; margin-top: -.3rem; }
.loyalty-name { font-weight: 600; font-size: 1.15rem; margin-top: .9rem; letter-spacing: .02em; }
.loyalty-label { color: var(--ds-red); font-size: 1.05rem; margin-top: .4rem; }
.loyalty-terms { color: var(--ds-muted); font-size: .85rem; margin-top: .2rem; }
.loyalty-title { font-size: 2.2rem; line-height: 1.1; margin-bottom: 4%; text-shadow: 0 6px 10px rgba(0, 0, 0, .12); }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); width: 100%; flex: 1;
    border: 1.5px solid #555; }
.stamps .cell { border: 1px solid #777; display: flex; align-items: center; justify-content: center; overflow: visible; }
.stamp { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(1.6rem, 7vw, 2.4rem); color: #2b2b2b;
    filter: url(#ink); display: inline-block; text-shadow: 0 0 1px rgba(0,0,0,.4);
    -webkit-text-stroke: .5px rgba(0,0,0,.35); }
.stamp.new { animation: stamp-in .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp.new:nth-of-type(1) { animation-delay: .3s; }
@keyframes stamp-in { 0% { transform: scale(2.6) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { } }
.loyalty-count { margin-top: 4%; font-size: .95rem; }
.loyalty-hint { text-align: center; color: var(--ds-muted); font-size: .8rem; margin-top: .6rem; }
.loyalty.complete .loyalty-face { background: var(--ds-red); border-color: var(--ds-red-dark); color: #fff; }
.loyalty.complete .stamps, .loyalty.complete .stamps .cell { border-color: rgba(255,255,255,.7); }
.loyalty.complete .stamp { color: #fff; -webkit-text-stroke: 0; }
.loyalty.complete .loyalty-label, .loyalty.complete .loyalty-terms { color: #fff; }
.loyalty.complete .loyalty-logo { filter: brightness(0) invert(1); }
.loyalty.small { max-width: 240px; margin: 0; }
.loyalty.small .loyalty-title { font-size: 1.4rem; }
.loyalty.small .stamp { font-size: 1.2rem; }
.loyalty.small .loyalty-brand { font-size: 1.5rem; }
.loyalty.small .loyalty-name, .loyalty.small .loyalty-label { font-size: .85rem; margin-top: .3rem; }
.loyalty.small .loyalty-terms, .loyalty.small .loyalty-count { font-size: .7rem; }
.paper-card { background: #f1f1f1; border: 1px dashed #bbb; border-radius: .8rem; padding: 1rem; text-align: center; color: #555; }

/* Statistiche */
.vbars { display: flex; align-items: flex-end; gap: .35rem; height: 200px; padding-top: 1.2rem; }
.vbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.vbar-fill { width: 100%; background: var(--ds-red); border-radius: .3rem .3rem 0 0; min-height: 2px; }
.vbar-val { font-size: .7rem; color: var(--ds-muted); }
.vbar-label { font-size: .65rem; color: var(--ds-muted); margin-top: .2rem; white-space: nowrap; }
.hbar-track { background: #f1f1f1; border-radius: .3rem; height: .55rem; }
.hbar-fill { background: var(--ds-red); height: 100%; border-radius: .3rem; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: .72rem; }
.heat th { color: var(--ds-muted); font-weight: 500; text-align: center; padding: 0 .3rem; }
.heat td { width: 2.4rem; height: 2rem; text-align: center; border-radius: .3rem; color: #333; }
/* Timbro come quello del salone: lettera in un riquadro */
.stamp { border: .12em solid currentColor; border-radius: .08em; padding: 0 .16em; line-height: 1.05; }

/* Gli elementi nascosti restano nascosti anche con le classi di layout di Bootstrap */
[hidden] { display: none !important; }
