/* =====================================================================
   BESPOKE VIP DRIVE — STYLE SHEET UNICO
   Tutte le pagine del sito caricano questo file. Sommario sezioni:

     1.  Reset & Base
     2.  Header & Navigazione (comune a tutte le pagine)
     3.  Pulsanti "pillola" (floating-bubble / contact-btn / experiences-btn)
     4.  Home — Hero
     5.  Home — Sezione Prenotazione (booking form)
     6.  Sezioni Mission / Contatti
     7.  Modale Taxi vs NCC
     8.  Footer
     9.  Pagina pubblica Experiences (cards)
     10. Pannello Admin — Hub (pannello.html)
     11. Pannello Admin — Stat card, controlli, tabelle
     12. Pannello Admin — Modali (dettagli / creazione)
     13. Pannello Admin — Azioni riga & select stato
     14. Pagina Login Admin
     15. Dialog di conferma custom
     16. Toast di notifica
     17. Loader (auth guard + operazioni db)
     18. Impaginazione
     19. Responsive
   ===================================================================== */

/* ---------- 1. RESET & BASE ---------- */

/* Dichiara esplicitamente il tema scuro: senza questo, alcuni browser mobile
   (es. Samsung Internet, Chrome con "Dark theme for web contents") applicano
   un dark-mode forzato euristico che altera/scurisce ulteriormente immagini
   di sfondo su pagine gia' scure, dando un effetto "sfondo troppo scuro". */
html {
    color-scheme: dark;
    scroll-padding-top: 110px;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #0d0d0d;
    color: #f5f5f5;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---------- 2. HEADER & NAVIGAZIONE ---------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    text-decoration: none;
}

.logo span {
    color: #d4af37; /* Accento Oro */
}

nav > ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: #d4af37;
}

.nav-logout {
    color: #ff8a8a !important;
}

.lang-switch {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    padding: 5px 12px;
    color: #f5f5f5;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: border-color 0.25s ease;
}

.lang-current:hover,
.lang-current[aria-expanded="true"] {
    border-color: #d4af37;
}

.lang-caret {
    width: 9px;
    height: 6px;
    color: #d4af37;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.lang-current[aria-expanded="true"] .lang-caret {
    transform: rotate(180deg);
}

.lang-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    margin: 0;
    background: #151515;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    padding: 6px;
    list-style: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.lang-options[hidden] {
    display: none;
}

.lang-options li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lang-options li:hover {
    background: rgba(212, 175, 55, 0.12);
}

.lang-options li.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.15);
}

.lang-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    overflow: hidden;
}

.lang-flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------- 3. PULSANTI "PILLOLA" ---------- */
.header-actions {
    position: absolute;
    top: 100%;
    left: 30px;
    right: 30px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
}

.experiences-btn,
.contact-btn,
.floating-bubble {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 25px;
    background: rgba(74, 58, 15, 0.7);
    border: 1px solid #d4af37;
    border-radius: 40px;
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.experiences-btn:hover,
.contact-btn:hover,
.floating-bubble:hover {
    background: rgba(96, 75, 20, 0.85);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
}

.experiences-btn-icon,
.contact-btn-icon,
.floating-bubble-icon {
    /* Dimensione fluida invece che fissa: su schermi laptop piccoli/ad alta
       densita' (es. 125% di scaling) l'icona non risulta sproporzionata,
       ma resta identica (22px) su monitor larghi. */
    font-size: clamp(16px, 1.6vw, 22px);
    color: #d4af37;
}

.experiences-btn-text,
.contact-btn-text,
.floating-bubble-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(14px, 1.3vw, 18px);
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* ---------- 4. HOME — HERO ---------- */
/* Tablet e desktop condividono lo STESSO trattamento (nessuna distinzione
   tra i due): l'immagine si vede sempre per intero, a piena larghezza,
   mai ritagliata ne' ingrandita oltre la sua risoluzione reale (sfondo.jpg
   e' 1600x900 — un "cover" a piena altezza la farebbe apparire sfocata e
   tagliata in modo diverso a seconda del rapporto larghezza/altezza dello
   schermo, causa della discrepanza desktop/tablet segnalata). Niente
   padding-top: l'immagine parte da y:0 e passa SOTTO l'header fisso
   (semi-trasparente con blur), che la sovrasta senza spostarla in basso.
   Il crop dedicato per i soli telefoni resta nel media query piu' sotto. */
.hero {
    position: relative;
    width: 100%;
    background: #0d0d0d;
    /* Forza lo schema "chiaro" solo su questo blocco: alcuni browser mobile
       (Samsung Internet, Chrome con dark theme euristico) applicano un
       filtro di scurimento extra alle immagini quando color-scheme e'
       "dark" (impostato a livello globale in cima al file). Qui vogliamo
       la foto renderizzata senza quel filtro. */
    color-scheme: light only;
}

.hero-picture {
    display: block;
    width: 100%;
    /* Limitata alla risoluzione nativa di sfondo.jpg (1600px): su monitor
       piu' larghi non viene "stirata" oltre la sua grandezza reale (che la
       faceva sembrare zoomata/sgranata), resta centrata con lo sfondo
       scuro ai lati. Su schermi piu' stretti si restringe normalmente. */
    max-width: 1600px;
    margin: 0 auto;
    line-height: 0;
}

.hero-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    color-scheme: light only;
}

