html {
    background-color: #000000;
    min-height: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Fix per Safari iOS */
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    overscroll-behavior-y: none; /* Previene bounce scroll su iOS */
    -webkit-overflow-scrolling: touch;
}

body {
    overflow: hidden;
}

body.loaded {
    overflow: auto;
}

/* Contenitore principale */
.container {
    min-height: 100vh;
    min-height: 100dvh; /* Fix per Safari iOS */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Sfondo sfocato - VERSIONE CORRETTA PER iOS */
.container::before {
    content: "";
    position: fixed; /* IMPORTANTE: fixed invece di absolute per iOS */
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* Fallback */
    background-image: url("resources/sfondo.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Importante per iOS */
    
    /* parte nitida */
    filter: blur(0px);
    -webkit-filter: blur(0px);
    transform: scale(1);
    -webkit-transform: scale(1);
    will-change: filter, transform; /* Ottimizzazione per iOS */

    /* animazione sfocatura */
    animation: bgBlur 1.8s ease-out 0.1s forwards;
    -webkit-animation: bgBlur 1.8s ease-out 0.1s forwards;

    z-index: -1;
}

/* Assicura che tutto il resto sia sopra lo sfondo */
#content {
    flex: 1;
    position: relative;
    z-index: 1;
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

#content.hidden {
    transform: translateY(-100%);
    opacity: 0;

    /* NUOVO: collassa lo spazio occupato */
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.logo-space {
    display: flex;
    justify-content: center;
    height: 15vh;
    width: 100%;
    align-items: center;  
}

/* LOGO in alto centrato */
.logo {
    position: absolute;
    /*top: 20px;*/
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

/* Effetto glow intorno al logo */
.logo img {
    width: 15vh;
    filter:
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.9))
        drop-shadow(0 0 16px rgba(0, 0, 0, 0.9));

        /* ANIMAZIONE all'apertura */
    opacity: 0;                             /* parte invisibile */
    animation: logoIntro 1.2s ease-out 0.2s forwards;
}

/* Contenitore locandina, centrato */
.poster {
    display: flex;
    justify-content: center;
}

/* Immagine locandina con aspect ratio originale */
.poster-image {
    width: min(45vh, 80vw);    /* responsive */
    height: auto;          /* mantiene aspect ratio originale */
    /*border: 10px solid #0000002d; /* Bordino nero di 10px */
    border-radius: 5px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.527);
    display: block;

    /* parte nascosta */
    opacity: 0;
    transform: translateY(25px) scale(0.9);

    /* compare SOLO dopo sfondo+logo */
    animation: posterIntro 0.9s ease-out 1.5s forwards;
}

.data,
.luogo {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /*font-family: "Alumni Sans Pinstripe", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;*/
    /*font-family: "Poiret One", sans-serif;*/
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.30em;
    font-weight: 700;
    text-align: center;

    /* parte nascosta per animazione */
    filter:
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.9))
        drop-shadow(0 0 16px rgba(0, 0, 0, 0.9));
    opacity: 0;
}

/* data prima */
.data {
    margin-top: 2.1vh;
    margin-bottom: 1vh;
    font-size: 2.4vh;
    animation: textIntro 0.7s ease-out 2.5s forwards;
}

/* luogo subito dopo */
.luogo {
    font-size: 1.9vh;
    animation: textIntro 0.7s ease-out 2.8s forwards;
}


.btn-book {
    margin-top: 1vh;

    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;

    width: 20vh;
    height: 4vh;
    border-radius: 15px;

    text-decoration: none;
    font-family: 'Poppins', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    font-size: 1.5vh;
    text-align: center;

    background: #ffffff1e;
    border: 1px solid #ffffff62;
    color: #ffffff;

    /* stato iniziale */
    opacity: 0;
    transform: scale(1);  /* base */

    /* transizione per l’hover (compreso transform) */
    transition: background 0.35s ease,
                color 0.35s ease,
                transform 0.35s ease;

    /* animazione di ingresso: SOLO opacity + margin-top */
    animation: buttonIntro 0.7s ease-out 3.5s forwards;
}

/* HOVER: qui avviene l’ingrandimento graduale */
.btn-book:hover {
    background: #a0000086;
    color: #ffffff;
    transform: scale(1.1);
}

@keyframes buttonIntro {
    0% {
        opacity: 0;
        margin-top: 2vh;  /* parte un po' più giù */
    }
    100% {
        opacity: 1;
        margin-top: 1.5vh;  /* torna al valore normale */
    }
}


