/* =============================================================================
   ADELCHI GROUP — Design System v1.0
   Palette: Blu #003366 / #005B94 | Oro #E7D454 / #C9A820 | Bianco #ffffff
   Tema: Glassmorphism su sfondo cielo (app) + Dark gradient (public)
   ============================================================================= */

/* ─── 1. CSS CUSTOM PROPERTIES ─────────────────────────────────────────────── */
:root {
    /* Brand colors */
    --blue-dark:    #003366;
    --blue-mid:     #005B94;
    --blue-light:   #2980B9;
    --gold:         #E7D454;
    --gold-dark:    #C9A820;
    --gold-deep:    #FFD700;
    --white:        #ffffff;

    /* Text */
    --text-main:    #1a2a3a;
    --text-soft:    #4a6280;
    --text-muted:   #8aa0b8;

    /* Sky backgrounds (app/light theme) */
    --sky-bg:       linear-gradient(160deg, #daeeff 0%, #e8f4fd 50%, #f0f8ff 100%);
    --sky-1:        #daeeff;
    --sky-2:        #e8f4fd;
    --sky-3:        #f0f8ff;

    /* Dark backgrounds (public theme) */
    --dark-bg:      linear-gradient(135deg, #000d1a 0%, #002244 100%);
    --dark-1:       #000d1a;
    --dark-2:       #001f3f;
    --dark-3:       #002244;

    /* Glass surfaces */
    --glass-white:  rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 91, 148, 0.15);
    --glass-shadow: 0 2px 12px rgba(0, 91, 148, 0.08);

    /* Status colors */
    --green:        #10B981;
    --green-dark:   #059669;
    --red:          #dc2626;
    --red-dark:     #b91c1c;

    /* Spacing */
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    20px;
    --radius-pill:  50px;

    /* Transitions */
    --ease:         all 0.2s ease;
    --ease-slow:    all 0.3s ease;
}

/* ─── 2. RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ─── 3. APP LAYOUT (base_app.html) ────────────────────────────────────────── */
body.app-body {
    background: var(--sky-bg);
    background-attachment: fixed;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ─── 4. SIDEBAR ────────────────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1.5px solid var(--glass-border);
    padding: 1.5rem 1rem;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 91, 148, 0.08);
    z-index: 100;
}

.sidebar-brand {
    padding: 0.5rem 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 91, 148, 0.12);
    margin-bottom: 1rem;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    letter-spacing: 0.3px;
}

.user-info {
    padding: 0.8rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 91, 148, 0.1);
    margin-bottom: 1rem;
}

.username {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 0.4rem;
}

.wallet-badge {
    background: rgba(201, 168, 32, 0.12);
    border: 1px solid rgba(201, 168, 32, 0.4);
    color: #a07800;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-block;
}

/* Navigation */
.nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0.5rem 0.3rem;
    margin-top: 0.5rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.nav-link {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    transition: var(--ease);
    display: block;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(0, 91, 148, 0.07);
    color: var(--blue-dark);
    border-color: rgba(0, 91, 148, 0.12);
}

.nav-link.active {
    background: rgba(0, 91, 148, 0.1);
    color: var(--blue-dark);
    border-color: rgba(0, 91, 148, 0.25);
    font-weight: 700;
}

.nav-link.nav-logout { color: rgba(220, 60, 60, 0.65); margin-top: auto; }
.nav-link.nav-logout:hover {
    background: rgba(239, 68, 68, 0.07);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.18);
}

.sidebar-bottom {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 91, 148, 0.08);
    margin-top: auto;
}