/* SOLO desktop vero (mouse, non touch): sfondo a piena altezza che passa
   sotto l'header fisso, come richiesto. Uso (hover: hover) e (pointer: fine)
   invece di una larghezza minima perche' un iPad Pro in orizzontale puo'
   avere la stessa larghezza CSS di un laptop — questo distingue i due in
   modo affidabile, cosi' il tablet (gia' corretto, va lasciato intatto)
   non viene toccato. */
@media (min-width: 641px) and (hover: hover) and (pointer: fine) {
    .hero {
        height: 100vh;
        overflow: hidden;
    }

    .hero-picture {
        position: absolute;
        inset: 0;
        max-width: none;
        margin: 0;
        width: 100%;
        height: 100%;
    }

    .hero-img {
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    /* Dimensione fluida: resta 52px sui monitor larghi (design originale),
       ma si riduce gradualmente sugli schermi piu' stretti/piccoli (es.
       portatili con scaling 125%) invece di restare fissa e sproporzionata
       sopra il volto nella foto di sfondo. */
    font-size: clamp(30px, 2.8vw, 52px);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 40px;
    letter-spacing: 1px;
    color: #ffffff;
}

/* ---------- 5. HOME — SEZIONE PRENOTAZIONE ---------- */
.booking-section {
    padding: 100px 20px;
    background: linear-gradient(135deg, rgba(13, 13, 13, 1) 0%, rgba(20, 20, 20, 1) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.booking-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.booking-form {
    margin-top: 50px;
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #f5f5f5;
    transition: all 0.3s ease;
}

.form-group select {
    color-scheme: dark;
    cursor: pointer;
}

.form-group select option {
    background: #1a1a1a;
    color: #f5f5f5;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888888;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #d4af37 0%, #c49f2e 100%);
    border: none;
    border-radius: 4px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #0d0d0d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---------- 6. SEZIONI MISSION / CONTATTI ---------- */
.mission-section {
    padding: 100px 20px;
    background-color: #121212;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mission-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.section-tag {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #d4af37;
    margin-bottom: 15px;
    display: block;
}

.mission-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #ffffff;
}

.mission-text {
    font-size: 16px;
    color: #b0b0b0;
    font-weight: 300;
    line-height: 1.8;
    max-width: 850px;
    margin: 0 auto 40px auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-item {
    padding: 20px;
    border-left: 2px solid #d4af37;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
}

.feature-item h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 13px;
    color: #888888;
}

.contact-availability {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 6px 18px;
    margin-bottom: 30px;
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.contact-detail:hover {
    color: #d4af37;
}

.contact-detail-icon {
    display: inline-flex;
    font-size: 20px;
    color: #d4af37;
}

.contact-detail-icon svg {
    display: block;
}

.contact-note {
    margin-top: 20px;
    font-size: 13px;
    color: #888888;
}

/* ---------- 7. MODALE TAXI VS NCC ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #121212;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    padding: 40px 35px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
    font-size: 34px;
    display: block;
    margin-bottom: 12px;
}

.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 700;
    color: #d4af37;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.modal-text {
    font-size: 14px;
    color: #cccccc;
    line-height: 1.7;
    margin-bottom: 14px;
    text-align: left;
}

.modal-text:last-child {
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #d4af37;
}

/* ---------- 8. FOOTER ---------- */
footer {
    background-color: #080808;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 12px;
    color: #666666;
}

footer p {
    margin-top: 10px;
}

/* ---------- 9. PAGINA PUBBLICA EXPERIENCES ---------- */
.experiences-page {
    padding: 170px 20px 100px;
    background-color: #0d0d0d;
    min-height: 100vh;
}

.experiences-container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.experiences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: left;
}

.experience-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: all 0.35s ease;
}

.experience-card:hover {
    transform: translateY(-6px);
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.15);
}

.experience-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.experience-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.experience-price {
    flex-shrink: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 700;
    color: #d4af37;
    white-space: nowrap;
}

.experience-duration {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 16px;
    width: fit-content;
}

.experience-desc {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.7;
    margin-bottom: 22px;
    flex-grow: 1;
}

.experience-cta {
    display: inline-block;
    text-align: center;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid #d4af37;
    border-radius: 4px;
    color: #d4af37;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.experience-cta:hover {
    background: #d4af37;
    color: #0d0d0d;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

/* ---------- 10. PANNELLO ADMIN — HUB ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 140px 20px 60px;
    min-height: 100vh;
}

.container.wide {
    max-width: 1400px;
    padding-top: 120px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 40px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.hub-card {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 50px 35px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s ease;
}

.hub-card:hover {
    transform: translateY(-8px);
    background: rgba(212, 175, 55, 0.08);
    border-color: #d4af37;
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.15);
}

.hub-card-icon {
    font-size: 42px;
    margin-bottom: 20px;
}

.hub-card h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hub-card p {
    font-size: 14px;
    color: #b0b0b0;
    margin-bottom: 20px;
}

.hub-card-count {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 5px 14px;
}

/* ---------- 11. PANNELLO ADMIN — STAT CARD, CONTROLLI, TABELLE ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.controls.space-between {
    justify-content: space-between;
}

.filter-select {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: #f5f5f5;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    color-scheme: dark;
}

.filter-select option {
    background: #1a1a1a;
    color: #f5f5f5;
}

.filter-select:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(255, 255, 255, 0.12);
}

.btn {
    padding: 10px 20px;
    background: #d4af37;
    border: none;
    border-radius: 4px;
    color: #0d0d0d;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

thead {
    background: rgba(212, 175, 55, 0.15);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #d4af37;
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    font-size: 14px;
    vertical-align: top;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(212, 175, 55, 0.08);
}

.desc-cell {
    max-width: 320px;
    color: #b0b0b0;
}

.price-cell {
    color: #d4af37;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-attesa {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.status-confermato {
    background: rgba(76, 175, 80, 0.2);
    color: #90ee90;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.status-completato {
    background: rgba(33, 150, 243, 0.2);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

/* ---------- 12. PANNELLO ADMIN — MODALI ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 15px;
}

.modal-content .modal-title {
    text-align: left;
    font-size: 24px;
    margin-bottom: 0;
    color: #ffffff;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #d4af37;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #d4af37;
    margin-bottom: 8px;
    display: block;
}

.modal-value {
    font-size: 14px;
    color: #e0e0e0;
    word-break: break-word;
}

.form-group.modal-group {
    margin-bottom: 20px;
}

.duration-row {
    display: flex;
    gap: 10px;
}

.duration-row input {
    flex: 1;
}

.duration-row select {
    flex: 1;
    cursor: pointer;
}

/* ---------- 13. PANNELLO ADMIN — AZIONI RIGA & SELECT STATO ---------- */
.actions-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.action-btn {
    padding: 7px 14px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #d4af37;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.action-btn.danger {
    color: #ff8a8a;
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.08);
}

.action-btn.danger:hover {
    background: rgba(255, 107, 107, 0.22);
}

.status-select {
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    color: #d4af37;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    color-scheme: dark;
    transition: all 0.2s ease;
}

.status-select:hover {
    border-color: #d4af37;
}

.status-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.status-select option {
    background: #1a1a1a;
    color: #f5f5f5;
}

/* ---------- 14. PAGINA LOGIN ADMIN ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 60px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 45px 38px;
    text-align: center;
}

.login-box .section-tag {
    text-align: center;
}

.login-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

.login-sub {
    font-size: 13px;
    color: #999;
    margin-bottom: 30px;
}

.login-box form {
    text-align: left;
}

.login-box .form-group {
    margin-bottom: 20px;
}

/* ---------- 15. DIALOG DI CONFERMA CUSTOM ---------- */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-box {
    background: #151515;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    max-width: 420px;
    width: 100%;
    padding: 32px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.25s ease;
}

.confirm-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 14.5px;
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 26px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    flex: 1;
    padding: 12px 18px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    font-family: 'Montserrat', sans-serif;
}

