/* ── Reset & variabili ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --bg-alt: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,.08);
    --transition: .3s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* ── Nav ── */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 12px rgba(0,0,0,.08);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: .9rem 1.5rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color var(--transition);
}

nav ul a:hover { color: var(--primary); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ── Bottone ── */
.btn {
    display: inline-block;
    padding: .75rem 2rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}

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

/* ── Hero ── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #7c3aed 100%);
    color: var(--white);
    padding: 6rem 1.5rem 3rem;
}

.hero-content { max-width: 640px; }

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero p {
    font-size: 1.15rem;
    opacity: .88;
    margin-bottom: 2rem;
}

.hero .btn {
    background: var(--accent);
    color: var(--text);
}

.hero .btn:hover { background: #d97706; }

/* ── Sezioni ── */
.section { padding: 5rem 1.5rem; }
.section-alt { background: var(--bg-alt); }

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
    text-align: center;
    color: var(--primary);
}

.section > .container > p {
    text-align: center;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 2.5rem;
}

/* ── Cards ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform var(--transition);
}

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

.card .icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--text-muted); font-size: .95rem; }

/* ── Services grid ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.service-item {
    background: var(--white);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.service-item h3 { margin-bottom: .5rem; color: var(--primary); }
.service-item p { color: var(--text-muted); font-size: .95rem; }

/* ── Form ── */
#contactForm { max-width: 560px; margin: 2.5rem auto 0; }

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition);
    background: var(--white);
}

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

.form-group input.error,
.form-group textarea.error { border-color: #ef4444; }

.form-feedback {
    margin-top: 1rem;
    font-weight: 600;
    min-height: 1.5rem;
}

.form-feedback.success { color: #16a34a; }
.form-feedback.error   { color: #dc2626; }

/* ── Footer ── */
footer {
    background: var(--text);
    color: var(--white);
    text-align: center;
    padding: 2rem 1.5rem;
}

footer .server-info {
    font-size: .8rem;
    opacity: .55;
    margin-top: .4rem;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--white);
        padding: 1.5rem;
        box-shadow: var(--shadow);
    }

    nav ul.open { display: flex; }

    .menu-toggle { display: block; }
}