/* ─── 5. MAIN CONTENT ───────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem;
    max-width: 1300px;
}

/* ─── 6. TYPOGRAPHY ─────────────────────────────────────────────────────────── */
.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--blue-dark);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.section-title {
    color: var(--blue-dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.welcome-back { font-size: 0.95rem; color: var(--text-soft); margin-bottom: 2rem; }
.welcome-back strong { color: var(--blue-dark); }

/* Gold gradient text */
.text-gold {
    background: linear-gradient(45deg, var(--gold), var(--gold-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-blue { color: var(--blue-mid); }
.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }

/* ─── 7. GLASS CARDS ────────────────────────────────────────────────────────── */
.glass-card {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--ease);
    box-shadow: var(--glass-shadow);
}

.glass-card:hover {
    background: var(--white);
    border-color: rgba(0, 91, 148, 0.25);
    box-shadow: 0 4px 20px rgba(0, 91, 148, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-card {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--ease);
    box-shadow: var(--glass-shadow);
}

.dashboard-card:hover {
    background: var(--white);
    border-color: rgba(0, 91, 148, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 91, 148, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon { opacity: 0.6; }

/* Section container */
.section {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 91, 148, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 91, 148, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* Dark glass card (per pagine dark) */
.dark-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--ease);
}

.dark-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(231, 212, 84, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Feature card (pagine landing: difesa, finanza, contatti) */
.feature-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--ease-slow);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--blue-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(231, 212, 84, 0.4);
    transform: translateY(-4px);
}

/* ─── 8. BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    text-decoration: none;
    display: inline-block;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: var(--blue-mid);
    color: var(--white);
}
.btn-primary:hover {
    background: #004a7a;
    box-shadow: 0 3px 10px rgba(0, 91, 148, 0.35);
    color: var(--white);
}

.btn-gold {
    background: linear-gradient(45deg, var(--gold-dark), var(--gold));
    color: var(--blue-dark);
    font-weight: 700;
}
.btn-gold:hover {
    box-shadow: 0 4px 16px rgba(231, 212, 84, 0.45);
    transform: translateY(-1px);
}

/* alias vecchio nome */
.btn-yellow { background: linear-gradient(45deg, var(--gold-dark), var(--gold)); color: var(--blue-dark); font-weight: 700; }
.btn-yellow:hover { box-shadow: 0 3px 12px rgba(201, 168, 32, 0.4); transform: translateY(-1px); }

.btn-success { background: var(--green-dark); color: var(--white); }
.btn-success:hover { background: #047857; }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: var(--red-dark); }

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(0, 91, 148, 0.3);
    color: var(--blue-mid);
}
.btn-outline:hover {
    border-color: var(--blue-mid);
    background: rgba(0, 91, 148, 0.06);
    color: var(--blue-dark);
}

.btn-outline-gold {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}
.btn-outline-gold:hover {
    background: var(--gold);
    color: var(--blue-dark);
}

.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-pill); }
.btn-full { width: 100%; text-align: center; }

/* CTA pill button (pagine public) */
.btn-cta {
    display: inline-block;
    background: linear-gradient(45deg, var(--gold), var(--gold-deep));
    color: var(--blue-dark);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1.05rem;
    transition: var(--ease-slow);
    box-shadow: 0 4px 16px rgba(231, 212, 84, 0.35);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-cta:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 28px rgba(231, 212, 84, 0.55);
}

/* ─── 9. FORMS ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-dark);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(0, 91, 148, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(0, 91, 148, 0.1);
    background: var(--white);
}

.form-group select option { background: var(--white); color: var(--text-main); }
.form-group textarea { resize: vertical; min-height: 90px; }

/* Dark form variant */
.form-dark input,
.form-dark select,
.form-dark textarea {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
}
.form-dark input:focus,
.form-dark select:focus,
.form-dark textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(231, 212, 84, 0.15);
    background: rgba(0, 0, 0, 0.35);
}
.form-dark label { color: rgba(255, 255, 255, 0.85); }
.form-dark input::placeholder,
.form-dark textarea::placeholder { color: rgba(255,255,255,0.4); }

/* ─── 10. MODALS ────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 51, 102, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active,
.modal[style*="flex"],
.modal.show { display: flex; }

.modal-content {
    background: linear-gradient(145deg, var(--white), #f0f7ff);
    border: 1.5px solid rgba(0, 91, 148, 0.2);
    padding: 2rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 51, 102, 0.2);
    animation: modalIn 0.25s ease;
}

/* Dark modal (pagine public) */
.modal-content.dark {
    background: linear-gradient(145deg, var(--blue-mid), var(--blue-light));
    border: 2px solid var(--gold);
    color: var(--white);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2,
.modal-header h3 {
    color: var(--blue-dark);
    margin: 0;
    font-size: 1.2rem;
}

.modal-close,
.close,
.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
    font-family: inherit;
}
.modal-close:hover, .close:hover, .close-btn:hover { color: var(--blue-dark); }

/* ─── 11. STATS & ADG ───────────────────────────────────────────────────────── */
.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--blue-mid);
    text-align: center;
    margin: 0.8rem 0 0.3rem;
}

.stat-label {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.adg-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.adg-stat { text-align: center; }

.adg-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #a07800;
}

.adg-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* ─── 12. ACTIONS GRID ──────────────────────────────────────────────────────── */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}

.action-btn {
    background: rgba(0, 91, 148, 0.04);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    transition: var(--ease);
    text-align: left;
    display: block;
    border: 1px solid rgba(0, 91, 148, 0.1);
}

