/* CSS Variables per Design Theme Premium (Dark Mode) */
:root {
    --bg-main: #0a0a0c;
    --bg-secondary: #13141a;
    --text-primary: #ffffff;
    --text-secondary: #9496a8;

    /* Colori Brand Silicore */
    --accent-primary: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --accent-secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);

    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Tipografia */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Animato Glow Orbs (Background Etereo/Scientifico) */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    top: 40%;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    bottom: -300px;
    left: 20%;
    animation-delay: -2s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.05);
    }
}

/* Utilità Glassmorphism */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 1000;
    padding: 1rem 2rem;
    border-radius: 100px;
    transition: var(--transition-smooth);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Pulsanti */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    border: none;
    font-size: 1rem;
}

.sm-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-main);
}

.btn-primary:hover {
    background: #e2e4e9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glow {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-glow:hover {
    box-shadow: 0 6px 25px var(--accent-glow);
    transform: translateY(-2px);
}

.w-100 {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
}

.badge-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.hero-title {
    font-size: 4rem;
    letter-spacing: -1.5px;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 3rem;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.hero-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #a0a0B0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

/* Prodotti SaaS Section */
.products-section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    font-size: 1.1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.product-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.featured-card {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
}

.featured-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.product-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.product-features {
    list-style: none;
    margin-bottom: 2.5rem;
}

.product-features li {
    font-size: 0.9rem;
    color: #e2e4e9;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.check {
    color: var(--success);
    font-weight: 800;
}

.product-footer {
    margin-top: auto;
}

.price {
    margin-bottom: 1.5rem;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
}

.price-period {
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Custom Project Section */
.custom-section {
    padding: 100px 0;
}

.custom-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem;
    align-items: center;
}

.custom-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.custom-guarantees {
    margin-bottom: 3rem;
}

.guarantee {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1rem;
    display: flex;
    gap: 12px;
}

.guarantee strong {
    color: var(--accent-primary);
}

/* Finestra di "Codice" Estetica */
.code-window {
    border-radius: 12px;
    overflow: hidden;
}

.window-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.window-title {
    color: #7a7a7a;
    font-size: 0.8rem;
    font-family: monospace;
    margin-left: auto;
}

.window-body {
    padding: 2rem;
    background: #010409;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #c9d1d9;
}

.token-keyword {
    color: #ff7b72;
}

.token-function {
    color: #d2a8ff;
}

.token-comment {
    color: #8b949e;
    font-style: italic;
}

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0 2rem;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.copyright {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    transition-delay: var(--delay, 0s);
}

.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-container {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .divider {
        width: 100px;
        height: 1px;
    }

    .nav-links {
        display: none;
        /* Simplification for mobile */
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

/* Cart Widget SaaS */
.cart-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 320px;
    padding: 20px;
    border-radius: 16px;
    z-index: 2000;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.cart-widget.visible {
    transform: translateY(0);
    opacity: 1;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.cart-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.cart-count {
    background: var(--accent-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.cart-total span {
    font-size: 1.8rem;
    font-weight: 800;
}

.product-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-5px);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 20px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: white;
}

.modal-header h3 {
    margin-bottom: 5px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-summary {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.summary-row.total-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.summary-row.total-row span {
    color: white;
}

.secure-badge {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 15px;
    font-size: 0.8rem;
}

.modal-msg {
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-radius: 8px;
    text-align: center;
}

.modal-msg.success {
    color: var(--success);
}

.modal-msg.error {
    color: var(--danger);
}