/* Civico216 – Stili Completi, Responsive e Modulo Ottimizzato */

:root {
  --accent: #ae9752;
  --accent-2: #8f7a3f;
  --text: #1a1a1a;
  --muted: #666;
  --bg: #ffffff;
  --error: #a12828;
  --success: #28a745;
}

/* Blocca lo sfondo bianco anche se il telefono è in modalità scura */
@media(prefers-color-scheme: dark) {
  :root {
    --text: #1a1a1a;
    --muted: #666;
    --bg: #ffffff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 2rem 1rem; 
}

/* --- NAVBAR --- */
nav.top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  border-bottom: 1px solid rgba(255,255,255,.25);
}

nav .wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 70px;
  gap: 15px;
}

nav .logo img {
  height: 40px;
  width: auto;
  display: block;
}

nav .menu { 
  display: flex; 
  gap: .3rem; 
  align-items: center;
}

nav .menu a, .dropbtn {
  padding: .5rem .7rem;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
}

nav .menu a:hover, .dropbtn:hover, nav .menu a.active {
  background: rgba(255,255,255,.2);
}

/* LINGUE */
.lang { display: flex; gap: 8px; align-items: center; }
.lang a { color: #fff !important; font-weight: bold; font-size: 0.8rem; padding: 4px; }

/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
  border-radius: 8px;
  margin-top: 5px;
  overflow: hidden;
}
.dropdown-content a { color: #1a1a1a !important; padding: .8rem 1rem !important; display: block !important; }
.dropdown-content a:hover { background: #f5f5f5 !important; }
.dropdown:hover .dropdown-content { display: block; }

/* --- HERO --- */
header.hero {
  position: relative;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background-color: var(--accent);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
 /* background-image: linear-gradient(to bottom, rgba(174,151,82,0.7), rgba(0,0,0,0.4)); */
 /* transition: opacity 1.5s ease-in-out; */
 z-index:1; 
}

/* Il contenuto DEVE avere z-index superiore e position relative */
header.hero .content {
  position: relative;
  z-index: 10; /* Porta tutto in primo piano rispetto alle slide */
  padding: 0 1rem;
}

.brand { 
  font-size: clamp(1.8rem, 6vw, 3.5rem); 
  margin: 0; 
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5); /* Ombra per leggere meglio sulle foto */
}

.sub { 
  font-size: clamp(1rem, 3vw, 1.2rem); 
  opacity: 1; 
  margin: 1rem 0;
  text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.cta {
  display: inline-block;
  margin-top: 1.5rem;
  background: #fff;
  color: var(--accent);
  padding: .8rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  position: relative;
  z-index: 11;
}

.slide-1 { z-index: 1; background-image: linear-gradient(to bottom, rgba(174,151,82,0.7), rgba(0,0,0,0.4)), url('../img/apt-via-tasso.jpg'); }
.slide-2 { z-index: 2; background-image: linear-gradient(to bottom, rgba(174,151,82,0.7), rgba(0,0,0,0.4)), url('../img/apt-via-sardegna.jpg'); animation: fadeOverlap 10s infinite; }


@keyframes fadeOverlap { 0%, 10% { opacity: 0; } 40%, 60% { opacity: 1; } 90%, 100% { opacity: 0; } }

.brand { font-size: clamp(1.8rem, 6vw, 3.5rem); margin: 0; }
.sub { font-size: clamp(1rem, 3vw, 1.2rem); opacity: 0.9; }

/* --- MODULO PRENOTAZIONE (DUE CAMPI PER RIGA) --- */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }

input, select, textarea {
  width: 100%;
  padding: .7rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-family: inherit;
}

/* Pulsanti Azioni - Versione Definitiva Centrata */
.actions {
    display: flex;
    flex-direction: column; /* Colonna su mobile */
    align-items: center;    /* Centra orizzontalmente i figli */
    justify-content: center; /* Centra nel caso ci sia spazio extra */
    gap: 15px;
    margin-top: 1.5rem;
    width: 100%;           /* Occupa tutta la larghezza della card */
}

@media (min-width: 600px) {
    .actions {
        flex-direction: row; /* Torna in riga su PC */
        justify-content: center; /* Centra i pulsanti nella riga */
    }
}

.btn {
  padding: .8rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s;
	width: 220px; /* Scegli la larghezza che preferisci, es. 220px o 250px */
    max-width: none;
}

.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-whatsapp { background: #25D366; color: #fff; }

/* Messaggi di Stato */
#priceMsg {
    margin-bottom: 1.5rem;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #eee;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#priceMsg.date-error {
    background-color: #fff2f2;
    border-color: var(--error);
    color: var(--error) !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- CALENDARIO E FOOTER --- */
.booked-label { border-radius: 4px; padding: 2px; margin-top: 2px; font-weight: bold; }

footer { border-top: 1px solid #e5e5e5; padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
  nav .wrap { height: auto; padding: 10px 15px; flex-wrap: wrap; }
  nav .menu { order: 3; width: 100%; overflow-x: auto; padding: 10px 0; -webkit-overflow-scrolling: touch; }
  nav .menu::-webkit-scrollbar { display: none; }
  .booking-grid { display: flex; flex-direction: column; }
}

@media (max-width: 480px) {
  .form-row { flex-direction: column; gap: 10px; }
}

/* --- AGGIUNTA PER MENU SMARTPHONE (NON TOCCARE IL RESTO) --- */
@media (max-width: 768px) {
  /* Mostra il pulsante hamburger */
  .menu-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
  }
  .menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
  }

  /* Nasconde le lingue standard su mobile per non affollare la barra */
  .lang { display: none; }

  /* Trasforma il menu in un elenco a comparsa */
  nav .menu {
    display: none; /* Inizia nascosto */
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--accent);
    padding: 10px 0;
    z-index: 9999;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  /* Classe che il JavaScript aggiungerà per mostrare il menu */
  nav .menu.active {
    display: flex;
  }

  nav .menu a, .dropbtn {
    width: 100%;
    text-align: left;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  /* Mostra le lingue dentro il menu a comparsa */
  .lang-mobile {
    display: flex !important;
    padding: 15px 25px;
    gap: 15px;
  }
  .lang-mobile a { color: #fff; font-weight: bold; }
}

/* Nasconde le lingue mobile su Desktop */
.lang-mobile { display: none; }