/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #050b14;
    --bg-dark-lighter: #0a0f1a;
    --bg-card-dark: rgba(15, 25, 40, 0.7);
    --text-dark: #e5e9f0;
    --text-muted-dark: #8b9bb0;
    --accent-cyan: #00aaff;
    --accent-cyan-glow: rgba(0, 170, 255, 0.2);
    --accent-amber: #ffb347;
    --border-dark: rgba(0, 170, 255, 0.2);
    
    --bg-light: #f5f7fb;
    --bg-light-lighter: #ffffff;
    --bg-card-light: rgba(255, 255, 255, 0.8);
    --text-light: #1a1a2e;
    --text-muted-light: #4a5568;
    --border-light: rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s ease;
    --glass-blur: blur(12px);
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    scroll-behavior: smooth;
}

/* TEMA SCURO (default) */
body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.dark-mode .container {
    background: transparent;
}

body.dark-mode .counter-card,
body.dark-mode .team-card,
body.dark-mode .servizio-card {
    background: var(--bg-card-dark);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-dark);
}

/* TEMA CHIARO */
body.light-mode {
    background: var(--bg-light);
    color: var(--text-light);
}

body.light-mode .counter-card,
body.light-mode .team-card,
body.light-mode .servizio-card,
body.light-mode .modal-content {
    background: var(--bg-card-light);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

body.light-mode .hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.light-mode .badge {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

body.light-mode .footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* LAYOUT GENERALE */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 80px 0;
}

/* TYPOGRAPHY */
h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 20px;
}

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

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    margin-bottom: 15px;
}

/* HERO */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 6px 12px;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted-dark);
    margin-bottom: 30px;
    max-width: 600px;
}

body.light-mode .hero-description {
    color: var(--text-muted-light);
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--accent-cyan);
    color: white;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-outline:hover {
    background: var(--accent-cyan);
    color: white;
}

.hero-stats {
    background: rgba(0, 170, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0, 170, 255, 0.2);
}
select {
    background-color: #0b1220;
    color: #ffffff;
    border: 1px solid rgba(0, 170, 255, 0.35);
}

select option {
    background-color: #0b1220;
    color: #ffffff;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
}

.hero-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(0, 170, 255, 0.08), transparent 70%);
    z-index: 0;
}

/* CONTATORI */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.counter-card {
    text-align: center;
    padding: 40px 20px;
    border-radius: 20px;
    transition: var(--transition);
}

.counter-card:hover {
    transform: translateY(-5px);
}

.counter-card i {
    font-size: 2.5rem;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.counter-number {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
}

.counter-label {
    margin-top: 10px;
    font-weight: 500;
}

/* TEAM */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.team-card {
    text-align: center;
    padding: 40px 30px;
    border-radius: 24px;
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-amber));
    border-radius: 50%;
    display: flex;
 align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.team-avatar i {
    font-size: 3rem;
    color: white;
}

.team-role {
    display: inline-block;
    background: rgba(0, 170, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 10px 0;
}

.team-skills {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.team-skills span {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
}

body.light-mode .team-skills span {
    background: rgba(0, 0, 0, 0.05);
}

/* SERVIZI GRID */
.servizi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.servizio-card {
    padding: 35px 25px;
    border-radius: 20px;
    transition: var(--transition);
    text-align: center;
}

.servizio-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

.servizio-card i {
    font-size: 2.5rem;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.servizio-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* BADGE TECNOLOGIE */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.badge {
    padding: 8px 20px;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    transition: var(--transition);
}

.badge:hover {
    background: var(--accent-cyan);
    color: white;
    transform: translateY(-2px);
}

/* FEATURES */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(0, 170, 255, 0.05);
    border-radius: 12px;
}

.feature i {
    font-size: 1.5rem;
    color: var(--accent-cyan);
}

/* MODALE */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    padding: 30px;
    border-radius: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-cyan);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-dark);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-family: inherit;
}

body.light-mode .modal-content input,
body.light-mode .modal-content select,
body.light-mode .modal-content textarea {
    background: white;
    border-color: var(--border-light);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

/* TERMINAL BADGE */
.terminal-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #0f0;
    border-left: 3px solid #0f0;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

body.light-mode .terminal-badge {
    background: rgba(0, 0, 0, 0.7);
}

/* TOGGLE TEMA */
.theme-toggle-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-toggle {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

body.light-mode .theme-toggle .fa-sun {
    display: block;
}

body.light-mode .theme-toggle .fa-moon {
    display: none;
}

/* FOOTER */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid rgba(0, 170, 255, 0.1);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3, .footer-col h4 {
    margin-bottom: 15px;
}

.footer-details {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

.footer-col p {
    margin-bottom: 10px;
    line-height: 1.4;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 170, 255, 0.1);
    font-size: 0.8rem;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-self: center;
    }
    
    .counters-grid, .team-grid, .servizi-grid {
        gap: 20px;
    }
    
    .badge-grid {
        gap: 8px;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    
    .footer-grid {
        gap: 25px;
        text-align: center;
    }
    
    .terminal-badge {
        bottom: 10px;
        right: 10px;
        font-size: 0.6rem;
    }
}

.hero-logo {
    display: block;
    width: min(100%, 620px);
    height: auto;
    object-fit: contain;
    padding: 10px;
}

.team-photo {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 24px;
    padding: 4px;
    border-radius: 26px;
    background: linear-gradient(135deg, #00aaff, #00ffff, #ffc857);
    box-shadow:
        0 0 28px rgba(0, 170, 255, 0.35),
        0 0 70px rgba(0, 255, 255, 0.10);
    overflow: hidden;
}

.team-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    border-radius: 22px;
    border: 3px solid #07111f;
}
