/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --primary-color: #6a11cb;
    --text-color: #333;
    --light-color: #f9f9f9;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

/* Global Centering */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.centered {
    text-align: center;
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   HEADER - STILE COERENTE CON IL TUO BRAND
   ============================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #6a11cb;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    transition: all 0.3s ease;
    color: white;
}

header.scrolled {
    padding: 10px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

#titoloval {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#titoloval strong {
    color: #ffffff;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    padding: 5px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.hamburger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

nav ul li a {
    color: white;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    padding: 5px 0;
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

/* =============================================
   MOBILE MENU - HAMBURGER (CORRETTO E FUNZIONANTE)
   ============================================= */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 92px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: #6a11cb;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.4s ease;
        gap: 15px;
        z-index: 1001;
        text-align: center;
    }

    /* FIX: Cambiato da nav ul.active a nav.active ul */
    nav.active ul {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav ul li {
        margin: 0;
        width: 100%;
    }

    nav ul li a {
        font-size: 1.3rem;
        padding: 16px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
    }

    nav ul li a:last-child {
        border-bottom: none;
    }

    nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: none;
    }
}

/* =============================================
   ANIMAZIONE PER IL HEADER SCROLL
   ============================================= */
@media (min-width: 769px) {
    header.scrolled #titoloval {
        font-size: 1.2rem;
    }
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.4rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Sezioni Standardizzate */
section {
    margin: 4rem 0;
    animation: fadeIn 0.8s ease forwards;
    position: relative;
    text-align: center;
}

h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    position: relative;
    padding: 0 1rem;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    margin: 0.5rem auto;
    border-radius: 2px;
}

/* Testo centrato e allineato come nel servizi */
section p {
    max-width: 800px;
    margin: 1.5rem auto;
    line-height: 1.7;
    color: #555;
    text-align: left;
    font-family: sans-serif;
}

.frasedescrpt {
    margin: 1.5rem auto;
    text-align: justify;
}

/* Services Section */
.services {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.service {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 320px;
    text-align: center;
    transform: translateY(0);
    position: relative;
    overflow: hidden;
}

.service::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.service:hover::before {
    transform: scaleX(1);
}

.service i {
    font-size: 4.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
}

.service:hover i {
    transform: scale(1.1);
}

.service h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.service p {
    color: #666;
    line-height: 1.7;
    font-family: sans-serif;
}

/* Price Section */
.price-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin: 1.5rem 0;
}

/* icona whatsapp */
#div3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-container {
    width: 150px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5em 10px;
    border-radius: 0.5em;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
}

#Whatsapp {
    background-color: #25d366;
}

.icon-container {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.icon-container svg {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.icon-container p {
    font-size: 0.9em;
    font-weight: 400;
    color: white;
    margin: 0;
}

.card-container p {
    font-weight: 900;
    color: #ffffff;
    font-family: 'Cocogoose', sans-serif;
    margin: 0;
}

.card-container:hover {
    transform: scale(1.3);
    z-index: 2;
}

#cards:hover > .card-container:not(:hover),
#cards:has(.card-container:hover) .card-container:not(:hover) {
    filter: blur(2px);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

#div4 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#fotocertific {
    width: 40%;
    border: 3px solid black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.47);
}

#fotocertific:hover {
    width: 60%;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

#visualizzafoto {
    cursor: pointer;
}

/* Stepline Lists */
ul#steplinea,
ul#steplinea2,
ul#steplinea3 {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 2rem auto;
    text-align: left;
    position: relative;
}

ul#steplinea li,
ul#steplinea2 li,
ul#steplinea3 li {
    margin-bottom: 1.5rem;
    padding-left: 2.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

ul#steplinea li:hover,
ul#steplinea2 li:hover,
ul#steplinea3 li:hover {
    transform: translateX(5px);
}

ul#steplinea li::before,
ul#steplinea2 li::before,
ul#steplinea3 li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(106, 17, 203, 0.2);
}

