/* --- RESET & VARIABLES --- */
:root {
    --bg-main: #020617;
    /* Slate 950 */
    --bg-surface: #0f172a;
    /* Slate 900 */
    --bg-surface-2: #1e293b;
    /* Slate 800 */

    --brand-red: #DC2626;
    --brand-red-glow: rgba(220, 38, 38, 0.4);
    --brand-accent: #3b82f6;
    /* Blue for trust */

    --text-primary: #f8fafc;
    --text-secondary: #ffffff;

    --gradient-main: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-glow: conic-gradient(from 180deg at 50% 50%, #DC2626 0deg, #3b82f6 180deg, #DC2626 360deg);
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.02em;
    color: #fff;
}

a {
    text-decoration: none;
}

/* --- SECTION SPACING --- */
.section-spacing {
    padding: 100px 0;
}

@media (max-width: 768px) {
    .section-spacing {
        padding: 60px 0;
    }
}

/* --- UTILITIES --- */
.text-gradient {
    background: linear-gradient(to right, #fff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-brand {
    color: var(--brand-red) !important;
}

.text-brand-accent {
    color: var(--brand-accent) !important;
}

.bg-brand-red {
    background-color: var(--brand-red) !important;
}

.bg-brand-accent {
    background-color: var(--brand-accent) !important;
}

.bg-surface {
    background-color: var(--bg-surface) !important;
}

.bg-surface-2 {
    background-color: var(--bg-surface-2) !important;
}

/* --- NAVBAR --- */
.navbar {
    background: rgba(2, 6, 23, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 0;
}

/* --- HERO SECTION --- */
.hero-wrapper {
    position: relative;
    padding-top: 80px;
    padding-bottom: 100px;
    overflow: hidden;
}

/* Abstract Background Shapes */
.hero-bg-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--brand-red-glow) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.text-secondary {
    --bs-text-opacity: 1;
    color: #fff !important;
}

.hero-bg-glow-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
}

/* Hero Image Container */
.hero-img-container {
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

/* The actual image styling - sleek & modern */
.hero-image-styled {
    width: 100%;
    border-radius: 24px;
    /* subtle 3D effect */
    box-shadow:
        0 20px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    /* stroke border */
    transform: perspective(1000px) rotateY(-2deg);
    transition: all 0.5s ease;
}

.hero-img-container:hover .hero-image-styled {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
    box-shadow:
        0 30px 60px -12px rgba(220, 38, 38, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Highlight Box Emphasis */
.highlight-info-box {
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.15);
    background: rgba(59, 130, 246, 0.03) !important;
}

/* Hero Offer Box */
.hero-offer-box {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hero-offer-box:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Decorative backdrop for image */
.hero-img-backdrop {
    position: absolute;
    inset: -20px;
    background: linear-gradient(45deg, var(--bg-surface-2), transparent);
    z-index: -1;
    border-radius: 30px;
    transform: rotate(3deg);
    opacity: 0.5;
}

/* --- CARDS & GRID --- */
.feature-card-modern {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.feature-card-modern:hover {
    background: var(--bg-surface-2);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.icon-square {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-red);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* --- PRICING SECTION --- */
.offer-section-modern {
    background: linear-gradient(to bottom, var(--bg-main), #040a1c);
    position: relative;
}

.pricing-card-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.price-display {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- CTA BUTTONS --- */
.btn-primary-modern {
    background: var(--brand-red);
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.4);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-modern:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(220, 38, 38, 0.5);
    color: white;
}

/* --- COUNTDOWN --- */
.countdown-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.time-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: block;
}

.time-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* --- FORM & INPUTS --- */
.red-form-card {
    background: linear-gradient(145deg, var(--bg-surface-2), var(--bg-surface));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--brand-red);
    /* Subtle red accent at top */
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.form-control,
.form-select {
    background-color: var(--bg-surface-2);
    /* Usa un colore solido invece di trasparente */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Fix specifico per le opzioni del select per evitare il bianco su bianco */
.form-select option {
    background-color: var(--bg-surface-2);
    color: white;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-surface-2);
    border-color: var(--brand-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
    color: white !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Remove Bootstrap floating-label background patch */
.form-floating>label,
.form-floating>label::after {
    background-color: transparent !important;
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-main);
}

text-muted {
    color: var(--text-secondary) !important;
}

/* Floating WhatsApp */
.whatsapp-float {
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* Floating shortcut to "Richiedi Contatto" (left side, WhatsApp-like) */
.contact-float {
    position: fixed;
    left: 24px;
    bottom: 30px;
    z-index: 110;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 12px;
    border-radius: 999px;
    background: var(--brand-red);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-float__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.12);
    font-size: 22px;
    flex-shrink: 0;
}

.contact-float__text {
    white-space: nowrap;
}

.contact-float:hover {
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55);
}

@media (hover: hover) and (pointer: fine) {
    .contact-float {
        gap: 0;
        padding-right: 12px;
    }

    .contact-float__text {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-width 0.25s ease, opacity 0.2s ease;
    }

    .contact-float:hover .contact-float__text,
    .contact-float:focus-visible .contact-float__text {
        max-width: 220px;
        opacity: 1;
    }

    .contact-float:hover,
    .contact-float:focus-visible {
        gap: 10px;
        padding-right: 16px;
    }
}

.contact-float:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.65);
    outline-offset: 4px;
}

@media (max-width: 576px) {
    .contact-float {
        padding: 10px;
    }

    .contact-float__text {
        display: none;
    }

    .contact-float__icon {
        width: 48px;
        height: 48px;
    }
}

/* --- CUSTOM WHATSAPP BUTTON --- */
.btn-whatsapp-green {
    background: #25d366;
    color: white !important;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 12px;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    animation: pulse-green 2s infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- FORCE WHITE TEXT FOR PARAGRAPHS --- */
p {
    color: #ffffff !important;
    opacity: 0.95;
}

.btn-whatsapp-green:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 211, 102, 0.5);
}

@keyframes pulse-green {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }

}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 90px;
    }
    section#come-funziona {
        padding-top: 0 !important;
    }

    div#chat-wap .d-flex.align-items-center.gap-3.position-relative {
        display: block !important;
    }

    div#chat-wap .bg-success {
        display: none !important;
    }

    div#chat-wap a.btn.btn-success.btn-lg.rounded-pill.fw-bold.ms-auto.px-4.shadow-sm.border-white.border-opacity-25 {
        margin-top: 20px;
    }

    div#chat-wap {
        text-align: center;
    }

    /* Mobile specific Hero WhatsApp prominence */
    #btn-whatsapp-hero {
        width: 100%;
        padding: 16px;
        font-size: 1.1rem;
        justify-content: center;
        margin-top: 10px;
        order: -1; /* Move it above the trust badges on mobile if container is flex-column */
    }
    
    .hero-wrapper .d-flex.flex-wrap.gap-4.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
    }
    
    .hero-wrapper .d-flex.flex-wrap.gap-3 {
        justify-content: center;
    }
}