/*
 * Name: consenso.css
 * Version: 1.1.0
 * Note: distanze dai bordi con env(safe-area-inset-*) (telefoni con notch/barra gesti) e altezze in dvh
 *       (altezza visibile reale sui telefoni, 100vh come riserva per i browser vecchi).
 * Description: Pulsante cookie (stile del pulsante 3CX: tondo 60px, #0596d4, stessa ombra) e finestra del consenso.
 * Author: Fast Modding user ITSkydive
 * Date: 15-11-2026
 */
.fmc-bottone {
    position: fixed; z-index: 2147483000;
    left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: #0596d4; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 8px #0003, 0 6px 20px #00000030;
    transition: transform .2s ease-in-out;
}
.fmc-bottone:hover { transform: scale(1.06); }
.fmc-bottone:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.fmc-finestra {
    position: fixed; left: 20px; bottom: 92px; z-index: 2147483001;
    width: 420px; max-width: calc(100vw - 40px); max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); overflow-y: auto;
    background: #fff; color: #222; border-radius: 12px; padding: 22px 22px 18px;
    box-shadow: 0 4px 8px #0003, 0 6px 20px #00000030;
    font-size: 14px; line-height: 1.5; text-align: left; letter-spacing: 0;
}
.fmc-finestra[hidden], .fmc-finestra [hidden] { display: none !important; }
.fmc-finestra h2 {
    font-size: 18px !important; line-height: 1.3 !important; margin: 0 28px 10px 0 !important;
    color: #222; font-weight: 700; letter-spacing: 0 !important; text-transform: none;
}
.fmc-finestra p { margin: 0 0 14px; padding: 0 !important; font-weight: 400; line-height: 1.5 !important; color: #222; }
.fmc-finestra a { color: #0478aa; text-decoration: underline; }
.fmc-chiudi {
    position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: transparent; color: #555; font-size: 26px; line-height: 1; cursor: pointer;
}
.fmc-chiudi:hover { background: #f0f0f0; }

.fmc-voce { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #e6e6e6; }
.fmc-voce strong { display: block; color: #222; }
.fmc-voce span { display: block; font-size: 13px; color: #555; }
.fmc-livello2 { margin-bottom: 14px; }

/* Interruttore acceso/spento */
.fmc-interruttore { position: relative; flex: 0 0 auto; width: 44px; height: 24px; }
.fmc-interruttore input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.fmc-interruttore input:disabled { cursor: not-allowed; }
.fmc-interruttore span { position: absolute; inset: 0; border-radius: 12px; background: #c4c4c4; transition: background .2s; }
.fmc-interruttore span::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform .2s;
}
.fmc-interruttore input:checked + span { background: #0596d4; }
.fmc-interruttore input:checked + span::after { transform: translateX(20px); }
.fmc-interruttore input:disabled + span { opacity: .55; }
.fmc-interruttore input:focus-visible + span { outline: 2px solid #0596d4; outline-offset: 2px; }
.fmc-nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pulsanti: Rifiuta e Accetta con lo stesso peso visivo (richiesto dal Garante) */
.fmc-azioni { display: flex; gap: 8px; flex-wrap: wrap; }
.fmc-azione {
    flex: 1 1 0; min-width: 110px; padding: 10px 12px; border-radius: 6px; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
    background: #0596d4; color: #fff; border: 2px solid #0596d4;
}
.fmc-azione:hover { background: #0478aa; border-color: #0478aa; }
.fmc-azione[data-fmc="personalizza"] { background: #fff; color: #0478aa; }
.fmc-azione[data-fmc="personalizza"]:hover { background: #eef7fc; }
.fmc-azione:focus-visible { outline: 2px solid #222; outline-offset: 2px; }

/* Segnaposto della mappa finché non c'è il consenso */
.fmc-segnaposto {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    height: 100%; min-height: 300px; padding: 20px; text-align: center;
    background: rgba(255, 255, 255, .08); border: 1px dashed rgba(255, 255, 255, .35); border-radius: 6px;
}
.fmc-segnaposto p { margin: 0; }
.fmc-segnaposto button {
    padding: 10px 18px; border-radius: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
    background: #0596d4; color: #fff;
}

@media (max-width: 520px) {
    .fmc-bottone { left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .fmc-azioni { flex-wrap: nowrap; gap: 6px; }
    .fmc-azione { min-width: 0; padding: 10px 4px; font-size: 13px; }
    .fmc-finestra { left: 10px; right: 10px; bottom: 86px; width: auto; max-width: none; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); padding: 18px 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .fmc-bottone, .fmc-interruttore span, .fmc-interruttore span::after { transition: none; }
}
