/* SlotMedico - stile su Bootstrap 5 */
:root {
    --cm-primary: #0b7285;
    --cm-primary-2: #1c7ed6;
    --cm-bg: #f6f8fb;
    --cm-radius: 18px;
    --cm-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-link-color-rgb: 11, 114, 133;
    --bs-link-hover-color-rgb: 8, 85, 99;
}
body { background: var(--cm-bg); }
.cm-public { background: #fff; }

/* Bottone principale */
.btn-cm {
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2));
    border: 0; font-weight: 600; box-shadow: 0 6px 16px rgba(11, 114, 133, .25);
}
.btn-cm:hover { filter: brightness(1.07); }

/* Navigazione e logo */
.cm-nav { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); }
.cm-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.cm-logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2)); }

/* Card */
.cm-card { background: #fff; border-radius: var(--cm-radius); box-shadow: var(--cm-shadow); border: 1px solid rgba(15, 23, 42, .05); }
.cm-card-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cm-card-link:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(15, 23, 42, .1); }
.cm-card-featured { border: 2px solid var(--cm-primary); }
.cm-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem;
    color: var(--cm-primary); background: rgba(11, 114, 133, .1); flex-shrink: 0; }
.cm-avatar { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-weight: 700; font-size: 1.2rem;
    color: #fff; background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2)); flex-shrink: 0; }
.cm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.cm-badge { background: rgba(11, 114, 133, .1); color: var(--cm-primary); font-weight: 600; }
.cm-check li { padding-left: 1.6rem; position: relative; margin-bottom: .5rem; }
.cm-check li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; color: var(--cm-primary); }

/* Home */
.cm-hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(28, 126, 214, .15), transparent),
    radial-gradient(900px 400px at -10% 20%, rgba(11, 114, 133, .12), transparent); }
