/* --- STILI CSS GENERALI E DESIGN SYSTEM --- */
:root {
   --primary-color: #1e3a8a; /* Blu scuro elegante */
   --accent-color: #2563eb;  /* Blu brillante per i pulsanti */
   --accent-hover: #1d4ed8;
   --bg-color: #f8fafc;
   --card-bg: #ffffff;
   --text-color: #1e293b;
   --text-muted: #64748b;
   --border-radius: 12px;
}

* {
   box-sizing: border-box;
   margin: 0;
   padding: 0;
   font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
   background-color: var(--bg-color);
   color: var(--text-color);
   line-height: 1.6;
   display: flex;
   flex-direction: column;
   min-height: 100vh;
}

/* --- NAVBAR --- */
header {
   background-color: var(--card-bg);
   box-shadow: 0 1px 3px rgba(0,0,0,0.1);
   position: sticky;
   top: 0;
   z-index: 100;
}

.navbar {
   max-width: 1200px;
   margin: 0 auto;
   padding: 1rem 2rem;
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.logo {
   font-size: 1.5rem;
   font-weight: 700;
   color: var(--primary-color);
   text-decoration: none;
}

.nav-links {
   display: flex;
   gap: 1.5rem;
   list-style: none;
   align-items: center;
}

.nav-links a {
   text-decoration: none;
   color: var(--text-color);
   font-weight: 500;
   transition: color 0.2s;
}

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

/* Trasformato in bottone nativo per il form POST mantenendo lo stile originario */
.btn-nav-submit {
   background-color: var(--accent-color);
   color: white;
   padding: 0.5rem 1.2rem;
   border-radius: 20px;
   font-weight: 600;
   border: none;
   cursor: pointer;
   font-size: 0.95rem;
   font-family: inherit;
   transition: background-color 0.2s;
}

.btn-nav-submit:hover {
   background-color: var(--accent-hover);
}

/* --- HERO SECTION --- */
.hero {
   max-width: 1200px;
   margin: 3rem auto;
   padding: 0 2rem;
   text-align: center;
}

.hero h1 {
   font-size: 2.8rem;
   color: var(--primary-color);
   margin-bottom: 1rem;
}

.hero p {
   font-size: 1.25rem;
   color: var(--text-muted);
   max-width: 700px;
   margin: 0 auto 2rem auto;
}

/* Bottone della sezione Hero */
.btn-hero-submit {
   display: inline-block;
   background-color: var(--accent-color);
   color: white;
   font-size: 1.1rem;
   font-weight: 600;
   padding: 0.9rem 2.2rem;
   border-radius: var(--border-radius);
   border: none;
   cursor: pointer;
   box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
   transition: transform 0.2s, background-color 0.2s;
   font-family: inherit;
}

.btn-hero-submit:hover {
   background-color: var(--accent-hover);
   transform: translateY(-2px);
}

/* --- CARDS SECTION --- */
.features {
   max-width: 1200px;
   margin: 2rem auto 4rem auto;
   padding: 0 2rem;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 2rem;
}

.card {
   background: var(--card-bg);
   border-radius: var(--border-radius);
   padding: 2rem;
   box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
   border: 1px solid #e2e8f0;
   transition: transform 0.2s, box-shadow 0.2s;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
}

.card:hover {
   transform: translateY(-4px);
   box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.card h3 {
   color: var(--primary-color);
   font-size: 1.4rem;
   margin-bottom: 0.8rem;
}

.card p {
   color: var(--text-muted);
   margin-bottom: 1.5rem;
   font-size: 0.95rem;
}

.card-link {
   text-decoration: none;
   color: var(--accent-color);
   font-weight: 600;
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
}

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

/* --- FOOTER --- */
footer {
   margin-top: auto;
   background-color: #0f172a;
   color: #94a3b8;
   text-align: center;
   padding: 1.5rem 2rem;
   font-size: 0.9rem;
}

/* Responsività per Smartphone */
@media (max-width: 768px) {
   .navbar { flex-direction: column; gap: 1rem; }
   .nav-links { flex-wrap: wrap; justify-content: center; }
   .hero h1 { font-size: 2rem; }
}

/* =========================================================================
   CORREZIONE RESPONSIVE PER BOX SCHEDE (IL SISTEMA SCOLASTICO, CHI SIAMO, ETC)
   ========================================================================= */
@media (max-width: 768px) {
    .features {
        display: flex;
        flex-direction: column; /* Forza la disposizione in verticale */
        gap: 20px;              /* Aggiunge spazio tra un box e l'altro */
        padding: 10px 15px;     /* Previene che i box tocchino il bordo dello schermo */
    }

    .card {
        width: 100% !important; /* Forza ciascun box a prendere tutta la larghezza */
        margin: 0 auto;
        box-sizing: border-box;
    }
}
