/* =========================================
   LEADGEN V3 - FINAL PRODUCTION CSS
   Refined Glow: Uniform, Repeating Conic, No Gaps
   ========================================= */

/* --- 1. HOUDINI PROPERTIES --- */

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Variabili Colore (Opzionali se usi hardcoded nel gradiente, ma utili per temi) */
:root {
    --color-primary: #ff4f00;
    --color-secondary: #ff003c;
    --color-tertiary: #9f28ca;
    --color-blue-dark: #09309a;

    --color-bg-main: #01102A;
    --color-bg-dark: #01102A;
    --color-bg-overlay: #01102A;
    --color-bg-input: #364572;
    --color-border-input: #364572;
    --color-bg-backdrop: rgba(18, 28, 52, 0.3);

    --color-text-white: #ffffff;
    --color-text-slate-300: #D5DBEB;
    --color-text-slate-400: #B3BDDB;
    --color-text-slate-500: #7184BC;
    --color-text-slate-600: #4E64A6;
    --color-text-subtitle: #B3BDDB;
    --color-gray-500: #4E64A6;

    --color-error: #ef4444;
    --color-success: #4ade80;

    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    /* Shadows & Opacities */
    --shadow-black-20: rgba(0, 0, 0, 0.2);
    --shadow-black-50: rgba(0, 0, 0, 0.5);
    --shadow-dark-50: rgba(10, 13, 34, 0.5);

    --color-primary-10: rgba(255, 79, 0, 0.1);
    --color-primary-20: rgba(255, 79, 0, 0.2);
    --color-primary-25: rgba(255, 79, 0, 0.25);
    --color-primary-40: rgba(255, 79, 0, 0.4);

    --color-secondary-60: rgba(255, 0, 60, 0.6);

    --color-white-02: rgba(255, 255, 255, 0.02);
    --color-white-05: rgba(255, 255, 255, 0.05);
    --color-white-08: rgba(255, 255, 255, 0.08);
    --color-white-10: rgba(255, 255, 255, 0.1);

    --color-success-bg: rgba(8, 255, 0, 0.17);
    --color-success-gradient-start: rgba(74, 222, 128, 0.459);

    --gradient-liquid: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-tertiary), var(--color-primary));
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- 2. ANIMATIONS --- */

@keyframes rotate-angle {
    to {
        --angle: 360deg;
    }
}