.action-btn:hover {
    background: rgba(0, 91, 148, 0.09);
    border-color: rgba(0, 91, 148, 0.25);
    color: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 91, 148, 0.1);
}

.action-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--blue-dark);
}

.action-desc { font-size: 0.78rem; color: var(--text-muted); }

/* ─── 13. BADGES & STATUS ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}

.badge-blue  { background: rgba(0,91,148,0.12); color: var(--blue-mid); border: 1px solid rgba(0,91,148,0.2); }
.badge-gold  { background: rgba(231,212,84,0.18); color: #8a6d00; border: 1px solid rgba(201,168,32,0.3); }
.badge-green { background: rgba(16,185,129,0.12); color: #065f46; border: 1px solid rgba(16,185,129,0.25); }
.badge-red   { background: rgba(239,68,68,0.1); color: #991b1b; border: 1px solid rgba(239,68,68,0.2); }
.badge-new   { background: linear-gradient(45deg, #00d4aa, #0088cc); color: white; font-size: 0.6rem; padding: 0.1rem 0.45rem; border-radius: 6px; }

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-online  { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); animation: adg-pulse 2s infinite; }
.status-offline { background: var(--red); }
.status-warning { background: var(--gold); }

/* ─── 14. FEED & LIST ITEMS ─────────────────────────────────────────────────── */
.feed-item {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 91, 148, 0.07);
    font-size: 0.85rem;
}
.feed-item:last-child { border-bottom: none; }
.feed-time { color: var(--text-muted); white-space: nowrap; font-size: 0.78rem; padding-top: 0.1rem; }
.feed-message { color: var(--text-soft); }

.visitor-item {
    background: rgba(0, 91, 148, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
}
.visitor-info { display: flex; justify-content: space-between; margin-bottom: 0.2rem; }
.visitor-user { font-weight: 600; color: var(--blue-dark); }
.visitor-time { color: var(--text-muted); }
.visitor-details { color: var(--text-muted); font-size: 0.75rem; }

/* ─── 15. TOGGLE BUTTON ─────────────────────────────────────────────────────── */
.toggle-btn {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--green-dark);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--ease);
    font-family: inherit;
}
.toggle-btn.disabled {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: rgba(220, 38, 38, 0.8);
}

/* ─── 16. ALERTS & FLASH MESSAGES ───────────────────────────────────────────── */
.flash-success, .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.flash-error, .alert-error, .alert {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #991b1b;
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.flash-info, .alert-info {
    background: rgba(0, 91, 148, 0.08);
    border: 1px solid rgba(0, 91, 148, 0.2);
    color: var(--blue-dark);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

/* ─── 17. PUBLIC NAVBAR (index, landing pages) ──────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2000;
    background: rgba(0, 20, 50, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(231, 212, 84, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.2rem;
    height: 52px;
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.5px;
    text-decoration: none;
}
.navbar-brand span { color: var(--white); font-weight: 300; }

.navbar-right { display: flex; align-items: center; gap: 0.6rem; }

.navbar-adg-mini {
    background: rgba(231,212,84,0.15);
    border: 1px solid rgba(231,212,84,0.35);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: none;
}
.navbar-adg-mini.show { display: inline-block; }

/* Hamburger */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2100;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--ease-slow);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav Drawer */
.nav-drawer {
    position: fixed;
    top: 52px; right: 0;
    width: 260px;
    height: calc(100vh - 52px);
    background: rgba(0, 15, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(231, 212, 84, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 1999;
    overflow-y: auto;
    padding: 1.5rem 0;
}
.nav-drawer.open { transform: translateX(0); }

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.nav-overlay.open { opacity: 1; pointer-events: all; }

.drawer-label {
    font-size: 0.65rem;
    color: rgba(231,212,84,0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    padding: 0.8rem 1.2rem 0.3rem;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.2rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 0.1rem 0.5rem;
    transition: var(--ease);
}
.drawer-link:hover, .drawer-link:active {
    background: rgba(231,212,84,0.12);
    color: var(--gold);
}
.drawer-link .di { font-size: 1.1rem; width: 22px; text-align: center; }

.drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.7rem 1.2rem;
}

.drawer-cta {
    margin: 1rem 1.2rem 0;
    display: block;
    text-align: center;
    background: linear-gradient(45deg, var(--gold), var(--gold-deep));
    color: var(--blue-dark);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--ease);
}
.drawer-cta:hover { transform: scale(1.02); }

/* ─── 18. PUBLIC SECTIONS (landing cards) ───────────────────────────────────── */
/* Glassmorphism dark (index services, shop, etc.) */
.service-block {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--ease-slow);
    position: relative;
    overflow: hidden;
}
.service-block:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--gold);
}
.service-block.clicked { border-color: var(--green); }