.confirm-btn.cancel {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.25);
    color: #e0e0e0;
}

.confirm-btn.cancel:hover {
    border-color: #ffffff;
}

.confirm-btn.ok {
    background: linear-gradient(135deg, #e05252 0%, #c73f3f 100%);
    color: #ffffff;
}

.confirm-btn.ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(224, 82, 82, 0.35);
}

.confirm-btn.ok.neutral {
    background: linear-gradient(135deg, #d4af37 0%, #c49f2e 100%);
    color: #0d0d0d;
}

.confirm-btn.ok.neutral:hover {
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.35);
}

/* ---------- 16. TOAST DI NOTIFICA ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}

.toast {
    background: #151515;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-left: 4px solid #d4af37;
    color: #f5f5f5;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 13.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    animation: toastIn 0.3s ease;
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.info {
    border-left-color: #64b5f6;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.leaving {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* ---------- 17. LOADER (AUTH GUARD + OPERAZIONI DB) ---------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(212, 175, 55, 0.25);
    border-top-color: #d4af37;
    animation: spin 0.8s linear infinite;
}

.loader-spinner.small {
    width: 15px;
    height: 15px;
    border-width: 2px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Overlay generico mostrato durante get/save verso Firestore. */
.db-loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.db-loader-overlay.active {
    display: flex;
}