.footer {
    margin-top: auto;
    width: 100%;
    padding: 2vh 2vh 1vh 2vh;
    box-sizing: border-box; 
    
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.2vh;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #ffffff;
    text-align: center;
    position: relative;
    z-index: 10;

    /* Animazione */
    opacity: 0;
    animation: footerIntro 0.7s ease-out 3.8s forwards;
}

@keyframes footerIntro {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 0.7; 
        transform: translateY(0);
    }
}

/* Animazione locandina */
@keyframes posterIntro {
    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


@keyframes logoIntro {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9); 
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1); 
    }
}

@keyframes bgBlur {
    0% {
        filter: blur(0px);
        transform: scale(1);
    }
    100% {
        filter: blur(6px);   
        transform: scale(1.05); 
    }
}

@keyframes textIntro {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    background: #222;
    padding: 2vh;
    border-radius: 12px;
    overflow: hidden;   
    
    /* Stato aperto */
    max-height: 500px;        
    opacity: 1;
    transform: translateY(0);

    /* Animazione */
    transition:
    max-height 0.4s ease,
    opacity 0.4s ease,
    transform 0.4s ease;
}

/* Stato chiuso (slide up + fade) */
.panel.chiusa {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
}


/* ===== FORM PRENOTAZIONE ===== */

/* ===== FORM SECTION - Wrapper principale ===== */
.form-section {
    position: fixed;
    inset: 0;
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    margin-top: auto;
    margin-bottom: auto;
    max-height: 80%;
}

.form-section.visible {
    opacity: 1;
    pointer-events: auto;
}

.form-section.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== INFO WRAPPER - Modificato per layout flex ===== */
.form-info-wrapper {
    position: relative; /* CAMBIATO da fixed */
    width: auto;
    /*max-width: 40vh;*/
    padding: 0 2vh;
    margin-bottom: 2vh; /* Spazio tra info e form */
    z-index: 9;
}

/* ===== FORM CONTAINER - Modificato per layout flex ===== */
.form-container {
    position: relative; /* CAMBIATO da fixed */
    width: auto;
    padding: 2.5vh 2vh 2vh;
    max-height: 50vh;
    overflow-y: auto;
    border-radius: 10px;

    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    
    z-index: 9;
}


/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 600px) {
    .form-section {
        padding: 15px;
    }
    
    .form-info-wrapper {
        width: 100%;
        position: relative; /* CAMBIATO da fixed */
        max-height: 80%;
        max-width: 85%;
        padding: 0 16px;
        margin-bottom: 1.2vh;
    }
    
    .form-container {
        width: 85%;
        max-width: none;
        max-height: 90%;
    }
    
    .form-info {
        padding: 1.2vh 1.4vh;
    }
    
    .form-info-title {
        font-size: 1.5vh;
        margin-bottom: 1.2vh;
    }
    
    .form-info-item {
        font-size: 1.3vh;
        padding-left: 20px;
    }
    
    .form-info-price {
        font-size: 1.3vh;
    }
    
    .form-info-contact-text {
        font-size: 1vh;
    }
    
    .form-info-instagram {
        font-size: 1vh;
    }
}

.form-container h1 {
    color: #ff3b3b;
    margin-bottom: 2.5vh;
    text-align: center;
    font-size: 2.8vh;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.user-form {
    padding: 2vh;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    max-width: 100%;
    margin-bottom: 1vh;
    border-radius: 10px;

    background: #000000c9;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    
    /* Animazione di entrata */
    animation: formSlideIn 0.4s ease-out;
    transform-origin: top;
}

@keyframes formSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animazione di uscita per i form rimossi */
.user-form.removing {
    animation: formSlideOut 0.15s ease-in forwards;
}

@keyframes formSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 500px;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.formText{
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /*font-family: "Alumni Sans Pinstripe", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;*/
    /*font-family: "Poiret One", sans-serif;*/
    color: #ffffff;
    font-weight: 500;
    text-align: center;

    /* parte nascosta per animazione */
    filter:
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.9))
        drop-shadow(0 0 16px rgba(0, 0, 0, 0.9));
    opacity: 0;
    margin-bottom: 1.5vh;
    font-size: 90%;
    animation: textIntro 0.7s ease-out 2.5s forwards;
}

.formText2{
    font-size: 1.2vh;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    position: relative;
    width: 100%;

    font-family: "Funnel Sans", sans-serif;
    font-weight: 100;
    text-align: center;
}

.input-label {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8vh;
    color: #86868b;
    pointer-events: none;
    transition: all 0.2s ease;
    padding: 0 4px;
}

