/* ==========================================================================
   1. RESET & BASE (Sfondo Full Screen)
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    
    /* SFONDO FULL-SCREEN CON OVERLAY SFUMATO */
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), 
                url('../img/background-salon.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* ==========================================================================
   2. LAYOUT MODALE (Index, Login, Registrati, Attivazione)
   ========================================================================== */
main.main-container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    width: 100%;
}

/*
.card-box {
    background: #ffffff;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
*/
.card-box {
    background: rgba(255, 255, 255, 0.95); /* Bianco leggermente trasparente */
    backdrop-filter: blur(10px); /* Effetto sfocatura vetro moderno */
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25); /* Ombra più marcata */
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.card-box h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.card-box p.subtitle {
    margin: 0 0 28px 0;
    color: #666666;
    font-size: 14px;
}

.card-box .footer-link {
    margin-top: 20px;
    font-size: 13px;
}

.card-box .footer-link a {
    color: #666666;
    text-decoration: none;
    transition: color 0.2s;
}

.card-box .footer-link a:hover {
    color: #000000;
    text-decoration: underline;
}

/* ==========================================================================
   3. ELEMENTI FORM & COMPONENTI GENERICI
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="tel"] {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Bottone Base */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:active {
    transform: scale(0.99);
}

/* 1. Variante Verde Salvia/Foresta (Registrazione / Azione Primaria) */
.btn-sage {
    background-color: #3a5a40;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(58, 90, 64, 0.25);
}

.btn-sage:hover {
    background-color: #2f4833;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(58, 90, 64, 0.35);
}

/* 2. Variante Nero Grafite Opaco (Login / Azione Secondaria) */
.btn-dark {
    background-color: #111111;
    color: #ffffff !important;
}

.btn-dark:hover {
    background-color: #252525;
    color: #ffffff !important;
}

.error {
    color: #991b1b;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

.logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.logo-container img {
    max-height: 80px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ==========================================================================
   4. DASHBOARD FULL-SCREEN & NAVBAR
   ========================================================================== */
header.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #0f172a;
}

.header-brand img {
    max-height: 42px;
    width: auto;
    object-fit: contain;
}

.header-brand span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.app-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.app-nav a {
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.app-nav a:hover, 
.app-nav a.active {
    color: #000000;
    background-color: #f1f5f9;
}

.app-nav a.btn-logout {
    color: #ef4444;
}

.app-nav a.btn-logout:hover {
    background-color: #fef2f2;
}

main.dashboard-container {
    flex: 1 0 auto;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 18px;
    box-sizing: border-box;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .app-nav {
        display: none; /* In seguito aggiungeremo un menu responsive mobile */
    }
}

.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.dashboard-card h2 {
    font-size: 18px;
    margin: 0 0 16px 0;
    color: #0f172a;
}

.fidelity-card-widget {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.20);
}

/* ==========================================================================
   5. FOOTER LEGALE ANCORATO (Valido sia per Modale che per Dashboard)
   ========================================================================== */
/*
footer.legal-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 20px 24px;
    background-color: #ffffff;
    border-top: 1px solid #e5e5e5;
    text-align: center;
    font-size: 0.75rem;
    color: #777777;
    line-height: 1.5;
    box-sizing: border-box;
    margin-top: auto;
}
*/
footer.legal-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 20px 24px;
    background-color: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(229, 229, 229, 0.5);
    text-align: center;
    font-size: 0.75rem;
    color: #555555;
    line-height: 1.5;
    box-sizing: border-box;
    margin-top: auto;
}

footer.legal-footer p {
    margin: 0 0 4px 0;
    text-align: center;
}

footer.legal-footer p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   BADGE NOTIFICHE GLOBALE (AREA CLIENTE)
   ========================================================================== */

/* Contenitore del link notifiche nella navbar per il posizionamento relativo */
.nav-notifiche-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Badge rosso dinamico */
.badge-notifiche-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    font-family: inherit;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: pulseBadge 2s infinite;
    user-select: none;
    vertical-align: middle;
}

/* Effetto impulso discreto per attrarre l'attenzione */
@keyframes pulseBadge {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}    

/* FIX ALTEZZA NAVBAR ED HEADER UNIFORME SU TUTTE LE PAGINE */
.app-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 64px !important; /* Forza altezza fissa */
    max-height: 64px !important;
    padding: 0 24px !important;
    box-sizing: border-border-box !important;
}

.app-nav {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    height: 100% !important;
}

.app-nav a, 
.nav-notifiche-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important; /* Forziamo la stessa altezza per tutti i link */
    padding: 0 14px !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Impedisce al badge dinamico di alterare l'altezza della voce del menu */
.badge-notifiche-unread {
    line-height: 1 !important;
    margin-left: 6px !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   PULSANTE HAMBURGER & ANIMAZIONE A "X"
   ========================================================================== */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 26px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px !important;
    background-color: #111827;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animazione delle stanghette quando il pulsante ha la classe .active */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(11.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-11.5px) rotate(-45deg);
}

/* Regole per dispositivi mobili (schermi fino a 768px) */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }

    .app-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff !important;
        background-color: #ffffff !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 20px !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-top: 1px solid #e2e8f0;
        gap: 12px;
        z-index: 1000;
    }

    .app-nav.open {
        display: flex !important;
    }

    .app-nav a, 
    .nav-notifiche-link {
        width: 100% !important;
        justify-content: flex-start !important;
        height: 42px !important;
        padding: 0 12px !important;
    }
}