/* Promo blocks */
.promo-block {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.5s ease;
}
.promo-block:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold);
}

/* Auth containers (login, register) */
.auth-container {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 91, 148, 0.3);
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

/* ─── 19. ANIMATIONS & KEYFRAMES ────────────────────────────────────────────── */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes adg-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

@keyframes adgPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

@keyframes techFlow {
    0%   { left: -100%; }
    100% { left: 100%; }
}

@keyframes promoFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* Utility animation classes */
.anim-fade-in   { animation: fadeIn 0.5s ease both; }
.anim-slide-in  { animation: slideIn 0.5s ease-out both; }
.anim-float     { animation: promoFloat 6s ease-in-out infinite; }
.anim-pulse-icon { animation: iconPulse 2s ease-in-out infinite; }

/* ─── 20. UTILITIES ─────────────────────────────────────────────────────────── */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }

.align-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap  { flex-wrap: wrap; }
.flex-col   { flex-direction: column; }
.flex-1     { flex: 1; }
.gap-xs { gap: 0.4rem; }
.gap-sm { gap: 0.8rem; }
.gap-md { gap: 1.2rem; }
.gap-lg { gap: 1.5rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }

.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }

.w-full { width: 100%; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 600px; }
.max-w-lg { max-width: 900px; }

.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.pill       { border-radius: var(--radius-pill); }

.shadow-sm { box-shadow: 0 1px 6px rgba(0,91,148,0.08); }
.shadow-md { box-shadow: 0 4px 16px rgba(0,91,148,0.1); }
.shadow-lg { box-shadow: 0 8px 32px rgba(0,91,148,0.14); }

.overflow-hidden { overflow: hidden; }
.cursor-pointer  { cursor: pointer; }
.user-select-none { user-select: none; }

.divider {
    height: 1px;
    background: rgba(0, 91, 148, 0.1);
    margin: 1rem 0;
}
.divider-dark { background: rgba(255,255,255,0.1); }

/* Gold underline decoration */
.underline-gold {
    position: relative;
    display: inline-block;
}
.underline-gold::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 2px;
}

/* ─── 21. RESPONSIVE ────────────────────────────────────────────────────────── */

/* App sidebar: hamburger toggle su mobile */
.app-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--glass-white);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 1100;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}
.app-topbar-brand {
    font-weight: 700;
    color: var(--blue-dark);
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.app-topbar-right { display: flex; align-items: center; gap: 0.6rem; }
.app-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.app-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--blue-dark);
    border-radius: 2px;
    transition: var(--ease-slow);
}
.app-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.app-hamburger.open span:nth-child(2) { opacity: 0; }
.app-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar drawer su mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1098;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.open { opacity: 1; }

@media (max-width: 768px) {
    .app-topbar { display: flex; }
    .app-container { padding-top: 52px; }
    .sidebar-overlay { display: block; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 270px;
        height: 100vh;
        z-index: 1099;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        flex-direction: column;
        border-right: 1.5px solid var(--glass-border);
        border-bottom: none;
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }

    .main-content { padding: 1rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .actions-grid { grid-template-columns: 1fr 1fr; }
    .page-title { font-size: 1.6rem; }
    .auth-container { margin: 1rem; padding: 2rem; }
    .promo-block { padding: 2rem 1.5rem; }
    .modal-content { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .actions-grid { grid-template-columns: 1fr; }
    .adg-stats    { grid-template-columns: 1fr 1fr; }
}

/* ─── 22. PUBLIC NAVBAR (base_public.html) ──────────────────────────────────── */
.pub-body {
    background: var(--sky-bg);
    background-attachment: fixed;
}

.pub-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0,91,148,0.12);
    box-shadow: 0 1px 8px rgba(0,51,102,0.06);
    z-index: 2000;
    transition: box-shadow 0.2s ease;
}
.pub-navbar.scrolled {
    box-shadow: 0 2px 16px rgba(0,51,102,0.12);
    background: rgba(255,255,255,0.95);
}

.pub-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}
.pub-brand span { color: var(--gold-dark); }

.pub-nav-center {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.pub-nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-soft);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--ease);
}
.pub-nav-link:hover, .pub-nav-link.active {
    color: var(--blue-dark);
    background: rgba(0,91,148,0.07);
}