.input-field {
    text-indent: 13px;
    width: 100%;
    padding: 2vh 0px 0.7vh 0px;
    font-size: 1.6vh;
    border: 1px solid #1f1f1f;
    background: #1f1f1f;
    transition: border-color 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label {
    /*top: 8px;
    font-size: 12px;
    color: #a0a0a048;
    transform: translateY(0);*/
    color: #ffffff00;
    transition: ease 0.2s;
}

.input-field:not(:focus):not(:placeholder-shown) ~ .input-label {
    color: #ffffff00;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

input[type="text"],
input[type="email"] {
    padding: 2vh 0px 8px 0px;
    background: #ffffff15;
    border: 1px solid #ffffff7c;
    border-radius: 20px;
    font-size: 1.5vh;
    color: #d8d8d8;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    color: #888;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border: 1px solid #a0000086;
    background: #0000004b;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    width: 100%;
    margin-top: 2vh;

    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /*font-family: "Alumni Sans Pinstripe", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;*/
    /*font-family: "Poiret One", sans-serif;*/
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
}

.submit-user-btn,
.remove-user-btn,
.add-user-btn {
    margin-top: 10px;

    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;

    height: 4vh;
    border-radius: 15px;

    text-decoration: none;
    font-family: 'Poppins', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;

    background: #00000091;
    border: 1px solid #ffffff62;
    color: #ffffff;

    /* stato iniziale */
    opacity: 1; /* Cambiato da 0 a 1 */
    transform: scale(1);

    /* transizione per l'hover e click */
    transition: background 0.35s ease,
                color 0.35s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;

    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.submit-user-btn {
    width: 20vh;
    font-size: 1.7vh;
}

.remove-user-btn,
.add-user-btn {
    width: 6vh;
    font-size: 1.7vh;
}

.submit-user-btn:hover,
.remove-user-btn:hover,
.add-user-btn:hover {
    background: #a0000086;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(160, 0, 0, 0.3);
}

/* Animazione al click - effetto "press" */
.submit-user-btn:active,
.remove-user-btn:active,
.add-user-btn:active {
    transform: scale(0.95);
    background: #c10000;
    box-shadow: 0 2px 8px rgba(160, 0, 0, 0.5);
}

.remove-user-btn:disabled,
.add-user-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animazione quando viene riabilitato */
.remove-user-btn:not(:disabled),
.add-user-btn:not(:disabled) {
    animation: buttonEnable 0.3s ease;
}

@keyframes buttonEnable {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.back-btn {
    position: fixed;
    top: 15px;                 /* distanza dall'alto */
    left: 50%;                 /* centro orizzontale */
    transform: translateX(-50%) scale(0.7); /* centra solo in orizzontale */

    padding: 0;
    width: 10vh;
    height: 10vh;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;

    filter:
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.301))
        drop-shadow(0 0 16px rgba(255, 255, 255, 0.342));

    transition: opacity 0.3s ease 0.5s, transform 0.3s ease;
    z-index: 10;
}

.back-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.back-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease 0.5s;
    transform: translateX(-50%) scale(1);
}

.back-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

.back-btn.visible:hover {
    transform: translateX(-50%) scale(1.3);
}

/* OVERLAY CARICAMENTO */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100; /* sopra tutto */
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* POPUP RISULTATO */
/* Overlay per bloccare interazioni durante popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 105; /* Sotto il popup (110) ma sopra tutto il resto */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Popup sopra l'overlay */
.popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 22px 26px;
    min-width: 260px;
    max-width: 90vw;
    text-align: center;
    color: #fff;
    font-family: 'Poppins', system-ui, sans-serif;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 110; /* Sopra l'overlay */
}

.popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.popup-text {
    margin-bottom: 16px;
    font-size: 1.4vh;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: pre-line;
}

.popup-btn {
    padding: 8px 26px;
    border-radius: 10px;
    border: 1px solid #810d0db4;
    background: #771414b4;
    color: #fff;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.3vh;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.popup-btn:hover {
    background: #c10000;
    transform: translateY(-1px);
}

.hidden {
    /* se già usi .hidden/visible altrove, tienila vuota o solo per JS */
}

