/* ============================
   RESET DI BASE
   ============================ */

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

html, body {
    height: 100%;
}

/* ============================
   BASE TIPOGRAFIA + SFONDO
   ============================ */

body {
    font-family: Georgia, "Times New Roman", Times, serif;
    line-height: 1.65;
    color: #1A1A1A;

    /* sfondo con casco */
    background-color: #111111;
    background-image: url('/immagini/Sfondo.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-size: cover;
}

/* velo di scurimento leggero sull'immagine */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: -1;
    pointer-events: none;
}

/* contenitore principale centrato */
.wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

/* titoli e paragrafi */
h1, h2 {
    margin-bottom: 10px;
    font-weight: 600;
    color: #111111;
}

p {
    margin-bottom: 10px;
}

/* link nel contenuto */
.content-section a {
    color: #111111;
    text-decoration: none;
    border-bottom: 1px solid rgba(17,17,17,0.25);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.content-section a:hover {
    color: #000000;
    border-bottom-color: rgba(17,17,17,0.6);
}

/* ============================
   HEADER + MENU
   ============================ */

.site-header {
    background: #111111;
    border-bottom: 1px solid #000000;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 24px;
}

/* logo + payoff */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 70px;           /* prima era 48px */
    width: auto;            /* mantiene le proporzioni */
    object-fit: contain;    /* evita distorsioni */
}

.logo-text {
    color: #F5F5F5;
    font-weight: 600;
    font-size: 1.05rem;
}

/* menu principale */
.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

/* voci di primo livello */
.main-nav > ul > li {
    position: relative;
    margin: 0 3px;
}

.main-nav > ul > li > a {
    color: #F5F5F5;
    font-weight: 600;
    padding: 14px 24px;
    display: block;
    white-space: nowrap;
    position: relative;
    transition: all 0.35s ease;
}

/* sottolineatura animata */
.main-nav > ul > li > a::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 6px;
    height: 2px;
    background-color: #FFFFFF;
    opacity: 0;
    transform: scaleX(0.2);
    transform-origin: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.main-nav > ul > li:hover > a::after,
.main-nav > ul > li.active > a::after {
    opacity: 1;
    transform: scaleX(1);
}

/* hover primo livello */
.main-nav a:hover,
.main-nav li:hover > a,
.main-nav li.active > a {
    background-color: #2A2A2A;
    color: #FFFFFF;
}

/* dropdown stabile */
.main-nav li {
    position: relative;
}

.main-nav li ul {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;

    min-width: 220px;
    background-color: #111111;
    border: 1px solid #000000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);

    display: none;
    z-index: 2000;
}

/* rimane aperto su hover */
.main-nav li:hover > ul,
.main-nav li ul:hover {
    display: block;
}

/* link nel dropdown */
.main-nav li ul li a {
    display: block;
    padding: 8px 16px;
    color: #F5F5F5;
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav li ul li a:hover {
    background-color: #2A2A2A;
    color: #FFFFFF;
}

/* ============================
   HERO SLIDESHOW
   ============================ */

.hero-slideshow {
    width: 100%;
    max-width: 1180px;
    height: 300px;
    margin: 24px auto 28px auto;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #ddd;
    box-shadow: 0 6px 18px rgba(0,0,0,0.20);
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-position: center center;
    background-size: cover;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.45);
    color: #FFFFFF;
    padding: 22px 28px;
    max-width: 70%;
}

.hero-overlay h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    color: #FFFFFF;
}

.hero-overlay p {
    font-size: 1rem;
    margin-top: 4px;
    color: #FFFFFF;
}

/* pallini */
.hero-dots {
    position: absolute;
    bottom: 10px;
    right: 14px;
    display: flex;
    gap: 6px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
}

.hero-dot.active {
    background: #ffffff;
}

/* frecce */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.hero-arrow.hero-prev {
    left: 10px;
}

.hero-arrow.hero-next {
    right: 10px;
}