.db-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #151515;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 30px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.db-loader-text {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #d4af37;
}

/* Righe/blocchi "in caricamento" dentro tabelle e grid durante il primo get. */
.loader-row td {
    padding: 40px 15px;
    text-align: center;
    color: #999;
}

.inline-loader {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 60px 20px;
    color: #999;
    font-size: 13px;
}

/* ---------- 18. IMPAGINAZIONE ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.page-btn {
    min-width: 38px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: #d4af37;
    color: #d4af37;
}

.page-btn.active {
    background: #d4af37;
    border-color: #d4af37;
    color: #0d0d0d;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ---------- 19. RESPONSIVE ---------- */

/* Soglia mobile alzata a 900px (invece del classico 768px): alcuni telefoni
   Android, soprattutto con MIUI/HyperOS, con "Dimensioni schermo"/densita'
   impostata su valori piu' fitti nelle impostazioni di sistema, riportano al
   browser una larghezza CSS del viewport piu' ampia del normale anche in
   verticale, saltando i breakpoint mobile classici a 768px. */
@media (max-width: 640px) {
    html {
        scroll-padding-top: 150px;
    }

    header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
    }

    nav > ul {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 8px;
        column-gap: 14px;
    }

    nav a {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .hero-title {
        /* Titolo nascosto su mobile/tablet: resta solo l'immagine come banner. */
        display: none;
    }

    /* Impilati in verticale su tutta la fascia mobile (non solo sotto i
       400px): la maggior parte dei telefoni reali sta tra 360px e 430px di
       larghezza CSS (es. 412px su molti Android), troppo stretta per tre
       pillole di testo affiancate in orizzontale senza sovrapporsi. */
    .header-actions {
        position: static;
        left: auto;
        right: auto;
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
    }

    .experiences-btn,
    .floating-bubble,
    .contact-btn {
        padding: 9px 14px;
        gap: 7px;
    }

    .experiences-btn-icon,
    .floating-bubble-icon,
    .contact-btn-icon {
        font-size: 15px;
    }

    .experiences-btn-text,
    .floating-bubble-text,
    .contact-btn-text {
        font-size: 11px;
    }

    .mission-title {
        font-size: 30px;
    }

    .modal-box {
        padding: 30px 22px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-text {
        font-size: 13px;
    }

    .experiences-page {
        padding: 220px 15px 80px;
    }

    .container,
    .container.wide {
        padding: 100px 15px 40px;
    }

    .page-title {
        font-size: 28px;
    }

    .hub-card {
        padding: 40px 25px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }

    .desc-cell {
        max-width: 160px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .duration-row {
        flex-direction: column;
    }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .login-box {
        padding: 34px 24px;
    }

    .db-loader-box {
        padding: 24px 28px;
    }

    .pagination {
        gap: 6px;
    }

    .page-btn {
        min-width: 32px;
        padding: 7px 9px;
        font-size: 11px;
    }

    .hero {
        padding-top: 150px;
    }

    .hero-picture {
        /* sfondo_mobile.jpg e' 768x1376. Il contenitore viene forzato a
           un'altezza pari al 60% di quella che avrebbe l'immagine intera
           (768 / (1376*0.6) = 768/825.6), cosi' l'object-fit:cover sotto
           taglia esattamente 1/5 in alto (cielo) e 1/5 in basso (prato),
           mostrando solo la fascia centrale con villa e auto. */
        max-width: 768px;
        overflow: hidden;
        aspect-ratio: 768 / 825.6;
    }

    .hero-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}
