/*================================================================================
  SNS ALBENGA - CSS ORIGINALE CON OTTIMIZZAZIONE USER-FRIENDLY PER PC
================================================================================*/

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

html {
    scroll-behavior: smooth;
}

body { 
    font-family: 'Arial', sans-serif; 
    line-height: 1.6; 
    background-color: #ffffff; 
    color: #333; 
}

/* LINK */
a { 
    text-decoration: none; 
    color: #196d65; 
}

a:hover { 
    text-decoration: underline; 
}

/* BOTTONI */
.btn-primary, .btn-secondary { 
    display: inline-block; 
    padding: 12px 25px; 
    margin: 5px; 
    border-radius: 5px; 
    font-weight: bold; 
    text-align: center; 
    transition: all 0.3s ease; 
    color: white; 
    background-color: #4DB6AC; 
}

.btn-primary:hover, .btn-secondary:hover { 
    background-color: #B0D9D9; 
    text-decoration: none;
    color: #196d65;
}

/* NAVBAR PER PC (STILE ORIGINALE) */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 2px solid #4DB6AC;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: bold;
    font-size: 1.1rem;
    color: #196d65;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    font-weight: bold;
    color: #196d65;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #4DB6AC;
}

.nav-btn {
    padding: 8px 16px !important;
    color: white !important;
}

/* HERO SECTION */
.hero { 
    position: relative; 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    justify-content: center; 
    padding: 80px 20px; 
    text-align: center; 
    color: white; 
    background: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat; 
}

.hero::before { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    background-color: rgba(0, 95, 115, 0.3); 
    z-index: 1; 
}

.hero-text { 
    position: relative; 
    z-index: 2; 
    flex: 1 1 400px; 
    max-width: 950px; /* Ottimizzato per PC: testo non eccessivamente largo */
    padding: 20px; 
}

.hero-text h1 { 
    font-size: 2.8rem; 
    margin-bottom: 20px; 
}

.hero-text p { 
    font-size: 1.2rem; 
    margin-bottom: 15px; 
}

.hero-text a { 
    color: #ffffff; 
    text-decoration: underline; 
}

.hero-text a:hover { 
    color: #e0e0e0; 
}

.hero-buttons, .hero-logos { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
}

.hero-buttons {
    margin-bottom: 25px;
}

.hero-logos { 
    gap: 30px; 
    width: 100%; 
    margin-bottom: 40px; 
    position: relative; 
    z-index: 5; 
}

.hero-logos img { 
    max-height: 9rem; 
    object-fit: contain; 
}

/* Contatti Hero disposti su PC */
.hero-contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 25px;
    background: rgba(0, 0, 0, 0.25);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.hero-contact-grid p {
    margin-bottom: 0;
    font-size: 1rem;
}

/* CAROSELLO FULL WIDTH */
.carousel {
  position: relative;
  max-width: 1200px; /* Centrato e ordinato su monitor larghi */
  margin: 30px auto;
  overflow: hidden;
  border-radius: 8px;
}

.carousel-inner {
  display: flex;
  transition: transform 0.6s ease-in-out;
}

.slide {
  min-width: 100%;
  display: flex;
  gap: 10px; 
}

.slide img {
  width: 33%;
  max-height: 450px;
  object-fit: cover;
}

/* Frecce carosello */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0.3em 0.5em;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.3s;
}
.prev:hover, .next:hover {
  background: rgba(0,0,0,0.6);
}
.prev { left: 25px; }
.next { right: 25px; }

/* SEZIONI GENERALI */
section { 
    padding: 50px 20px; 
}

section:nth-child(even) { 
    background-color: #c5e4e4; 
}

.content-limit {
    max-width: 1000px;
    margin: 0 auto;
}

h2 { 
    font-size: 2rem; 
    text-align: center; 
    margin-bottom: 40px; 
    color: #196d65; 
}

/* CORSI CARD ELENCO */
.course-list { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 25px; 
    max-width: 1200px;
    margin: 0 auto;
}

.course-item { 
    background-color: white; 
    flex: 1 1 300px; 
    max-width: 360px;
    border-radius: 10px; 
    padding: 25px 20px; 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    color: black; 
    text-decoration: none; 
}