ul#steplinea li::after,
ul#steplinea2 li::after,
ul#steplinea3 li::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 1.9rem;
    width: 2px;
    height: calc(100% - 1.9rem);
    background: #e0e0e000;
}

ul#steplinea li:last-child::after,
ul#steplinea2 li:last-child::after,
ul#steplinea3 li:last-child::after {
    display: none;
}

/* Button */
#centrale {
    text-align: center;
    margin: 4rem 0;
}

#centrale button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.3);
    font-weight: 600;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

#centrale button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(106, 17, 203, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 95%;
    max-width: 850px;
    position: relative;
    overflow: auto;
    animation: modalFadeIn 0.5s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    color: #ff3232;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
    font-weight: bold;
}

.close:hover {
    color: var(--primary-color);
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin-bottom: 1.5rem;
}

iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: none;
}

.modal-content iframe {
    display: block;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #fff;
    padding: 4rem 1rem;
    margin-top: 4rem;
}

.footer-section {
    margin-bottom: 2.5rem;
    text-align: center;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    position: relative;
    display: inline-block;
    padding: 0 1rem;
}

.footer-section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    margin: 0.5rem auto;
    border-radius: 2px;
}

/* SOCIAL ICONS — VERSIONE OTTIMIZZATA PER CONTRASTO */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.social-icon {
    display: flex;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: white;
    color: #6a11cb;
    transition: var(--transition);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.social-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
}

.social-icon i {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.social-icon:hover i {
    transform: scale(1.15);
}

/* Footer Links */
#diritti {
    text-align: center;
    margin-top: 2.5rem;
    color: #aaa;
    font-size: 0.9rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#spazio2 {
    text-align: center;
    margin-top: 1rem;
}

#spazio2 a {
    color: #aaa;
    margin: 0 0.8rem;
    transition: color 0.3s;
    font-size: 0.95rem;
}

#spazio2 a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 { font-size: 2.5rem; }
    header p { font-size: 1.1rem; }
    .service { width: 100%; max-width: 450px; padding: 2rem; }
    .service i { font-size: 3.5rem; }
    .price-section { padding: 2rem; }
    .price { font-size: 2rem; }
    .modal-content {
        max-height: 95vh;
        height: 95vh;
    }
    iframe {
        height: 100%;
    }
    .social-icon { width: 45px; height: 45px; }
    .social-icon svg { width: 22px; height: 22px; }
    h2 { font-size: 1.8rem; }
    ul#steplinea,
    ul#steplinea2,
    ul#steplinea3 {
        padding-left: 0;
    }
    ul#steplinea li,
    ul#steplinea2 li,
    ul#steplinea3 li {
        padding-left: 2.5rem;
        margin-bottom: 1.2rem;
    }
    ul#steplinea li::before,
    ul#steplinea2 li::before,
    ul#steplinea3 li::before {
        left: 0;
        top: 0.4rem;
    }
    ul#steplinea li::after,
    ul#steplinea2 li::after,
    ul#steplinea3 li::after {
        left: 5px;
        top: 1.5rem;
    }
    section {
        padding: 20px;
    }
    #spazio2 {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    #fotocertific {
        width: 90%;
        border: 3px solid black;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.47);
    }
    #fotocertific:hover {
        width: 90%;
    }
    #fraseviaemail {
        text-align: center;
        font-size: larger;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 1rem;
    }
    header h1 { font-size: 2rem; }
    #centrale button {
        padding: 2rem 1.5rem;
        font-size: 1rem;
        margin: 22px;
    }
    .loader { padding: 1rem; }
    .spinner { width: 45px; height: 45px; }
    .footer-section h3 { font-size: 1.4rem; }
    .social-icon { width: 40px; height: 40px; }
    .social-icon svg { width: 20px; height: 20px; }
}

/* Profilo immagine */
#chi-sono #fotoprof {
    float: right;
    width: 150px;
    height: auto;
    margin: 10px 0 10px 20px;
    border-radius: 10%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
    #chi-sono #fotoprof {
        float: none;
        display: block;
        margin: 20px auto;
    }
}