:root {
    --verde-acqua: #00C9A7;
    --rosso-mela: #E63946;
    --bianco: #FFFFFF;
    --grigio-chiaro: #F5F5F5;
    --grigio-testo: #333333;
    --overlay-scuro: rgba(0, 0, 0, 0.35);
}

/* ===========================
   ANIMAZIONE FADE IN GLOBALE
   =========================== */
.fade-in {
    opacity: 0;
    animation: fadeInAnimation 1s ease-out forwards;
}

@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ritardi opzionali */
.fade-in.delay-1 { animation-delay: 0.3s; }
.fade-in.delay-2 { animation-delay: 0.6s; }
.fade-in.delay-3 { animation-delay: 0.9s; }

/* LAYOUT BASE */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--grigio-testo);
    background: var(--grigio-chiaro);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.main-header {
    background: var(--bianco);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--verde-acqua);
}

.logo span {
    color: var(--rosso-mela);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 16px;
    padding: 0;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--grigio-testo);
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.nav-links a:hover {
    background: var(--verde-acqua);
    color: var(--bianco);
    transform: translateY(-1px);
}

.nav-links a.active {
    background: var(--verde-acqua);
    color: var(--bianco);
}

/* BOTTONI */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--verde-acqua);
    color: var(--bianco);
    box-shadow: 0 8px 20px rgba(0, 201, 167, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--verde-acqua);
    border: 1px solid var(--verde-acqua);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}


/* ============= HERO AREA A DUE COLONNE ================= */

.intro-section {
    background: rgba(0, 200, 180, 0.7); /* Verde acqua morbido */
    padding: 60px 20px;
    display: flex;
    justify-content: center;
}

.hero-row {
    max-width: 1200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

/* Testo */
.hero-text {
    flex: 1;
    color: #064f47; /* Verde acqua più scuro */
}

.hero-text h1 {
    color: #E85D5D;
 }   


.hero-text h1 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Foto profilo */
.hero-photo {
    flex: 0 0 350px; /* NON prende tutta la colonna */
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-photo img {
    width: 100%;
    max-width: 330px;
    border-radius: 20px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.15));
    mask-image: radial-gradient(circle, white 70%, transparent 100%);
}

/* RESPONSIVE per telefono */
@media (max-width: 850px) {
    .hero-row {
        flex-direction: column;
        text-align: center;
    }

    .hero-photo {
        flex: none;
        width: 80%;
        max-width: 350px;
    }

    .hero-text h1 {
        font-size: 1.7rem;
    }
}

.intro-section h1 {
    color: var(--rosso-mela);
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.intro-section p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 25px;
    color: var(--bianco);
}


.visit-type {
    width: 100%;
    max-width: 300px;
    margin-top: 20px;
}

.visit-type label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
    color: var(--bianco);
}

#tipoVisita {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
}

.helper-text {
    color: white;
    opacity: 0.8;
    font-size: 0.85rem;
    margin-top: 8px;
}

.modal.hidden{ display:none; }

.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 10000;
  padding: 18px;
}

.modal-card{
  width: min(560px, 96vw);
  background:#fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
/* Testo popup prenotazione */
.modal-text{
  color: #000;              /* NERO */
  font-size: 15px;
  line-height: 1.5;
  margin-top: 10px;
}

/* Titolo popup */
.modal-card h3{
  color: #000;
}

/* Evita colori “sbiaditi” sui strong */
.modal-card strong{
  color: #000;
  font-weight: 600;
}


/* ===== Timetable - restyling ===== */

.timetable{
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
}

/* colonna ore: più pulita */
.time-col{
  border-radius: 14px;
  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
}

.time-label{
  height: 34px;
  padding: 6px 10px 0 0;
  font-size: 12px;
  color: rgba(0,0,0,0.70);
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
  box-sizing: border-box;
}

/* area giorni */
.days-area{
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

/* header giorni: pill + sticky */
.day-head{
  position: sticky;
  top: 10px;
  z-index: 2;
  text-align: center;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.85);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

/* colonna giorno: card */
.day-col{
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 10px;
  min-height: calc(34px * 22);
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

/* slot: riduci testo, più gerarchia */
.slot-block{
  border-radius: 14px;
  padding: 10px 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.80);
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.slot-block:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.10);
  border-color: rgba(0,0,0,0.12);
}

/* altezza proporzionale durata */
.slot-30{ height: 34px; }
.slot-45{ height: 51px; }

/* riga orario grande */
.slot-block .slot-time{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: #000;
}

/* badge */
.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.75);
  white-space: nowrap;
}