.pub-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pub-nav-btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.38rem 0.9rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: var(--ease);
    cursor: pointer;
    border: none;
}
.pub-nav-btn-outline {
    color: var(--blue-mid);
    border: 1.5px solid var(--blue-mid);
    background: transparent;
}
.pub-nav-btn-outline:hover { background: rgba(0,91,148,0.07); }
.pub-nav-btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--blue-dark);
}
.pub-nav-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(231,212,84,0.4); }

/* Hamburger pub */
.pub-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    flex-direction: column;
    gap: 5px;
    z-index: 2100;
}
.pub-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--blue-dark);
    border-radius: 2px;
    transition: var(--ease-slow);
}
.pub-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pub-hamburger.open span:nth-child(2) { opacity: 0; }
.pub-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer pub */
.pub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2098;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.pub-overlay.open { opacity: 1; pointer-events: all; }

.pub-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 280px;
    height: 100vh;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 2099;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.pub-drawer.open { transform: translateX(0); }

.pub-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 800;
    color: var(--blue-dark);
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.pub-drawer-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-soft);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: var(--ease);
}
.pub-drawer-close:hover { background: rgba(0,91,148,0.08); color: var(--blue-dark); }

.pub-drawer-links { padding: 0.8rem 0; flex: 1; }
.pub-drawer-link {
    display: block;
    padding: 0.72rem 1.2rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: 0.1rem 0.6rem;
    transition: var(--ease);
}
.pub-drawer-link:hover, .pub-drawer-link.active {
    background: rgba(0,91,148,0.07);
    color: var(--blue-dark);
}
.pub-drawer-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.6rem 1.2rem;
}
.pub-drawer-cta {
    display: block;
    margin: 0.5rem 1.2rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--blue-dark);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    transition: var(--ease);
}
.pub-drawer-cta:hover { transform: scale(1.02); }

/* Pub page wrapper */
.pub-page { padding-top: 56px; min-height: 100vh; }

/* ─── HERO / HEADER UNIFORMATO ────────────────────────────────────────────── */
.pub-hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 70%, rgba(231,212,84,0.3) 100%);
    color: var(--white);
    padding: 4rem 2rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.pub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(231,212,84,0.12) 0%, transparent 60%);
    pointer-events: none;
}
.pub-hero-icon { font-size: 2.8rem; margin-bottom: 0.8rem; }
.pub-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
}
.pub-hero-sub {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── CONTENT AREA ─────────────────────────────────────────────────────────── */
.pub-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ─── CARD GLASS ────────────────────────────────────────────────────────────── */
.pub-card {
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: var(--ease-slow);
}
.pub-card:hover { box-shadow: 0 6px 24px rgba(0,91,148,0.12); transform: translateY(-2px); }

.pub-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
}

/* ─── FOOTER ────────────────────────────────────────────────────────────────── */
.pub-footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,0.7);
    padding: 2rem 1.5rem;
    margin-top: 4rem;
}
.pub-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.pub-footer-brand { font-weight: 800; color: white; font-size: 1rem; letter-spacing: 0.5px; }
.pub-footer-brand span { color: var(--gold); }
.pub-footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.pub-footer-links a { color: rgba(255,255,255,0.65); font-size: 0.88rem; text-decoration: none; transition: var(--ease); }
.pub-footer-links a:hover { color: var(--gold); }
.pub-footer-copy { font-size: 0.78rem; opacity: 0.5; }

/* ─── GUEST MODAL ────────────────────────────────────────────────────────────── */
.guest-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,15,40,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.guest-modal-overlay.open { opacity: 1; pointer-events: all; }
.guest-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,51,102,0.25);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}
.guest-modal-overlay.open .guest-modal { transform: translateY(0); }
.guest-modal-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.guest-modal-title { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); margin-bottom: 0.5rem; }
.guest-modal-sub { font-size: 0.92rem; color: var(--text-soft); margin-bottom: 1.5rem; line-height: 1.5; }
.guest-modal-features {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.guest-feat {
    background: rgba(0,91,148,0.07);
    color: var(--blue-mid);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
}
.guest-modal-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--ease);
    margin-bottom: 0.8rem;
}
.guest-modal-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,51,102,0.3); }
.guest-modal-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.guest-modal-note { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.guest-modal-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

/* ─── MOBILE: nascondi nav-center, mostra hamburger ─────────────────────────── */
@media (max-width: 900px) {
    .pub-nav-center { display: none; }
    .pub-hamburger  { display: flex; }
    .pub-nav-btn    { display: none; }
}
@media (max-width: 480px) {
    .pub-navbar { padding: 0 1rem; }
    .pub-footer-inner { flex-direction: column; text-align: center; }
    .pub-footer-links { justify-content: center; }
}