.cm-gradient-text { background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cm-section-alt { background: var(--cm-bg); }
.cm-cta { border-radius: 28px; color: #fff; background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2)); }
.cm-footer { border-top: 1px solid rgba(15, 23, 42, .08); color: #64748b; }
.cm-phone { width: 300px; max-width: 100%; padding: 12px; border-radius: 40px; background: #0f172a; box-shadow: 0 30px 60px rgba(15, 23, 42, .25); }
.cm-phone-screen { background: #fff; border-radius: 30px; padding: 24px 18px; min-height: 480px; }
.cm-step-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; margin-bottom: .4rem; }
.cm-chip { display: inline-block; padding: .5rem .9rem; border-radius: 12px; border: 1px solid #e2e8f0; }
.cm-chip.active, .cm-slot.active { background: var(--cm-primary); color: #fff; border-color: var(--cm-primary); }
.cm-slot { display: inline-block; padding: .4rem .7rem; border-radius: 10px; border: 1px solid #e2e8f0; font-weight: 600; font-size: .9rem; }
.cm-wa { display: flex; gap: .6rem; padding: .8rem; border-radius: 14px; background: #dcf8c6; font-size: .85rem; }
.cm-wa .bi { color: #25d366; font-size: 1.4rem; }

/* Home: programma Fondatori, animazione del telefono, calcolatore, pulsante fisso */
.cm-founders { display: flex; gap: .7rem; align-items: flex-start; background: #fff9db; border: 1px solid #ffe066; border-radius: 14px; padding: .7rem .9rem; font-size: .92rem; }
.cm-founders .bi { color: #f59f00; font-size: 1.3rem; line-height: 1; }
.cm-demo-stage { position: relative; min-height: 270px; }
.cm-demo-step { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.cm-demo-step.active { opacity: 1; transform: none; }
.cm-demo-step .cm-slot-pick { transition: all .3s; }
.cm-demo-step.picked .cm-slot-pick { background: var(--cm-primary); color: #fff; border-color: var(--cm-primary); transform: scale(1.08); }
.cm-demo-ok { margin-top: 1rem; font-weight: 700; color: #0e7c66; opacity: 0; transition: opacity .4s .4s; }
.cm-demo-step.picked .cm-demo-ok, .cm-demo-ok.show { opacity: 1; }
.cm-demo-cancel { font-size: .95rem; color: #c92a2a; background: #fdecec; border-radius: 10px; padding: .5rem .7rem; }
.cm-demo-cancel s { color: #64748b; }
.cm-demo-dots { display: flex; justify-content: center; gap: 6px; margin-top: .6rem; }
.cm-demo-dots span { width: 8px; height: 8px; border-radius: 50%; background: #dee2e6; transition: background .3s; }
.cm-demo-dots span.active { background: var(--cm-primary); }
.cm-calc-box { border-radius: 14px; padding: 1rem; }
.cm-calc-loss { background: #fdecec; color: #a61e4d; }
.cm-calc-gain { background: #e6fcf5; color: #087f5b; }
.cm-sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-top: 1px solid rgba(15, 23, 42, .08);
    transform: translateY(110%); transition: transform .3s; }
.cm-sticky-cta.show { transform: none; }
@media (prefers-reduced-motion: reduce) { .cm-demo-step, .cm-sticky-cta { transition: none; } }

/* Pagina di prenotazione */
.cm-booking-header { color: #fff; background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-2)); }
.cm-booking-header .cm-avatar { background: rgba(255, 255, 255, .2); }
.cm-booking-main { max-width: 860px; }
.cm-step { background: #fff; border-radius: var(--cm-radius); box-shadow: var(--cm-shadow); padding: 1.25rem; margin-bottom: 1rem; animation: cmIn .3s ease; }
.cm-step-title { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.cm-step-title span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .9rem;
    color: #fff; background: var(--cm-primary); }
.cm-option { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 14px; padding: .9rem 1rem; transition: all .15s; }
.cm-option:hover { border-color: var(--cm-primary); }
.cm-option.active { border-color: var(--cm-primary); background: rgba(11, 114, 133, .06); box-shadow: 0 0 0 3px rgba(11, 114, 133, .15); }
.cm-days { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.cm-day { flex: 0 0 auto; width: 68px; text-align: center; padding: .5rem 0; border-radius: 14px; border: 1.5px solid #e2e8f0;
    background: #fff; scroll-snap-align: start; line-height: 1.2; }
.cm-day small { display: block; font-size: .7rem; text-transform: uppercase; color: #64748b; }
.cm-day strong { font-size: 1.3rem; }
.cm-day.active { border-color: var(--cm-primary); background: var(--cm-primary); color: #fff; }
.cm-day.active small { color: rgba(255, 255, 255, .85); }
.cm-time { min-width: 76px; border-radius: 12px; border: 1.5px solid #e2e8f0; background: #fff; padding: .55rem .6rem; font-weight: 600; }
.cm-time:hover { border-color: var(--cm-primary); }
.cm-time.active { background: var(--cm-primary); border-color: var(--cm-primary); color: #fff; }
.cm-summary { padding: .9rem 1rem; border-radius: 14px; background: rgba(11, 114, 133, .07); }
.cm-details li { padding: .35rem 0; }
.cm-details .bi { color: var(--cm-primary); width: 1.5rem; display: inline-block; }
.cm-instructions { border-left: 5px solid #f59f00; }
.cm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@keyframes cmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Pannello */
.cm-sidebar { width: 260px; min-height: 100vh; background: #fff; border-right: 1px solid rgba(15, 23, 42, .06); }
@media (min-width: 992px) { .cm-sidebar { position: sticky; top: 0; height: 100vh; } }
.cm-sidebar .nav-link { color: #334155; border-radius: 10px; }
.cm-sidebar .nav-link.active { background: rgba(11, 114, 133, .1); color: var(--cm-primary); font-weight: 600; }
.cm-admin-main { min-width: 0; }
.cm-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; background: #f8fafc; }
.cm-today { outline: 2px solid var(--cm-primary); }

/* Statistiche: grafico a barre semplice, senza librerie */
.cm-bars { display: flex; align-items: flex-end; gap: .5rem; height: 200px; }
.cm-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.cm-bar { width: 100%; max-width: 42px; background: #a5d8ff; border-radius: 8px 8px 4px 4px; display: flex; align-items: flex-end; overflow: hidden; }
.cm-bar-online { width: 100%; background: var(--cm-primary); }
.cm-bar-value { font-weight: 600; }

/* Banner cookie */
.cm-cookie { position: fixed; z-index: 1080; left: 16px; right: 16px; bottom: 16px; max-width: 420px; padding: 1rem;
    background: #fff; border-radius: 16px; border: 1px solid rgba(15, 23, 42, .08); }

/* Logo del centro */
.cm-header-logo { background: #fff; border-radius: 14px; padding: 6px; height: 64px; min-width: 64px; max-width: 180px;
    display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); flex-shrink: 0; }
.cm-header-logo img { max-height: 52px; max-width: 168px; object-fit: contain; }
.cm-sidebar-logo { max-height: 56px; max-width: 180px; object-fit: contain; align-self: flex-start; }
.cm-logo-preview { width: 160px; height: 100px; border: 1.5px dashed #ced4da; border-radius: 14px; display: grid;
    place-items: center; padding: 8px; background: repeating-conic-gradient(#f8f9fa 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.cm-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

.cm-day-sede { display: block; font-size: .6rem; color: #64748b; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 auto; }
.cm-day.active .cm-day-sede { color: rgba(255, 255, 255, .85); }

/* Scelta orari della segreteria: anche gli orari occupati sono visibili */
.cm-day-free { display: block; font-size: .65rem; font-weight: 600; color: var(--cm-primary); margin-top: .15rem; }
.cm-day.active .cm-day-free { color: #fff; }
.cm-day-full { opacity: .6; }
.cm-day-full .cm-day-free { color: #c92a2a; }
.cm-time-busy { background: #f1f3f5; border-color: #e9ecef; color: #868e96; cursor: not-allowed; }
.cm-time-busy > span:first-child { text-decoration: line-through; }
.cm-time-reason { display: block; font-size: .65rem; font-weight: 500; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-legend { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; border: 1.5px solid #e2e8f0; }
.cm-legend-free { background: #fff; }
.cm-legend-busy { background: #f1f3f5; }

/* Stampa dell'agenda: solo le tabelle, una per ambulatorio */
@media print {
    @page { size: A4; margin: 12mm; }
    body { background: #fff !important; font-size: 11px; }
    .cm-admin-main { padding: 0 !important; }
    .cm-card { box-shadow: none !important; border: 1px solid #999 !important; }
    .cm-agenda-room thead { display: table-header-group; }
    .cm-agenda-room tr { break-inside: avoid; }
    .badge { border: 1px solid #666; color: #000 !important; background: #fff !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .alert { display: none !important; }
}

.cm-time-busy[aria-disabled="true"] { cursor: help; }

/* Configurazione guidata */
.cm-wizard { max-width: 920px; }
.cm-steps li span, .cm-steps li a { display: inline-block; padding: .35rem .9rem; border-radius: 999px; background: #f1f3f5; color: #64748b; font-size: .875rem; text-decoration: none; }
.cm-steps li.active span { background: var(--cm-primary, #0b7285); color: #fff; font-weight: 600; }
.cm-steps li.done a { background: #d3f9d8; color: #2b8a3e; }
.cm-nav-wizard { background: #fff3bf; color: #5c3c00 !important; font-weight: 600; }

/* Cruscotto della piattaforma: grafici a barre semplici */
.cm-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.cm-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.cm-bar-fill { width: 100%; min-height: 2px; background: linear-gradient(180deg, var(--cm-primary-2), var(--cm-primary)); border-radius: 4px 4px 0 0; }
.cm-bar-val { font-size: .6rem; color: #64748b; white-space: nowrap; }
.cm-bar-lbl { font-size: .6rem; color: #64748b; margin-top: 2px; }
