/* ============================================================
   MODAL STYLES
   ============================================================ */

/* Mantieni overlay inattivo di default */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;            /* nascosto finché non serve */
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.0);
    pointer-events: none;
    /* transition: background-color .2s ease, opacity .2s ease; */
    overscroll-behavior: contain;
    z-index: 20000;
}

/* Quando il modal è visibile attivalo esplicitamente */
.modal-overlay.visible {
    display: flex !important;
    background-color: rgba(0,0,0,0.6) !important;
    pointer-events: auto !important;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

/* --- FIX PUNTO 1: ANIMAZIONE SUCCESSO --- */
/* Usiamo un selettore molto specifico per vincere sul gradiente */
button.btn.btn-success-anim {
    /* 1. Spegni tutto quello che c'era prima */
    background-image: none !important;
    animation: none !important;
    transition: none !important;
    
    /* 2. Applica il Verde */
    background-color: #05ab3a !important; /* Verde solido */
    border: 1px solid #05ab3a !important;
    color: white !important;
    
    /* 3. Effetti */
    opacity: 1 !important;
    transform: scale(0.95) !important; /* Leggermente più piccolo */
    box-shadow: 0 0 0 4px rgba(5, 171, 58, 0.3) !important; /* Alone verde */
    
    /* 4. Layout */
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.btn-icon-check {
    font-size: 22px;
    margin-right: 8px;
    font-weight: bold;
    display: inline-block;
}



/* --- PREMIUM SUCCESS POPUP (Real Glass) --- */

.success-box-glass {
    width: 130px;
    height: 130px;
    
    /* SFONDO: Molto trasparente (0.3) e leggermente più chiaro per non sembrare "buio" */
    background: rgba(50, 50, 60, 0.3) !important;
    
    /* SFOCATURA: Alta per l'effetto ghiaccio */
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    
    /* BORDO: Sottilissimo e semitrasparente */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 24px;
    
    /* LAYOUT */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* OMBRA: Leggera */
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
    
    /* ANIMAZIONE */
    transform: scale(0.8);
    opacity: 0;
    animation: popupSpring 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Testo sotto l'icona */
.success-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-top: 15px;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: fadeInText 0.3s ease 0.3s forwards;
}

/* Icona SVG */
.checkmark-icon {
    width: 50px;
    height: 50px;
    display: block;
    stroke-width: 4;
    stroke: #05ab3a; /* Verde Acceso */
    stroke-miterlimit: 10;
    stroke-linecap: round;
    fill: none;
    filter: drop-shadow(0 0 8px rgba(5, 171, 58, 0.5)); /* Glow Verde */
}

/* Animazione Cerchio */
.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 4;
    stroke: rgba(255, 255, 255, 0.1); /* Cerchio base grigio chiaro */
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* Animazione Spunta */
.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}