@media (max-width: 600px) {
    .form-container {
        width: 75%;
        max-width: none;
        display: flex;
        align-items: center;
        flex-direction: column;
        max-height: 90%;
    }
    
    .form-container h1 {
        font-size: 22px;
    }
    
    .user-form {
        width: 90%;
        padding: 10px;
        border-radius: 20px;
        display: flex;
        align-items: center;
        flex-direction: column;
    }
    
    .button-group {
        gap: 0vh;
        width: 100%;
        margin-top: 2vh;
    }
    
    button[id="submit"] {
        padding: 12px;
        font-size: 16px;
        height: 4vh;
        width: 50%;
    }

    .submit-user-btn,
    .remove-user-btn,
    .add-user-btn {
        margin-top: 1vh;
        height: 4vh;
    }

    .submit-user-btn {
        width: 20vh;
        font-size: 1.5vh;
    }

    .remove-user-btn,
    .add-user-btn {
        width: 5vh;
        font-size: 1.5vh;
    }

    fieldset {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .input-group {
        position: relative;
        width: 100%;
    }

    .formText {
        animation: textIntro 0.7s ease-out 0.1s forwards;
    }
}

/* Rimuove l'effetto hover su dispositivi touch */
@media (hover: none) and (pointer: coarse) {
    .submit-user-btn:active,
    .remove-user-btn:active,
    .add-user-btn:active,
    .submit-user-btn:focus,
    .remove-user-btn:focus,
    .add-user-btn:focus {
        background: #00000091;
        color: #ffffff;
        transform: scale(1);
        outline: none;
    }

    /* Disabilita completamente hover su touch */
    .submit-user-btn:hover,
    .remove-user-btn:hover,
    .add-user-btn:hover {
        background: #00000091;
        color: #ffffff;
        transform: scale(1);
    }

    /* Aggiungi un feedback visivo rapido al tap invece dell'hover */
    .submit-user-btn:active,
    .remove-user-btn:active,
    .add-user-btn:active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
}

/* Anche per il bottone "Prenota" */
.btn-book {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

@media (hover: none) and (pointer: coarse) {
    .btn-book:hover,
    .btn-book:active,
    .btn-book:focus {
        background: #ffffff1e;
        color: #ffffff;
        transform: scale(1);
        outline: none;
    }

    .btn-book:active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
}

/* Fix per il bottone back */
.back-btn {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

@media (hover: none) and (pointer: coarse) {
    .back-btn.visible:hover {
        transform: translateX(-50%) scale(1);
    }

    .back-btn:active {
        opacity: 0.7;
    }
}


@keyframes bgBlur {
    0% {
        filter: blur(0px);
        -webkit-filter: blur(0px);
        transform: scale(1);
        -webkit-transform: scale(1);
    }
    100% {
        filter: blur(6px);
        -webkit-filter: blur(6px);
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
    }
}

/* Versione con prefisso webkit per Safari più vecchi */
@-webkit-keyframes bgBlur {
    0% {
        -webkit-filter: blur(0px);
        -webkit-transform: scale(1);
    }
    100% {
        -webkit-filter: blur(6px);
        -webkit-transform: scale(1.05);
    }
}

/* FIX PER TOUCH DEVICES */
@media (hover: none) and (pointer: coarse) {
    /* Rimuove hover su touch */
    .submit-user-btn:hover,
    .remove-user-btn:hover,
    .add-user-btn:hover {
        background: #00000091;
        color: #ffffff;
        transform: scale(1);
        box-shadow: none;
    }

    /* Mantiene l'animazione di press anche su touch */
    .submit-user-btn:active,
    .remove-user-btn:active,
    .add-user-btn:active {
        transform: scale(0.95);
        background: #c10000;
        box-shadow: 0 2px 8px rgba(160, 0, 0, 0.5);
        transition: all 0.1s ease;
    }

    /* Feedback immediato su touch */
    .submit-user-btn:focus,
    .remove-user-btn:focus,
    .add-user-btn:focus {
        outline: none;
    }
}

.spinner {
    width: 6vh;
    height: 6vh;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ff3b3b;
    animation: spin 0.8s linear infinite;
}

.input-error {
    border-color: #ff3b3b !important;
    background: rgba(255, 59, 59, 0.1) !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== SEZIONE INFO ===== */
.form-info {
    margin-bottom: 0;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
}

.form-info-title {
    font-family: 'Poppins', system-ui, sans-serif;
    color: #ffffff;
    font-size: 2.0vh;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 16px 0;
    text-align: center;
    
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9))
            drop-shadow(0 0 16px rgba(0, 0, 0, 0.9));
}

.form-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.form-info-item {
    font-family: 'Poppins', system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.4vh;
    font-weight: 400;
    line-height: 1.5;
    padding-left: 22px;
    position: relative;
    letter-spacing: 0.02em;
}

.form-info-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #a00000;
    font-size: 2vh;
    font-weight: bold;
    filter: drop-shadow(0 0 4px rgba(160, 0, 0, 0.6));
}

.form-info-highlight {
    color: #ffffff;
    font-weight: 600;
}

.form-info-price {
    color: #00ff7f;
    font-weight: 700;
    font-size: 1.7vh;
    filter: drop-shadow(0 0 4px rgba(0, 255, 127, 0.3));
}

.form-info-contact {
    text-align: center;
    padding-top: 14px;
    border-radius: 0px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-info-contact-text {
    font-family: 'Poppins', system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4vh;
    font-weight: 400;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-info-instagram {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', system-ui, sans-serif;
    color: #ffffff;
    font-size: 1.5vh;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.form-info-instagram:hover {
    background: rgba(160, 0, 0, 0.3);
    border-color: rgba(160, 0, 0, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(160, 0, 0, 0.3);
}

.form-info-instagram::before {
    content: "📸";
    font-size: 1.6vh;
}

/* Mobile per form-info */
@media (max-width: 600px) {
    .form-info {
        padding: 14px 16px;
    }
    
    .form-info-title {
        font-size: 17px;
        margin-bottom: 14px;
    }
    
    .form-info-item {
        font-size: 13px;
        padding-left: 20px;
    }
    
    .form-info-price {
        font-size: 14px;
    }
    
    .form-info-contact-text {
        font-size: 11px;
    }
    
    .form-info-instagram {
        font-size: 13px;
    }
}

/* ===== OVERLAY PER INFO POPUP (MOBILE) ===== */
.info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.info-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ===== MODIFICHE FORM-INFO-WRAPPER PER POPUP MODE (SOLO MOBILE) ===== */
@media (max-width: 768px) {
    .form-info-wrapper {
        transition: all 0.3s ease;
    }
    
    /* Quando è in modalità popup */
    .form-info-wrapper.popup-mode {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 101 !important;
        width: 85% !important;
        max-width: 400px !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        
        animation: popupSlideIn 0.3s ease-out;
    }
    
    @media (max-width: 768px) {
        .form-info-wrapper.popup-mode {
            top: calc(50% - env(safe-area-inset-bottom) / 2) !important;
        }
    }

    /* Animazione di apertura */
    @keyframes popupSlideIn {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    /* Animazione di chiusura */
    .form-info-wrapper.closing {
        animation: popupSlideOut 0.3s ease-in forwards !important;
    }
    
    @keyframes popupSlideOut {
        0% {
            opacity: 1;
            /*transform: translate(-50%, -50%) scale(1);*/
        }
        100% {
            opacity: 0;
            /*transform: translate(-50%, -50%) scale(0.9);*/
        }
    }
    
    /* Stile del contenuto in modalità popup */
    .form-info-wrapper.popup-mode .form-info {
        position: relative; /* CAMBIATO da fixed */
    
        z-index: 9;
        margin: 0;
        border-radius: 15px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.25);
        max-height: 75vh;
        overflow-y: auto;
        width: 100%;
    }
}

/* ===== BOTTONE OK (SOLO MOBILE) ===== */
.info-ok-btn {
    display: none; /* Nascosto di default */

    width: 30%;
    margin-top: 1.5vh;
    padding: 1.2vh 1.8vh;
    
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.8vh;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    
    background: #ffffff1e;
    border: 1px solid #ffffff62;
    color: #ffffff;
    border-radius: 20px;
    margin:auto;
    
    cursor: pointer;
    transition: all 0.3s ease;

    /* animazione di ingresso: SOLO opacity + margin-top */
    animation: buttonIntro 0.7s ease-out 3.5s forwards;
}

@media (max-width: 768px) {
    .info-ok-btn {
        display: block;
    }
    
    .info-ok-btn:hover,
    .info-ok-btn:active {
        background: #c10000;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(160, 0, 0, 0.5);
    }
    
    .info-ok-btn:active {
        transform: translateY(0);
    }
}

/* ===== FIX SCROLL PER POPUP ===== */
@media (max-width: 768px) {
    .form-info-wrapper.popup-mode .form-info {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Nasconde scrollbar ma mantiene funzionalità */
    .form-info-wrapper.popup-mode .form-info::-webkit-scrollbar {
        width: 4px;
    }
    
    .form-info-wrapper.popup-mode .form-info::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }
    
    .form-info-wrapper.popup-mode .form-info::-webkit-scrollbar-thumb {
        background: rgba(160, 0, 0, 0.5);
        border-radius: 10px;
    }
}

/* ===== ASSICURA CHE IL FORM SIA NASCOSTO DURANTE POPUP ===== */
@media (max-width: 768px) {
    .form-container.hidden {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