.hero-arrow:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.05);
}

/* ============================
   LAYOUT CONTENUTO + SIDEBAR
   ============================ */

.main-content {
    max-width: 1100px;
    margin: 32px auto 40px auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* card contenuto e sidebar */
.content-section,
.sidebar-box {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    padding: 20px 22px;
}

/* colonna destra */
.sidebar-column .sidebar-box {
    margin-bottom: 20px;
}

/* testo */
.content-section h1,
.content-section h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.content-section p {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* blocchi separati */
.content-block {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dddddd;
}

/* ============================
   CALENDARIO
   ============================ */

.sidebar-box h3 {
    background-color: #EDEDED;
    color: #111111;
    padding: 8px 10px;
    margin: -10px -10px 10px -10px;
    font-size: 0.95rem;
    border-radius: 10px 10px 0 0;
}

.calendar-header {
    background-color: #EEE9E3;
    color: #111111;
    border-bottom: 1px solid #DCD7D1;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: center;
    background: #F8F5F2;
    border: 1px solid #DCD7D1;
}

.calendar-table th,
.calendar-table td {
    padding: 5px;
    border: 1px solid #EEE;
}

.calendar-table th {
    background: #EEE9E3;
    font-weight: 600;
}
/* Evidenziazione del giorno corrente nel calendario */
.calendar-table td.calendar-today {
    background-color: #111111;
    color: #FFFFFF;
    font-weight: 600;
}
/* Giorni con eventi formativi */
.calendar-table td.calendar-event {
    background-color: #ffe9b3;
    border: 1px solid #ffaa00;
    cursor: pointer;
}

.calendar-table td.calendar-event:hover {
    background-color: #ffd480;
}
.calendar-today,
.calendar-day.has-event,
.calendar-day.selected {
    background-color: #111111 !important;
    color: #FFFFFF !important;
    font-weight: 600;
}

/* pulsanti mese */
#prevMonthBtn,
#nextMonthBtn {
    background-color: #111111;
    color: #FFFFFF;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

#prevMonthBtn:hover,
#nextMonthBtn:hover {
    background-color: #333333;
    transform: translateY(-1px);
}

/* === MODALE EVENTI CALENDARIO === */
.event-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.event-modal.open {
    display: flex;
}

.event-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.event-modal-box {
    position: relative;
    background: #FFFFFF;
    border-radius: 10px;
    padding: 18px 20px 16px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    z-index: 1;
    animation: modalFadeIn 0.25s ease-out;
}

.event-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.event-modal-box h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

#eventModalList {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    font-size: 0.95rem;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Giorno corrente (oggi, senza evento) */
.calendar-day.calendar-today {
    background-color: #EDE3D8 !important;   /* beige caldo */
    color: #1A1A1A !important;
    font-weight: 700;
    border: 1px solid #D6C7BA;
}

/* Giorni che hanno almeno un evento */
.calendar-day.has-event {
    background-color: #132F5E !important;   /* blu scuro istituzionale */
    color: #FFFFFF !important;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #0D223F;
}

/* Oggi + evento (caso speciale) */
.calendar-day.calendar-today.has-event {
    background-color: #C69C6D !important;   /* oro caldo / bronzo */
    color: #FFFFFF !important;
    font-weight: 700;
    border: 1px solid #9F7A53;
}

/* Hover su un giorno con evento */
.calendar-day.has-event:hover {
    background-color: #F3E8DC !important;  /* beige più chiaro */
    color: #1A1A1A !important;
    transition: background-color .25s ease;
}
.events-filter {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.events-filter select {
    padding: 4px 6px;
    font-size: 0.95rem;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.6rem;
}

.events-table th,
.events-table td {
    border: 1px solid #DDD7CF;
    padding: 6px 8px;
}

.events-table th {
    background-color: #F0EDEA;
    text-align: left;
}

.events-table tr:nth-child(even) {
    background-color: #FAF7F3;
}
/* ============================
   AREA RISERVATA (LOGIN)
   ============================ */

.sidebar-box form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-box label {
    font-size: 0.85rem;
}

.sidebar-box input[type="text"],
.sidebar-box input[type="password"] {
    border: 1px solid #CFCFCF;
    padding: 7px;
    font-size: 0.9rem;
    width: 100%;
    border-radius: 3px;
}

.sidebar-box button,
button,
input[type="submit"] {
    background: #2A2A2A;
    border: none;
    color: #FFF;
    font-size: 0.9rem;
    padding: 7px 14px;
    margin-top: 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.sidebar-box button:hover,
button:hover,
input[type="submit"]:hover {
    background: #444444;
}

/* ============================
   FOOTER
   ============================ */

.site-footer {
    background: #F0EDEA;
    color: #111111;
    padding: 18px 0;
    font-size: 0.9rem;
    border-top: 1px solid #D2CEC8;
    margin-top: 24px;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.site-footer a {
    color: #111111;
    text-decoration: none;
    border-bottom: 1px dotted rgba(0,0,0,0.3);
    transition: color 0.25s ease, border-color 0.25s ease;
}

.site-footer a:hover {
    color: #000000;
    border-bottom-color: rgba(0,0,0,0.6);
}
/* Spaziatura elenchi nel contenuto principale */
.content-section ul {
    margin-left: 1.4rem;      /* sposta tutto un po' verso dentro */
    padding-left: 0.4rem;     /* piccoli pallini non incollati al bordo */
}

.content-section li {
    margin-bottom: 0.35rem;   /* più aria tra un punto e l'altro */
}
/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .hero-slideshow {
        height: 240px;
        margin-top: 14px;
        margin-bottom: 22px;
    }

    .content-section,
    .sidebar-box {
        padding: 16px 18px;
        box-shadow: 0 3px 16px rgba(0,0,0,0.20);
    }

    .site-footer .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 12px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    .hero-slideshow {
        height: 210px;
    }

    .main-nav > ul > li > a {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .content-section,
    .sidebar-box {
        padding: 14px 14px;
    }

    .hero-arrow {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}
.form-registrazione {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 420px;
}

.form-registrazione label {
    font-size: 0.9rem;
}

.form-registrazione input[type="text"],
.form-registrazione input[type="email"],
.form-registrazione input[type="password"] {
    padding: 0.45rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.form-registrazione button {
    margin-top: 0.7rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    background: #111111;
    color: #fff;
    cursor: pointer;
}

.form-registrazione button:hover {
    background: #2A2A2A;
}

.alert {
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}
.alert.error {
    background: #ffe5e5;
    border: 1px solid #dd7777;
}
.alert.success {
    background: #e5ffe9;
    border: 1px solid #77bb88;
}
.btn-logout {
    margin-top: 12px;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: #2A2A2A;
}
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.admin-users-table th,
.admin-users-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.admin-users-table thead th {
    background: #f2f2f2;
    font-weight: 600;
}
/* AREA RISERVATA - FORM PIÙ GRANDE E LEGGIBILE */
.area-login {
    padding: 18px 20px;
}

.area-login form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.area-login label {
    font-size: 0.9rem;
    font-weight: 500;
}

.area-login input[type="email"],
.area-login input[type="text"],
.area-login input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    border-radius: 5px;
    border: 1px solid #cfcfcf;
}

.area-login button {
    margin-top: 0.5rem;
    padding: 8px 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 5px;
    background: #111111;
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.area-login button:hover {
    background: #2A2A2A;
    transform: translateY(-1px);
}

.area-login .note-login {
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.area-login .note-login a {
    font-weight: 600;
}

/* ===== CARDS SETTORI ===== */
.cards-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
  margin:14px 0 6px;
}

.card{
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(0,0,0,0.12);
  border-radius:10px;
  padding:14px 14px;
  box-shadow:0 4px 14px rgba(0,0,0,0.10);
}

.card-title{
  font-size:1.02rem;
  font-weight:700;
  margin:0 0 6px 0;
  color:#111;
}

.card-text{
  font-size:0.95rem;
  margin:0;
  color:#1a1a1a;
}

.card:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(0,0,0,0.14);
  transition:transform 0.18s ease, box-shadow 0.18s ease;
}

/* Mobile */
@media (max-width: 700px){
  .cards-grid{ grid-template-columns: 1fr; }
}
/* Mini icona nelle card */
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.card-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #111;              /* palette nera */
    display:none
}

.card-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0;
    color: #111111
}

.contact-form { display:flex; flex-direction:column; gap:8px; }
.contact-form input, .contact-form textarea{
  border:1px solid #CFCFCF; border-radius:4px; padding:8px; font-size:0.95rem;
  background: rgba(255,255,255,0.95);
}
.contact-form button{ background:#2A2A2A; color:#fff; border:0; border-radius:4px; padding:8px 14px; }
.contact-form button:hover{ background:#444; }

/* ===== FORM: griglia allineamenti ===== */
.contact-form .form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 8px;
}

.contact-form .form-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form .form-span-2{
  grid-column: 1 / -1;
}

/* input/select/textarea full width + coerenti */
.contact-form input,
.contact-form select,
.contact-form textarea{
  width: 100%;
}

/* Mobile */
@media (max-width: 700px){
  .contact-form .form-grid{
    grid-template-columns: 1fr;
  }
  .contact-form .form-span-2{
    grid-column: auto;
  }
}
/* Privacy checkbox: centrata, testo leggibile */
.contact-form .privacy-check{
  display:flex;
  justify-content:center;
  align-items:flex-start; /* meglio per testo su più righe */
  gap:10px;
  width:100%;
  margin:12px 0 4px;
  text-align:left;
}

.contact-form .privacy-check input[type="checkbox"]{
  width:auto;
  flex:0 0 auto;
  margin-top:3px;  /* allinea alla prima riga del testo */
}

.contact-form .privacy-check span{
  display:block;
  max-width:700px;
  line-height:1.4;
}
/* ===== Uniforma font + dimensioni di label e campi ===== */
.contact-form{
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;            /* base */
}

.contact-form label{
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.contact-form input,
.contact-form select,
.contact-form textarea{
  font-family: inherit;       /* fondamentale per select */
  font-size: 18px;
  line-height: 1.25;
}

/* Safari: forza anche le option */
.contact-form select option{
  font-family: inherit;
  font-size: 18px;
}
aside .sidebar-box{
  margin-bottom: 24px;
}

.cookie-banner{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;

  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 14px 14px;
  backdrop-filter: blur(6px);
}

.cookie-inner{
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.cookie-text{
  font-size: 0.95rem;
  line-height: 1.35;
}

.cookie-text a{ color:#111; text-decoration: underline; }

.cookie-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-btn{
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.25);
  cursor: pointer;
  font-size: 0.95rem;
}

.cookie-primary{
  background:#2A2A2A;
  color:#fff;
  border-color:#2A2A2A;
}
.cookie-primary:hover{ background:#444; }

.cookie-secondary{
  background: #fff;
  color:#111;
}
.cookie-secondary:hover{ background:#f2f2f2; }

.cookie-prefs{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.15);
  display: grid;
  gap: 6px;
}

@media (max-width: 700px){
  .cookie-inner{ flex-direction: column; align-items: stretch; }
  .cookie-actions{ justify-content: flex-start; }
}
.admin-inline-form { margin: 0; }
.admin-toggle { display: inline-flex; gap: .5rem; align-items: center; cursor: pointer; }
.notice { padding: .75rem 1rem; border-radius: 8px; }
.notice.success { border: 1px solid #2e7d32; }
.notice.error { border: 1px solid #c62828; }