.course-item:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.15); 
    background-color: #c5e4e4; 
    text-decoration: none; 
}

.course-item i, .course-item h3 { 
    color: #4DB6AC; 
    margin-bottom: 1rem; 
    transition: transform 0.3s ease; 
}

.icon-animate:hover { 
    transform: rotate(15deg); 
}

.course-item p { 
    color: black; 
}

/* ================================================================================
   SEZIONE DATE & CALENDARIO (STILE FEDELE ORIGINALE)
================================================================================ */
.dates-section {
    background-color: #ffffff;
}

.dates-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.date-card {
    background: linear-gradient(to bottom, #ffffff, #c5e4e4);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

.date-card h3 {
    color: #196d65;
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #4DB6AC;
    padding-bottom: 8px;
}

.dual-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.table-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table-title {
    color: #4DB6AC;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.dates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.dates-table th, .dates-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.dates-table th {
    background-color: #4DB6AC;
    color: white;
}

.highlight-row {
    background-color: #fffde7;
}

.table-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* Liste date rinnovi affiancate per PC */
.dates-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 15px;
    padding: 0;
}

.dates-list li {
    display: flex;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 6px 12px;
    border-radius: 4px;
    border-left: 3px solid #4DB6AC;
    font-size: 0.95rem;
}

.dates-list li span {
    color: #666;
}

.over-five-card {
    text-align: center;
}

.over-five-dates {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.date-pill {
    background: #4DB6AC;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
}

/* CARD DETTAGLI CORSI */
.course-details .card { 
    display: flex; 
    flex-wrap: wrap; 
    background: linear-gradient(to bottom, #ffffff, #c5e4e4); 
    border-radius: 10px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    margin: 20px auto; 
    max-width: 1200px; 
    overflow: hidden; 
}

.card-icon { 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-size: cover; 
    background-position: center; 
    color: white; 
    width: 40%; 
    min-height: 250px; 
    overflow: hidden; 
}

.card-icon::before { 
    content: ""; 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(to bottom, rgba(77, 182, 172, 0.6), rgba(0, 0, 0, 0.3)); 
    z-index: 1; 
}

.card-icon i { 
    font-size: 4rem; 
    position: relative; 
    z-index: 2; 
}

.card-icon.foto1 { background-image: url("img/Onde.jpg"); } 
.card-icon.foto2 { background-image: url("img/bagnino_piscina.jpg"); } 
.card-icon.foto3 { background-image: url("img/foto_rinn_brev.jpg"); } 

.card-body { 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: flex-start; 
    padding: 30px; 
    width: 60%; 
    color: #333; 
    line-height: 1.6; 
}

.card-body h3 { 
    font-size: 1.5rem; 
    color: #4DB6AC; 
    margin: 20px 0 10px; 
}

.card-body ul { 
    list-style: none; 
    padding-left: 0; 
    margin: 10px 0 15px; 
}

.card-body li { margin-bottom: 10px; }

.card-body p { 
    margin: 10px 0; 
    color: #333; 
    font-size: 1rem; 
    text-align: left; 
}

/* PERCHÉ SNS */
.why-sns ul { 
    list-style: none; 
    max-width: 700px; 
    margin: 0 auto; 
    padding-left: 3rem; 
}

.why-sns li { 
    font-size: 1.2rem; 
    margin-bottom: 15px; 
    position: relative; 
}

.why-sns li::before { 
    content: "\f058"; 
    font-family: "Font Awesome 5 Free"; 
    font-weight: 900; 
    position: absolute; 
    left: -35px; 
    color: #4DB6AC; 
}

/* ORDINANZE */
.ordinanze { text-align: center; }

.ordinanze-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.ordinanze p { 
    margin-top: 15px; 
    font-size: 1rem; 
}

/* ABOUT */
.about p { 
    max-width: 700px; 
    margin: 15px auto; 
    font-size: 1.1rem; 
}

.center-buttons { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin-top: 20px; 
}

/* CONTATTI */
.contact form { 
    max-width: 700px; /* Larghezza aumentata per desktop */
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

/* RIGA DOPPIA SU PC */
.form-row-pc {
    display: flex;
    gap: 15px;
}

.form-row-pc input, .form-row-pc select {
    flex: 1;
}

.contact input, .contact textarea, .contact select { 
    padding: 12px; 
    border-radius: 5px; 
    border: 1px solid #ccc; 
    font-size: 1rem; 
    width: 100%; 
    font-family: 'Arial', sans-serif;
}

.contact textarea { 
    min-height: 120px; 
    resize: vertical; 
}

.privacy-label { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.9rem; 
}

.privacy-label input[type="checkbox"] { 
    width: 18px; 
    height: 18px; 
}

.contact button { 
    background-color: #4DB6AC; 
    color: white; 
    padding: 14px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 1rem;
    transition: background 0.3s ease; 
}

.contact button:hover { 
    background-color: #196d65; 
}

/* SEZIONE FAQ */
#faq {
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 20px;
}

.faq-item {
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 15px 20px;
  font-size: 1.1rem;
  background-color: #B0D9D9;
  color: black;
  border: none;
  cursor: pointer;
  outline: none;
  border-radius: 5px;
  transition: background 0.3s;
}

.faq-question:hover {
  background-color: #4DB6AC;
  color: white;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #f1f1f1;
  padding: 0 20px;
  border-radius: 0 0 5px 5px;
}

.faq-answer p {
  margin: 15px 0;
}

/* FOOTER */
footer { 
    background-color: #196d65; 
    color: white; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-around; 
    padding: 60px 20px 20px; 
    gap: 20px; 
    position: relative; 
}

footer h3 { margin-bottom: 10px; }

footer a { 
    color: white; 
    text-decoration: none; 
}
footer a:hover { color: #81d4fa; }

.footer-privacy { 
    background-color: #196d65 !important; 
    text-align: center; 
    font-size: 0.8rem; 
    margin-top: 20px; 
    color: #ffffff; 
    width: 100%; 
}

/*================================================================================
  OTTIMIZZAZIONI ESCLUSIVE PER SMARTPHONE (DESKTOP INVARIATO)
================================================================================*/
@media (max-width: 768px) { 

    /* 1. RIDUZIONE SPAZIATURE ESTERNE */
    section { 
        padding: 30px 10px; /* Recupera oltre 20px di spazio orizzontale */
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    /* 2. BARRA SUPERIORE MOBILE */
    .navbar {
        padding: 4px 0;
    }
    .nav-container {
        justify-content: center; /* Centra il titolo evitando buchi vuoti */
        padding: 8px 12px;
    }
    .nav-brand {
        font-size: 0.95rem;
        text-align: center;
    }
    .nav-links { 
        display: none; 
    }

    /* 3. HERO SECTION */
    .hero { 
        padding: 40px 12px; 
    }
    .hero-logos {
        gap: 15px;
        margin-bottom: 20px;
    }
    .hero-logos img {
        max-height: 5.5rem;
    }
    .hero-text h1 { 
        font-size: 1.6rem; 
        line-height: 1.25;
        margin-bottom: 12px;
    }
    .hero-text p { 
        font-size: 0.95rem; 
    }
    .hero-buttons { 
        flex-direction: column; 
        gap: 8px; 
        width: 100%;
        margin-bottom: 20px;
    }
    .hero-buttons .btn-primary, 
    .hero-buttons .btn-secondary {
        width: 100%;
        margin: 0;
        padding: 12px;
    }
    .hero-contact-grid {
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px;
        text-align: left;
    }
    .hero-contact-grid p {
        font-size: 0.88rem;
    }

    /* 4. SEZIONE DATE E TABELLE CORSI (RISOLVE IL PROBLEMA DELLO SCREENSHOT) */
    .dates-container {
        gap: 18px;
    }
    .date-card {
        padding: 14px 8px; /* Elimina l'ingombro laterale da 30px */
        border-radius: 8px;
    }
    .date-card h3 {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }
    .dual-tables { 
        grid-template-columns: 1fr; 
        gap: 15px;
    }
    .table-wrapper {
        padding: 10px 4px; /* Rende la tabella larga quanto lo schermo */
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }
    .table-title {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }
    
    /* Layout tabella compatto e fluido su telefono */
    .dates-table {
        font-size: 0.82rem;
        width: 100%;
    }
    .dates-table th, 
    .dates-table td {
        padding: 8px 4px; /* Spazio orizzontale ottimizzato per non spezzare le date */
        text-align: center;
    }
    .dates-table th:first-child, 
    .dates-table td:first-child {
        text-align: left;
        width: 44%; /* Riserva spazio sufficiente per il testo della sessione */
        padding-left: 6px;
    }
    .dates-table small {
        font-size: 0.72rem;
        display: block;
        line-height: 1.15;
        color: #555;
    }

    /* 5. LISTA DATE RINNOVO */
    .dates-list { 
        grid-template-columns: 1fr; 
        gap: 6px;
    }
    .dates-list li {
        padding: 8px 10px;
        font-size: 0.88rem;
    }

    /* Rinnovi > 5 anni */
    .over-five-dates { 
        flex-direction: column; 
        gap: 8px; 
    }
    .date-pill {
        font-size: 0.95rem;
        padding: 8px 14px;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    /* 6. CARD CORSI */
    ./* RIMUOVE LO SPAZIO VUOTO SULLE CARD CORSI DA SMARTPHONE */
    .course-list {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .course-item {
        flex: 0 0 auto;       /* Annulla i 300px di altezza automatica in colonna */
        width: 100%;
        max-width: 100%;
        height: auto;         /* L'altezza si adatta esattamente al testo */
        min-height: auto;
        max-height: none;
        padding: 18px 15px;   /* Padding compatto ed equilibrato */
    }

    .course-item i {
        margin-bottom: 8px;
    }

    .course-item h3 {
        margin-bottom: 6px;
        font-size: 1.2rem;
    }

    .course-item p {
        margin: 0;
        font-size: 0.95rem;
    }
    
    .course-details .card { 
        flex-direction: column; 
        align-items: center; 
    }
    .card-icon, 
    .card-body { 
        width: 100%; 
    }
    .card-icon { 
        min-height: 180px; 
    }
    .card-body {
        padding: 18px 12px;
    }
    .card-body h3 {
        font-size: 1.25rem;
    }

    /* 7. CAROSELLO & SLIDE */
    .carousel {
        margin: 15px auto;
    }
    .slide img { 
        width: 100%; /* Mostra una sola immagine a tutto schermo su telefono */
        max-height: 260px;
    }

    /* 8. ALTRE SEZIONI & FORM */
    .why-sns ul { 
        padding-left: 28px; 
    }
    .why-sns li {
        font-size: 1rem;
    }
    .ordinanze-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .ordinanze-buttons .btn-primary {
        margin: 0;
        width: 100%;
    }
    .form-row-pc { 
        flex-direction: column; 
        gap: 12px; 
    }
    .contact form {
        padding: 0 4px;
    }
    .contact input, 
    .contact textarea, 
    .contact select {
        padding: 10px;
        font-size: 0.95rem;
    }
    .privacy-label {
        align-items: flex-start;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    /* Corsi assistente bagnanti: impilati su 1 colonna */
    .dual-tables { 
        grid-template-columns: 1fr; 
        gap: 15px;
    }

    /* RINNOVI < 5 ANNI: AFFIANCATI SU 2 COLONNE SOLO SU SMARTPHONE */
    .date-card:nth-of-type(2) .dual-tables,
    .date-card:nth-child(2) .dual-tables {
        grid-template-columns: 1fr 1fr; /* Affianca Albenga e Savona */
        gap: 6px;
    }

    .date-card:nth-of-type(2) .table-wrapper,
    .date-card:nth-child(2) .table-wrapper {
        padding: 8px 4px;
    }

    .date-card:nth-of-type(2) .table-title,
    .date-card:nth-child(2) .table-title {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    /* Date interne disposte su singola colonna per box per non tagliare il testo */
    .date-card:nth-of-type(2) .dates-list,
    .date-card:nth-child(2) .dates-list {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .date-card:nth-of-type(2) .dates-list li,
    .date-card:nth-child(2) .dates-list li {
        padding: 5px 4px;
        font-size: 0.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-left-width: 2px;
    }

    .date-card:nth-of-type(2) .dates-list li span,
    .date-card:nth-child(2) .dates-list li span {
        font-size: 0.7rem;
    }

    .date-card:nth-of-type(2) .dates-list li strong,
    .date-card:nth-child(2) .dates-list li strong {
        font-size: 0.75rem;
    }
}