/* --- OPTLYX VISION THEME --- */
:root {
    --primary: #4f46e5; 
    --primary-glow: rgba(79, 70, 229, 0.4);
    --accent: #f97316;
    --text-main: #0f172a; 
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --glass-surface: rgba(255, 255, 255, 0.7);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter Tight', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg-page); color: var(--text-main); overflow-x: hidden; }

/* SFONDO E NAVBAR (Standard) */
.accountant-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: #f8fafc; }
.grid-pattern { position: absolute; width: 100%; height: 100%; background-image: linear-gradient(rgba(79, 70, 229, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 70, 229, 0.04) 1px, transparent 1px); background-size: 50px 50px; mask-image: radial-gradient(circle at center, black 40%, transparent 90%); }
.floating-symbol { position: absolute; font-family: var(--font-display); font-weight: 700; color: var(--primary); opacity: 0.06; animation: floatSymbol 25s infinite linear; }
.s1 { top: 15%; left: 10%; font-size: 6rem; } .s2 { top: 60%; right: 10%; font-size: 8rem; color: var(--accent); } .s3 { bottom: 15%; left: 20%; font-size: 4rem; }
@keyframes floatSymbol { 0% { transform: translateY(0); } 50% { transform: translateY(-30px); } 100% { transform: translateY(0); } }

/* NAVBAR */
.glass-navbar { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); width: 95%; max-width: 1100px; height: 72px; z-index: 1000; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 100px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; }
.nav-logo-img { height: 38px; cursor: pointer; }
.nav-links-center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 2rem; }
.nav-item { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-item.active { color: var(--text-main); }
.btn-book-call { text-decoration: none; background: var(--text-main); color: white; padding: 10px 22px; border-radius: 100px; font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; transition: 0.3s; }
.btn-book-call:hover { background: var(--primary); transform: translateY(-2px); }

/* --- HERO --- */
.vision-container { padding-top: 140px; max-width: 1200px; margin: 0 auto; padding-bottom: 4rem; width: 92%; }
.vision-hero { text-align: center; margin-bottom: 6rem; position: relative; }

.badge-pill { display: inline-flex; align-items: center; gap: 8px; background: white; border: 1px solid #e2e8f0; padding: 6px 16px; border-radius: 100px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 1.5rem; }
.pulse-dot { width: 8px; height: 8px; background: #ef4444; border-radius: 50%; animation: pulseRed 2s infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }

.hero-title { font-family: var(--font-display); font-size: 4rem; line-height: 1.1; font-weight: 800; margin-bottom: 1.5rem; color: var(--text-main); }
.hero-subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 3rem auto; line-height: 1.6; }
.sophron-gradient { background: linear-gradient(90deg, #4f46e5 0%, #f97316 50%, #d946ef 100%); background-size: 200%; -webkit-background-clip: text; color: transparent; animation: shine 4s linear infinite; }
@keyframes shine { to { background-position: 200%; } }

/* --- TRUSTED TICKER STYLES --- */
.trusted-section { margin-top: 2rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.ticker-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; margin-bottom: 1.5rem; opacity: 0.8; }

.ticker-wrapper {
    position: relative; width: 100%; overflow: hidden;
    /* Bordo leggero per contenere visivamente */
    background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.6);
    border-radius: 20px; padding: 20px 0;
    backdrop-filter: blur(5px);
}

.ticker-track {
    display: flex; gap: 4rem; width: max-content;
    animation: scrollLogos 35s linear infinite;
}
/* Pausa on hover per permettere di vedere bene i loghi */
.ticker-wrapper:hover .ticker-track { animation-play-state: paused; }

.logo-item {
    display: flex; align-items: center; justify-content: center;
    width: 140px; height: 60px;
    filter: grayscale(100%) opacity(0.5); /* Default spento */
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-item:hover {
    filter: grayscale(0%) opacity(1); /* Acceso on hover */
    transform: scale(1.1);
}

.logo-item img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}

/* Animazione Scorrimento Infinito */
@keyframes scrollLogos {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Sposta metà della larghezza (visto che abbiamo duplicato i loghi) */
}

/* Sfumature laterali per effetto "dissolvenza" */
.fade-overlay-left, .fade-overlay-right {
    position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none;
}
.fade-overlay-left { left: 0; background: linear-gradient(to right, var(--bg-page), transparent); }
.fade-overlay-right { right: 0; background: linear-gradient(to left, var(--bg-page), transparent); }


/* --- LEGACY SECTION --- */
.legacy-section { margin-bottom: 6rem; padding: 0 1rem; margin-top: 4rem; }
.content-row { display: flex; gap: 4rem; align-items: center; justify-content: center; max-width: 1000px; margin: 0 auto; }
.legacy-text { flex: 1; }
.section-title { font-family: var(--font-display); font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--text-main); }
.highlight-orange { color: var(--accent); position: relative; }
.highlight-orange::after { content: ''; position: absolute; bottom: 2px; left: 0; width: 100%; height: 10px; background: rgba(249, 115, 22, 0.2); z-index: -1; transform: skewX(-10deg); }
.legacy-text p { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.5rem; }

.legacy-card {
    flex: 0 0 350px; background: white; padding: 2.5rem; border-radius: 24px;
    border: 1px solid #e2e8f0; box-shadow: 0 20px 50px -10px rgba(0,0,0,0.1);
    text-align: center; position: relative; overflow: hidden;
}
.legacy-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.card-icon-big { width: 64px; height: 64px; margin: 0 auto 1.5rem auto; background: #f0f9ff; color: #0284c7; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.card-icon-big i { width: 32px; height: 32px; }
blockquote { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-main); font-style: italic; margin-bottom: 1rem; line-height: 1.4; }
.quote-author { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- LINKEDIN CTA --- */
.cta-section { text-align: center; }
.cta-glass-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white; border-radius: 32px; padding: 4rem 2rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3); max-width: 900px; margin: 0 auto;
}
.cta-glass-box h2 { font-family: var(--font-display); font-size: 2.8rem; margin-bottom: 1rem; }
.cta-glass-box p { color: #94a3b8; margin-bottom: 2.5rem; font-size: 1.1rem; }

.linkedin-wrapper { display: flex; justify-content: center; margin-bottom: 2rem; }
.btn-linkedin-xl {
    display: flex; align-items: center; gap: 16px;
    background: #0a66c2; color: white; text-decoration: none;
    padding: 16px 32px; border-radius: 16px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}
.btn-linkedin-xl:hover { transform: translateY(-4px) scale(1.02); background: #004182; box-shadow: 0 8px 0 rgba(0,0,0,0.2); }
.btn-linkedin-xl i { width: 32px; height: 32px; }
.btn-txt-group { display: flex; flex-direction: column; text-align: left; }
.small-txt { font-size: 0.75rem; text-transform: uppercase; opacity: 0.8; font-weight: 700; }
.big-txt { font-size: 1.2rem; font-weight: 700; font-family: var(--font-display); }
.arrow-icon { width: 20px !important; height: 20px !important; opacity: 0.6; transition: 0.3s; margin-left: 10px; }
.btn-linkedin-xl:hover .arrow-icon { opacity: 1; transform: translate(4px, -4px); }

.sign-count { color: #64748b; font-size: 0.9rem; }
.sign-count span { color: #fff; font-weight: 700; }

/* ANIMAZIONI SCROLL */
.fade-in-up { opacity: 0; transform: translateY(30px); animation: fadeInUp 0.8s forwards; }
.reveal-on-scroll { opacity: 0; transform: translateY(40px); transition: all 0.8s ease-out; }
.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }
.delay-1 { animation-delay: 0.2s; } .delay-2 { animation-delay: 0.4s; } .delay-3 { animation-delay: 0.6s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* FOOTER */
.sophron-footer { margin-top: 4rem; border-top: 1px solid #e2e8f0; padding: 2rem 0; background: white; }
.footer-container { text-align: center; max-width: 600px; margin: 0 auto; }
.footer-logo-img { height: 24px; filter: grayscale(100%); opacity: 0.6; margin-bottom: 0.5rem; transition: 0.3s; }
.footer-logo-img:hover { filter: grayscale(0%); opacity: 1; }
.footer-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.footer-bottom-text { font-size: 0.75rem; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 1rem; }

@media (max-width: 768px) {
    .nav-links-center { display: none; }
    .hero-title { font-size: 2.8rem; }
    .ticker-wrapper { padding: 15px 0; }
    .logo-item { width: 100px; height: 50px; }
    .content-row { flex-direction: column; text-align: left; }
    .legacy-card { width: 100%; }
    .cta-glass-box { padding: 2rem 1.5rem; }
}
/* =========================================
   FIX POSIZIONAMENTO NAVBAR
   ========================================= */

/* Forza la centratura (-50% X) anche durante l'animazione */
.glass-navbar.stagger-item {
    transform: translate(-50%, -20px); /* Centrata X, spostata in alto Y */
}

.app-loaded .glass-navbar.stagger-item {
    transform: translate(-50%, 0); /* Centrata X, posizione finale Y */
}
/* --- NAVBAR AGGIORNATA (Uniforme al Playground) --- */

.glass-navbar {
    position: fixed; 
    top: 24px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 95%; 
    max-width: 1200px; 
    height: 76px; 
    z-index: 1000;
    
    background: rgba(255, 255, 255, 0.75); 
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    
    /* Layout Flexbox Distribuito */
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 1.5rem;
    transition: all 0.3s ease;
}

/* LOGO */
.nav-logo { cursor: pointer; }
.nav-logo-img {
    height: 42px; width: auto; display: block;
    filter: drop-shadow(0 2px 4px rgba(255,255,255,0.5));
}

/* 1. LINK CENTRALI */
.nav-links-center {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: absolute; /* Trucco per centrarli perfettamente */
    left: 50%;
    transform: translateX(-50%);
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover { color: var(--text-main); }

/* Sottolineatura animata al passaggio del mouse */
.nav-item::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 2px;
    background: var(--primary); transition: width 0.3s ease; border-radius: 2px;
}
.nav-item:hover::after { width: 100%; }

/* 2. PARTE DESTRA (Social + CTA) */
.nav-right-side { display: flex; align-items: center; gap: 12px; }

/* Icona LinkedIn */
.social-btn {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    color: #0077b5; /* LinkedIn Blue */
    background: rgba(0, 119, 181, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}
.social-btn:hover {
    background: #0077b5; color: white;
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}
.social-btn i { width: 20px; height: 20px; }

/* Separatore Verticale */
.nav-sep { width: 1px; height: 24px; background: rgba(0,0,0,0.1); margin: 0 4px; }

/* CTA Consulenza */
.btn-book-call {
    text-decoration: none; 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 12px 24px; 
    border-radius: 100px; 
    font-size: 0.95rem; font-weight: 600;
    display: flex; align-items: center; gap: 10px; 
    transition: all 0.4s;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
}
.btn-book-call:hover {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Status Indicator (Pulse) */
.status-indicator {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 700; color: #10b981;
    background: rgba(16, 185, 129, 0.1); padding: 6px 12px;
    border-radius: 100px; border: 1px solid rgba(16, 185, 129, 0.2);
}
.pulse-dot {
    width: 8px; height: 8px; background: #10b981; border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
    .nav-links-center { display: none; }
    .glass-navbar { padding: 0 1rem; width: 95%; height: 60px; }
    .btn-book-call span { display: none; }
    .btn-book-call { padding: 12px; border-radius: 50%; width: 44px; height: 44px; justify-content: center; }
    .btn-book-call i { width: 20px; height: 20px; margin: 0; }
    .nav-sep { display: none; }
    .nav-logo-img { height: 32px; }
}
/* --- NEURAL LENS SECTION --- */
.neural-lens-section {
    padding: 4rem 0;
    margin-bottom: 6rem;
    perspective: 1000px;
}

.lens-container {
    max-width: 1000px; margin: 0 auto;
    text-align: center;
}

.lens-header { margin-bottom: 3rem; }

.scanner-stage {
    display: flex; gap: 2rem; justify-content: center; align-items: center;
    flex-wrap: wrap;
}

/* IL DOCUMENTO */
.doc-wrapper {
    position: relative;
    width: 340px; height: 440px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden; /* Importante per il laser */
    border: 1px solid #e2e8f0;
    transform: rotateY(5deg); /* Leggero 3D */
    transition: 0.5s;
}

.invoice-paper { padding: 30px; text-align: left; height: 100%; font-family: 'Courier New', monospace; color: #334155; }

/* Elementi grafici del documento finto */
.invoice-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #0f172a; padding-bottom: 10px; }
.logo-placeholder { width: 40px; height: 40px; background: #0f172a; border-radius: 4px; }
.invoice-title { font-weight: 900; font-size: 1.5rem; letter-spacing: -1px; }

.text-block { background: #f1f5f9; height: 14px; margin-bottom: 8px; border-radius: 2px; width: 100%; }
.w-40 { width: 40%; } .w-20 { width: 20%; }

.invoice-grid { margin: 40px 0; display: flex; flex-direction: column; gap: 15px; }
.grid-line { width: 100%; height: 10px; background: #e2e8f0; border-radius: 2px; }

.invoice-footer { margin-top: auto; text-align: right; border-top: 2px solid #0f172a; padding-top: 10px; }
.text-label { font-size: 0.8rem; font-weight: 700; margin-bottom: 5px; }
.text-amount { font-size: 1.8rem; font-weight: 800; color: #0f172a; }

/* IL LASER SCANNER */
.scan-beam {
    position: absolute; top: -10px; left: 0; width: 100%; height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
    z-index: 10;
    opacity: 0.8;
    animation: scanMove 3s ease-in-out infinite;
}
@keyframes scanMove {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* BOUNDING BOXES (I rettangoli che identificano i dati) */
.bounding-box {
    position: absolute; border: 2px solid var(--accent);
    background: rgba(249, 115, 22, 0.1);
    border-radius: 4px;
    display: flex; align-items: flex-start;
    opacity: 0; transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.bounding-box.detected { opacity: 1; transform: scale(1); box-shadow: 0 0 15px rgba(249, 115, 22, 0.3); }

.box-label {
    background: var(--accent); color: white; font-size: 0.6rem;
    padding: 2px 6px; font-weight: 700; text-transform: uppercase;
    position: absolute; top: -18px; left: -2px; border-radius: 2px;
}

/* Posizioni specifiche dei box */
.box-vendor { top: 90px; left: 25px; width: 140px; height: 30px; }
.box-amount { bottom: 25px; right: 25px; width: 140px; height: 50px; border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
.box-amount .box-label { background: #10b981; }


/* SCHEDA DATI (Cervello) */
.data-extraction-card {
    width: 300px; background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid #cbd5e1; border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    text-align: left;
}
.card-header { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem; color: var(--text-main); }

.data-row { display: flex; justify-content: space-between; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.d-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.d-value { font-family: 'Space Grotesk', monospace; font-weight: 700; color: var(--text-main); transition: 0.3s; }
.d-value.empty { color: #cbd5e1; font-weight: 400; }
.d-value.filled { color: var(--primary); animation: popText 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.highlight .d-value.filled { color: #10b981; }

.confidence-meter { margin-top: 1.5rem; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.meter-bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.meter-fill { width: 0%; height: 100%; background: #10b981; transition: width 1s ease-out; }

@keyframes popText { 0% { transform: scale(1.5); color: var(--accent); } 100% { transform: scale(1); } }

@media (max-width: 768px) {
    .scanner-stage { flex-direction: column; }
    .doc-wrapper { width: 280px; height: 380px; }
}
