:root {
    --bg-color: #293654;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary: #2b5ca8;
    --secondary: #4270be;
    --accent: #72a3f2;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #48bb78;
    --switch-off: #4a5568;
    --switch-on: #3182ce;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1200px;
    --max-width-narrow: 800px;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout e Contenitori */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Effetto Bagliore di Sfondo */
.glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(43, 92, 168, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}

/* Header & Navigazione */
header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-header {
    height: 40px;
    width: auto;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    max-width: 900px;
    margin: 3rem auto 3rem auto;
    padding: 0 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    max-width: 260px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 25px rgba(43, 92, 168, 0.4));
}

.tag {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: rgba(43, 92, 168, 0.15);
    border: 1px solid rgba(66, 112, 190, 0.4);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5c2f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.payoff, .intro-lead {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    font-weight: 400;
}

/* Titoli delle Sezioni con linea decorativa */
.section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Pulsanti e Gruppi CTA */
.cta-group, .save-banner {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(43, 92, 168, 0.4);
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--card-hover-bg);
    transform: translateY(-2px);
}

/* Layout a Griglia (Features e Servizi) */
.features, .service-section {
    max-width: var(--max-width);
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.grid-cards, .service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card, .service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover, .service-card:hover {
    border-color: rgba(66, 112, 190, 0.4);
    transform: translateY(-4px);
}

.service-card h4 {
    color: var(--accent);
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.card p, .service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Pagine Legali & Informative */
section {
    margin-bottom: 2rem;
}

section ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

section li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent);
}

/* Tabelle (es. Cookie Policy) */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: var(--text-main);
}

.custom-table th {
    border-bottom: 2px solid var(--border-color);
    padding: 12px;
    color: #ffffff;
}

.custom-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    color: var(--text-muted);
}

.custom-table code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* Centro Preferenze Cookie / Toggle Switches */
.cookie-preference-card {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.cookie-header-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--switch-off);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--switch-on);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-msg {
    margin-top: 1rem;
    color: var(--success);
    font-weight: bold;
    display: none;
    text-align: center;
}

/* Footer */
footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Media Queries */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    footer {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-logo {
        max-width: 200px;
    }
}

/* Stili Modulo di Contatto */
.contact-section {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.captcha-group {
    background: rgba(43, 92, 168, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed rgba(66, 112, 190, 0.4);
}

.btn-block {
    width: 100%;
    text-align: center;
}
/* Navigazione principale con più voci */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: flex-end;
    width: 100%;
}

/* Filiera: card numerate */
.step-card {
    position: relative;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(43, 92, 168, 0.25);
    border: 1px solid rgba(66, 112, 190, 0.5);
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Blocchi servizi in home */
.service-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-block h3 {
    color: var(--accent);
}

.check-list {
    list-style: none;
    margin: 0 0 1.5rem 0;
}

.check-list li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.text-link {
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* Settori serviti */
.chip-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 0 0;
}

.chip-list li {
    margin: 0;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    background: rgba(43, 92, 168, 0.15);
    border: 1px solid rgba(66, 112, 190, 0.4);
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Come lavoriamo */
.process-list {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 0 0;
}

.process-list li {
    counter-increment: step;
    margin: 0;
    padding-top: 1rem;
    border-top: 2px solid var(--primary);
}

.process-list li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    color: var(--accent);
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.process-list h3 {
    color: var(--text-main);
}

.process-list p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Chi siamo */
.about-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 1rem;
}

/* Risultato per il cliente (pagina Esplora) */
.outcome {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.service-card .outcome strong {
    color: var(--text-main);
}

/* Invito finale al contatto */
.cta-final h2 {
    margin-top: 0;
}

.small-note {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

/* Select del modulo di contatto */
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
}

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

.form-group select option {
    background: var(--bg-color);
    color: var(--text-main);
}

@media (max-width: 600px) {
    .main-nav {
        justify-content: center;
    }
}