@keyframes gradient-move {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes sparkle-spin-pause {
    0% {
        transform: rotate(0deg);
    }

    30% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ai-reverse-spin {
    to {
        transform: rotate(-360deg);
    }
}

/* --- 3. BODY & LAYOUT --- */

body {
    background-color: var(--color-bg-main);
    /* Sfondo Clean */
    background-image: radial-gradient(circle at 50% 0%,
            rgba(255, 79, 0, 0.25) 0%,
            transparent 60%);
    background-repeat: no-repeat;
    color: var(--color-text-white);
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;

    min-height: 100vh;
    margin: 0;
    /* CENTRATURA FIX */

    overflow-x: hidden;
}

.lga-v3-wrapper {
    position: relative;
    width: 100%;
    padding: 2rem 1rem;
}

.lga-step {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60vh;
}

.lga-step.active {
    display: flex;
}

/* --- 4. HERO SECTION --- */

.lga-hero-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.lga-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffc8ae21;
    border: 1px solid #ffc8ae17;
    border-radius: 100px;
    color: #dd6b3e;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(30px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.lga-hero-pill i {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

.lga-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lga-gradient-text {
    background: var(--gradient-liquid);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-move 6s ease infinite;
}

.lga-hero-subtitle {
    font-size: 1.125rem;
    color: #B3BDDB;
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 5. INPUT FX (REPEATING CONIC - UNIFORM GLOW) --- */

.lga-hero-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 3rem;
    z-index: 10;
    background: transparent;
}

/* LAYER 1: Bordo Netto (Sotto) */
.lga-hero-input-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    /* Spessore bordo */
    border-radius: 14px;

    /* USO DEL REPEATING CONIC (Corretto per loop fluido) */
    /* La sequenza ora inizia e finisce con lo stesso colore (Arancione) */
    background: repeating-conic-gradient(from var(--angle), #e82681 0%, #ff003c 25%, #ffaa07 50%, #ff5400 75%, #f71192 100%);

    z-index: 1;
    /* Animazione lenta e fluida */
    animation: rotate-angle 4s linear infinite;
}

/* LAYER 2: Glow Uniforme (Sotto Sotto) */
.lga-hero-input-wrapper::after {
    content: "";
    position: absolute;
    inset: -4px;
    /* Leggermente più largo */
    border-radius: 20px;

    /* Stesso gradiente fluido del bordo */
    background: repeating-conic-gradient(from var(--angle),
            #ff4f00 0%,
            #ff003c 25%,
            #9f28ca 50%,
            #ff003c 75%,
            #ff4f00 100%);

    z-index: 0;

    /* Qui gestiamo l'intensità della luce, non nel gradiente */
    opacity: 0.5;
    filter: blur(20px);

    transition: all 0.3s ease;
    animation: rotate-angle 4s linear infinite;
}

/* FOCUS STATE: Più Luminoso e Intenso */
.lga-hero-input-wrapper:focus-within::after {
    opacity: 0.8;
    /* Aumenta luminosità */
    filter: blur(30px);
    /* Aumenta raggio glow */
    inset: -6px;
    /* Si espande leggermente */
    animation-duration: 2s;
    /* Accelera */
}

.lga-hero-input-wrapper:focus-within::before {
    animation-duration: 2s;
}

/* LAYER 3: Contenitore Input */
.lga-input-container {
    position: relative;
    background: var(--color-bg-dark);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    z-index: 2;
    width: 100%;
}

.lga-input-section {
    flex: 1;
    display: flex;
    align-items: center;
}

.lga-input-icon {
    margin-left: 16px;
    margin-right: 12px;
    color: var(--color-text-slate-500);
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

.lga-hero-input {
    font-family: 'Courier New', monospace;
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 16px 16px 16px 0;
    font-size: 18px;
    color: var(--color-text-white);
    outline: none;
    font-family: inherit;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-x: auto;
    white-space: nowrap;
}

.lga-hero-input::placeholder {
    color: var(--color-text-slate-500);
}

.lga-hero-input:focus~.lga-input-icon,
.lga-input-container:focus-within .lga-input-icon {
    color: var(--color-primary);
}

/* --- 6. BUTTON & SPARKLE --- */

.lga-hero-btn {
    background: var(--gradient-liquid);
    background-size: 300% 100%;
    color: var(--color-text-white);
    border: none;
    padding: 14px 24px;
    border-radius: 8px !important;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 0 15px rgba(255, 79, 0, 0.4);
    animation: gradient-move 4s ease infinite;
}

.lga-hero-btn:hover:not(:disabled) {
    box-shadow: 0 0 30px rgba(255, 0, 60, 0.6);
    transform: translateY(-1px);
}

.lga-hero-btn:disabled {
    background: #162138;
    color: #7184BC;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
    animation: none;
}

.lga-hero-btn:not(:disabled) svg,
.lga-hero-btn:not(:disabled) .lucide-sparkles {
    animation: sparkle-spin-pause 3s ease-in-out infinite;
}

/* --- 7. TUTORIAL & FEATURES --- */

.lga-tutorial-video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 284px;
}

.lga-tutorial-wrapper {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.lga-tutorial-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px !important;
    color: #94a3b8 !important;
    font-size: 1rem;
    font-weight: 400;
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.lga-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--color-primary);
}

.lga-tutorial-content {
    display: none;
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--color-bg-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: left;
}

.lga-tutorial-content.open {
    display: block;
}

.lga-tutorial-steps {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.lga-tutorial-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #fff !important;
    font-size: 1rem;
}

.lga-tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.lga-step-num {
    background: rgba(255, 79, 0, 0.15);
    color: var(--color-primary);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.lga-hero-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.lga-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.lga-feature i,
.lga-feature svg {
    color: var(--color-primary);
    width: 18px;
    height: 18px;
}

/* --- 8. AI REACTOR (Processing) --- */
.lga-form-fieldset {
    border-radius: 12px;
    text-align: left;
}

.lga-form-legend {
    color: #fff;
    font-weight: 600;
    padding: 0 0.5rem;
}

.lga-form-label {
    display: block;
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.lga-required-indicator {
    color: #ff4f00;
}

.lga-optional-indicator {
    color: #64748b;
    font-size: 0.75rem;
}

.lga-consent-item {
    display: flex;
    align-items: start;
    gap: 10px;
    margin-bottom: 1rem;
}

#marketingConsent {
    margin-bottom: 0px;
}

.lga-consent-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
    color-scheme: dark;
}

.lga-consent-label {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.4;
    cursor: pointer;
}

.lga-consent-link {
    background: none;
    border: none;
    color: #ff4f00;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.lga-error-message {
    display: none;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.lga-gate-modal {
    top: -74px;
}

.lga-form-group {
    margin-bottom: 1rem;
}

.lga-processing-container,
.lga-gate-modal,
.lga-thankyou-container {
    position: relative;
    z-index: 999;
    background: var(--color-bg-main);

    max-width: 500px;
    width: 100%;

    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem 2rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(10, 13, 34, 0.5);
    position: relative;
    margin: 0 auto;

}


.lga-processing-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: var(--gradient-liquid);
    background-size: 200% 200%;
    filter: blur(40px);
    opacity: 0.15;
    z-index: -1;
    animation: gradient-move 5s ease infinite;
}

/* Reactor Circle */
/* --- AI REACTOR COUNTER (Cerchio di Caricamento) --- */

/* 1. Contenitore del Cerchio */
.lga-processing-circle {
    position: relative;
    margin: 0 auto 2.5rem;
    /* Spaziatura sotto il cerchio */
    width: 180px;
    /* Dimensione totale */
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. Animazione Radar Esterno (Sfondo che gira) */
.ai-ring-radar {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    /* Gradiente conico che simula la scansione */
    background: conic-gradient(from 0deg, transparent 0%, transparent 60%, var(--color-primary) 80%, transparent 100%);
    /* Maschera per creare l'anello vuoto al centro */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    /* Fondamentale per Chrome/Safari */
    opacity: 0.5;
    animation: ai-spin 2s linear infinite;
}

/* 3. Anello Decorativo Interno (Tratteggiato) */
.ai-ring-inner {
    position: absolute;
    inset: 15px;
    /* Più piccolo del radar */
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(255, 79, 0, 0.1);
    /* Glow leggero */
    animation: ai-reverse-spin 10s linear infinite;
}

/* 4. Barra di Progresso SVG */
.lga-progress-ring {
    transform: rotate(-90deg);
    /* Ruota per partire dall'alto */
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 8px var(--color-primary));
    /* Effetto Neon */
}

.lga-progress-ring-bg {
    stroke: rgba(255, 255, 255, 0.05);
    /* Colore traccia vuota */
    stroke-width: 6;
    fill: none;
}

.lga-progress-ring-fill {
    stroke: url(#gradient-ai);
    /* Usa il gradiente definito nell'HTML */
    stroke-width: 6;
    stroke-linecap: round;
    fill: none;
    /* Circonferenza standard per raggio 70 (2 * pi * 70 ≈ 439.8) */
    stroke-dasharray: 439.8;
    stroke-dashoffset: 439.8;
    /* Parte vuoto */
    transition: stroke-dashoffset 0.5s ease-out;
    /* Animazione riempimento fluida */
}

/* 5. Testo Centrale (Numero e Label) */
.lga-progress-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.lga-progress-text .number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    /* Gradiente metallico sul testo */
    background: linear-gradient(180deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.lga-progress-text .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-primary);
    margin-top: 5px;
    font-weight: 600;
}

/* --- KEYFRAMES ANIMAZIONI --- */

@keyframes ai-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ai-reverse-spin {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Common Elements */
.lga-processing-title,
.lga-gate-title,
.lga-thankyou-title {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.lga-gate-subtitle,
.lga-thankyou-text {
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.lga-processing-checklist {

    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
    gap: 8px;
    display: flex;
    align-content: safe;
    flex-direction: column;
}

.lga-check-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 12px;
    padding: 0.75rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
}

.lga-check-item:last-child {
    border-bottom: none;
}

.lga-check-item.completed {
    color: #fff;
    background: linear-gradient(90deg, rgba(58, 223, 129, 0.562), transparent);
    border-radius: 8px;
}

.lga-check-item svg {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.lga-check-item.completed svg {
    color: var(--color-success);
    filter: drop-shadow(0 0 5px var(--color-success));
    animation: none;
}

.lga-processing-note {
    color: #6b7280;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}



/* Forms */
.lga-gate-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 52, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lga-report-preview {
    position: absolute;
    z-index: -1;
    opacity: 0.3;
    width: 90%;
    max-width: 500px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 2rem;
    filter: blur(8px);
}


.lga-gate-note {
    font-size: 14px;
    color: var(--color-text-slate-500);
}

#gateStep {
    justify-content: flex-start !important;
}

.lga-form-fieldset-consent {
    margin-bottom: 1rem;
}

.lga-gate-icon,
.lga-thankyou-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(8, 255, 0, 0.17);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lga-gate-icon i,
.lga-thankyou-icon i {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.lga-gate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lga-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.lga-gate-input,
.lga-gate-select {
    padding: 1rem;
    background: #162138;
    border: 1px solid #364572;
    color: #fff;
    border-radius: 10px;
    font-size: 1rem;
    width: 100%;
    transition: 0.2s;
}

.lga-gate-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(255, 79, 0, 0.2);
}

.lga-gate-btn,
.lga-thankyou-btn {
    padding: 15px;
    background: var(--gradient-liquid);
    background-size: 300% 100%;
    animation: gradient-move 6s ease infinite;
    color: #fff;
    border: none;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s;
    width: 100%;
}

.lga-gate-btn:hover,
.lga-thankyou-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 79, 0, 0.3);
}

.lga-thankyou-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 79, 0, 0.1);
    border: 1px solid rgba(255, 79, 0, 0.2);
    border-radius: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
}

/* --- 10. RESPONSIVE --- */
@media (max-width: 768px) {
    .lga-input-container {
        flex-direction: column;
        padding: 12px;
    }

    .lga-input-section {
        width: 100%;
        margin-bottom: 10px;
    }

    .lga-hero-btn {
        width: 100%;
        justify-content: center;
    }

    .lga-input-icon {
        display: none;
    }

    .lga-hero-input {
        padding-left: 8px;
        text-align: center;
    }

    .lga-form-row {
        grid-template-columns: 1fr;
    }
}