/* stati */
.slot-free{
  background: rgba(0, 160, 130, 0.08);
}

.slot-free .badge.status{
  background: rgba(0, 160, 130, 0.14);
}

.slot-busy{
  background: rgba(0,0,0,0.07);
  cursor: not-allowed;
  box-shadow: none;
  opacity: .78;
}

.slot-busy:hover{ transform:none; box-shadow:none; }

.slot-busy .badge.status{
  background: rgba(0,0,0,0.12);
}

/* tipo */
.badge.tipo-studio{ background: rgba(255, 170, 0, 0.16); }
.badge.tipo-controllo{ background: rgba(0, 120, 255, 0.14); }

/* chiuso: più elegante */
.day-closed{
  height: 100%;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,0.06);
  border: 1px dashed rgba(0,0,0,0.12);
  color:#000;
  font-weight: 800;
}

/* responsive */
@media (max-width: 980px){
  .timetable{ grid-template-columns: 70px 1fr; }
  .days-area{ grid-template-columns: repeat(7, minmax(95px, 1fr)); }
  .slot-block{ padding: 9px; }
}
@media (max-width: 720px){
  .days-area{ overflow-x: auto; padding-bottom: 10px; }
}

/* CALENDARIO – SFONDO SFUOCATO */
.calendar-bg {
    position: relative;
    padding: 40px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}


/* immagine di sfondo sfuocata */
.calendar-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://images.pexels.com/photos/1435735/pexels-photo-1435735.jpeg"); /* CAMBIA QUI con la tua mela sfuocata */
    background-size: cover;
    background-position: center;
    filter: blur(6px);
    opacity: 0.5;
    transform: scale(1.05);
    z-index: 0;
}

/* overlay scuro/chiaro */
.calendar-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.65),
        rgba(255, 255, 255, 0.85)
    );
    z-index: 0;
}

/* CARD CALENDARIO effetto vetro */
.calendar-card {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    width: 100%;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    padding: 24px 22px 22px;
    animation: fadeUp 0.6s ease-out;
}

/* HEADER CALENDARIO */
.calendar-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.calendar-header h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    color: var(--verde-acqua);
}

.calendar-header p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.calendar-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* GRIGLIA CALENDARIO */
.calendar-grid {
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.calendar-days-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--verde-acqua);
    color: var(--bianco);
    font-size: 0.8rem;
    text-align: center;
}

.calendar-days-head > div {
    padding: 10px 6px;
    font-weight: 600;
}

.calendar-days-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.calendar-day-cell {
    min-height: 200px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
}

/* SLOT */
.slot {
    border-radius: 10px;
    padding: 8px 6px;
    line-height: 1.4;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    background: var(--bianco);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s ease;
    text-align: center;
}

.slot span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.85;
}

.slot::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.1;
}

/* colori per tipologia */
.slot--studio {
    border-left: 4px solid var(--verde-acqua);
}
.slot--studio::before {
    background: var(--verde-acqua);
}

.slot--online {
    border-left: 4px solid var(--rosso-mela);
}
.slot--online::before {
    background: var(--rosso-mela);
}

.slot--controllo {
    border-left: 4px solid #f4a261;
}
.slot--controllo::before {
    background: #f4a261;
}

/* slot pieno */
.slot--full {
    opacity: 0.5;
    text-decoration: line-through;
}

/* hover slot */
.slot:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
}

/* slot attenuati dal filtro */
.slot--muted {
    opacity: 0.22;
}

/* legenda */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.8rem;
    padding: 8px 10px 10px;
    background: rgba(248, 249, 250, 0.9);
    border-top: 1px solid rgba(0,0,0,0.06);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 4px;
}

.legend-studio {
    background: var(--verde-acqua);
}

.legend-online {
    background: var(--rosso-mela);
}

.legend-controllo {
    background: #f4a261;
}

.legend-full {
    background: #888;
}

/* CTA VIDEO INTRODUTTIVO */
.intro-video-cta {
    position: relative;
    z-index: 1;
    max-width: 700px;
    width: 100%;
    margin: 22px auto 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.16);
    display: none; /* mostrata da JS */
    animation: fadeUp 0.6s ease-out;
}

.intro-video-cta h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: var(--verde-acqua);
}

