/* =========================
   1. IMPORT FONTS (Luxury Pack)
========================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

/* =========================
   2. RESET & BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #fcfcfc;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    opacity: 1;
    transition: opacity 0.8s ease-in-out; /* Preparazione per la dissolvenza */
}

/* VELATURA 1: Classe per la dissolvenza in uscita */
body.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* =========================
   3. MAIN LAYOUT & CARD
========================= */
.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 60px; 
}

.card {
    background-color: #fff;
    display: flex;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* =========================
   4. SEZIONI INTERNE
========================= */
.image-section {
    flex: 1;
    position: relative;
    background-color: #fff;
    min-height: 450px;
}

.image-section img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    display: block;
}

.form-section {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tipografia Form */
.titolo-ritiro-negozio-conferma {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 50px;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group { margin-bottom: 30px; }

.form-group input {
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    background-color: transparent;
    transition: all 0.3s ease;
    border-radius: 0;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-bottom-color: #111;
}

/* Rimozione autofill di Chrome */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover, 
.form-group input:-webkit-autofill:focus, 
.form-group input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Input Prodotto Speciale */
.form-group input[name="Prodotto"], 
.form-group input[disabled] {
    font-family: 'Playfair Display', serif !important;
    font-style: italic;
    font-size: 1.3rem !important;
    color: #555 !important;
    border-bottom: none !important;
    background: transparent !important;
    padding-left: 0 !important;
    margin-bottom: 10px;
    opacity: 1; /* Fix per iOS */
    -webkit-text-fill-color: #555;
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

.form-note {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0px;
    margin-bottom: 8px;
    font-weight: 300;
    line-height: 1.4;
}

.form-group + .form-note {
    margin-top: 30px;
}

/* Bottone Principale Form (Invia) */
.submit-btn {
    background-color: #111;
    color: #fff;
    border: 1px solid #111;
    padding: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
    width: 100%;
    margin-top: 20px;
}
.submit-btn:hover {
    background-color: #fff;
    color: #111;
}

/* =========================
   MESSAGGI DI ERRORE
========================= */
.messaggio-errore {
    font-size: 0.75rem;
    color: #053bed;
    margin-top: 8px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    height: 0;
    overflow: hidden;
}
.messaggio-errore.show {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-bottom: 10px;
}
.form-group input.input-error {
    border-bottom-color: #a83232 !important;
    color: #a83232 !important;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.input-shake { animation: shake 0.3s ease-in-out; }

/* =========================
   CHECKBOX PRIVACY
========================= */
.privacy-check-wrapper {
    margin-bottom: 30px;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap; /* Permette all'errore di andare a capo */
}

.container-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.75rem;
    user-select: none;
    color: #888;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    line-height: 1.4;
}

.container-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }

.checkmark-box {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    height: 16px; width: 16px;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.container-checkbox:hover input ~ .checkmark-box { border-color: #999; }
.container-checkbox input:checked ~ .checkmark-box { background-color: #111; border-color: #111; }

.checkmark-box:after {
    content: ""; position: absolute; display: none;
    left: 5px; top: 2px; width: 4px; height: 8px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.container-checkbox input:checked ~ .checkmark-box:after { display: block; }

.privacy-text a {
    color: inherit; text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0,0,0,0.3);
    transition: all 0.3s;
}
.privacy-text a:hover { color: #111; text-decoration-color: #111; }

/* =========================
   MODALE DI SUCCESSO
========================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-box {
    background: #fff;
    width: 90%; max-width: 500px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15); 
    border: 1px solid #eee;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.show .modal-box { transform: translateY(0); }

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; color: #111;
    margin-bottom: 15px; font-weight: 400;
}

.modal-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem; color: #555;
    line-height: 1.6; margin-bottom: 30px;
}

/* Box Spam */
.spam-warning {
    background-color: #fdfbf7;
    border-left: 3px solid #D4A017;
    padding: 20px;
    text-align: left;
    display: flex; gap: 15px;
    align-items: flex-start;
    margin-bottom: 30px;
}
.spam-icon { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: #D4A017; font-weight: bold; line-height: 1; }
.spam-text strong { display: block; font-family: 'Montserrat', sans-serif; font-size: 0.85rem; text-transform: uppercase; margin-bottom: 5px; color: #111; }
.spam-text p { font-family: 'Montserrat', sans-serif; font-size: 0.85rem; color: #666; margin: 0; line-height: 1.4; }

/* VELATURA 2: BOTTONI MODALE */
.modal-buttons-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.btn-modal-primary, .btn-modal-secondary {
    flex: 1;
    padding: 15px 10px;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 2px;
    text-align: center;
}

/* Bottone Home (Nero) */
.btn-modal-primary {
    background-color: #111;
    color: #fff !important;
    border: 1px solid #111;
}
.btn-modal-primary:hover {
    background-color: #333;
    border-color: #333;
}

/* Bottone Scopri (Bianco) */
.btn-modal-secondary {
    background-color: transparent;
    color: #111 !important;
    border: 1px solid #ddd;
}
.btn-modal-secondary:hover {
    border-color: #D4A017;
    color: #D4A017 !important;
}

/* Animazione Checkmark */
.checkmark-wrapper { display: flex; justify-content: center; margin-bottom: 25px; }
.checkmark { width: 80px; height: 80px; border-radius: 50%; display: block; stroke-width: 2; stroke: #D4A017; stroke-miterlimit: 10; box-shadow: inset 0px 0px 0px #D4A017; }
.checkmark__circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; stroke: #D4A017; fill: none; }
.checkmark__check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; stroke: #D4A017; stroke-width: 3; fill: none; }

.modal-overlay.show .checkmark { animation: scale 0.3s ease-in-out 0.9s both; }
.modal-overlay.show .checkmark__circle { animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards; }
.modal-overlay.show .checkmark__check { animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards; }

@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .main-container { padding-top: 100px; padding-bottom: 40px; }
    .card { flex-direction: column; box-shadow: none; border: none; background: transparent; }
    .image-section { flex: none; height: 300px; width: 100%; margin-bottom: 20px; }
    .form-section { padding: 20px; background: white; border-radius: 8px; }
    
    .modal-buttons-wrapper {
        flex-direction: column-reverse; /* Home sotto, Scopri sopra */
    }
}