.intro-video-cta p {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

/* FOOTER */
.main-footer {
    background: var(--verde-acqua);
    color: var(--bianco);
    text-align: center;
    padding: 12px 10px;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ANIMAZIONI */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .calendar-grid {
        font-size: 0.75rem;
    }
    .calendar-day-cell {
        min-height: 180px;
    }
}

@media (max-width: 768px) {
    .calendar-days-head,
    .calendar-days-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .calendar-day-cell {
        min-height: 150px;
    }
    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .calendar-cta {
        justify-content: flex-start;
    }
}
/* ============================
   FADE IN – SISTEMA GLOBALE
============================ */

/* Stato iniziale */
.fade-in,
.fade-in-delay-1,
.fade-in-delay-2,
.fade-in-delay-3 {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.9s ease forwards;
}

/* Delay progressivi */
.fade-in-delay-1 {
    animation-delay: 0.15s;
}

.fade-in-delay-2 {
    animation-delay: 0.3s;
}

.fade-in-delay-3 {
    animation-delay: 0.45s;
}

/* Keyframes */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ===== WEEK BOARD PRO ===== */
:root{
  --brand: #0f8f7a;
  --brand2: #0aa08a;
  --cream: #f6f0e6;

  --ink: #0a2f2a;
  --muted: rgba(0,0,0,.62);

  --radius: 18px;
  --shadow: 0 18px 44px rgba(0,0,0,.10);

  --c-studio: #22a06b;
  --c-ctrl:  #f39a3a;
  --c-busy:  #9aa3ad;
}

/* contenitore */
.week-board{
  width: 100%;
  border-radius: 22px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* HEADER giorni */
.week-head{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.week-head div{
  padding: 12px 10px;
  text-align:center;
  letter-spacing: .2px;
  border-right: 1px solid rgba(255,255,255,0.18);
}
.week-head div:last-child{ border-right:0; }

/* corpo: colonne sotto i giorni */
.week-body{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  padding: 14px;
  background: rgba(246,240,230,0.35);
}

/* colonna giorno: stack verticale */
.day-col{
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 12px;
  min-height: 250px;
  display:flex;
  flex-direction: column;   /* importante: mette le card sotto */
  gap: 12px;                /* spazio tra card */
}

/* card slot */
.slot-card{
  position: relative;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.slot-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.14);
}

/* barra colorata sinistra */
.slot-card::before{
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width: 4px;
  border-radius: 999px;
  background: var(--c-ctrl);
}
.slot-card.studio::before{ background: var(--c-studio); }
.slot-card.controllo::before{ background: var(--c-ctrl); }
.slot-card.occupato::before{ background: var(--c-busy); }

/* layout interno: orario + badge a destra, testo sotto */
.slot-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.slot-time{
  font-size: 13px;
  font-weight: 950;
  color: #000;
}

.slot-type{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

/* badge */
.badge{
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.72);
  color: #000;
  white-space: nowrap;
}

.badge.ok{
  background: rgba(15,143,122,0.14);
  border-color: rgba(15,143,122,0.22);
}

.badge.busy{
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.14);
}

/* occupato: non cliccabile */
.slot-card.occupato{
  cursor:not-allowed;
  opacity: .78;
}
.slot-card.occupato:hover{
  transform:none;
  box-shadow: 0 12px 26px rgba(0,0,0,0.08);
}

/* giorno chiuso */
.day-closed{
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 16px;
  background: rgba(0,0,0,0.06);
  border: 1px dashed rgba(0,0,0,0.16);
  color: rgba(0,0,0,0.65);
  font-weight: 950;
  padding: 16px;
  text-align:center;
}

/* responsive */
@media (max-width: 980px){
  .week-board{ overflow-x: auto; }
  .week-head, .week-body{ grid-template-columns: repeat(7, minmax(190px, 1fr)); }
}
/* Desktop: mostra panoramica settimanale, nasconde calendario mese */
@media (min-width: 769px){
  #monthCard{ display: none !important; }
  .week-board{ display: block !important; }
}
/* ======================
   MODAL (BASE: PC + MOBILE)
====================== */

.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
}

.modal.hidden{
  display: none;
}

.modal-card{
  width: min(560px, 100%);
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,0.12);
  box-shadow: 0 18px 55px rgba(0,0,0,0.22);
  padding: 16px;
}

.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-head h3{
  margin: 0;
  font-size: 18px;
}

.modal-text{
  margin: 10px 0;
  color: rgba(17,24,39,0.72);
  line-height: 1.55;
  font-size: 14.5px;
}
