html {
    scroll-behavior: smooth;
}

:root {
    --bg-main: #0a0b10;
    --card-bg: #121420;
    --card-border: #2a2d40;
    --purple-primary: #9333ea;
    --purple-light: #c084fc;
    --cyan-accent: #06b6d4;
    --text-white: #ffffff;
    --text-muted: #a0aec0;
}

/* ==========================================
   EVIDENZIAZIONE TESTO (SELECTION)
   ========================================== */
::-moz-selection {
    background-color: #2b2e3a;
    color: #ffffff;
}

::selection {
    background-color: #2b2e3a;
    color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   NAVBAR & LOGO
   ========================================== */
.navbar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 16px 8%; 
    background: rgba(18, 20, 32, 0.95);
    border-bottom: 1px solid var(--card-border); 
    position: sticky; 
    top: 0; 
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

/* Icona dell'Header con bordi arrotondati (senza sfumature) */
.logo-icon-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: none;
}

/* Scritta del Logo nell'Header */
.logo-text { 
    display: block;
    font-family: 'Space Grotesk', sans-serif; 
    font-weight: 700; 
    font-size: 1.25rem; 
    color: white; 
    letter-spacing: 0.5px;
}

.logo-text span { 
    color: var(--purple-light); 
}

.nav-links a { 
    color: var(--text-muted); 
    text-decoration: none; 
    margin: 0 16px; 
    font-weight: 500; 
    transition: color 0.2s ease;
}

.nav-links a:hover { 
    color: var(--text-white); 
}

.nav-actions {
    display: flex;
    align-items: center;
}

.btn-nav {
    background: transparent; 
    border: none; 
    color: var(--text-white); 
    margin-right: 15px; 
    cursor: pointer; 
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-nav:hover {
    opacity: 0.8;
}

.btn-primary-sm {
    background: var(--purple-primary); 
    border: none; 
    color: white; 
    padding: 8px 18px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary-sm:hover {
    background: #7e22ce;
    transform: translateY(-1px);
}

/* Badge Profilo Utente Loggato */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 20px;
}

.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-primary), var(--cyan-accent));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    overflow: hidden;
}

.user-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

.logout-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 8px;
    font-weight: 600;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero { 
    text-align: center; 
    padding: 80px 20px 40px; 
}

.badge {
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 6px 16px;
    border-radius: 30px; 
    background: rgba(147, 51, 234, 0.15); 
    border: 1px solid rgba(147, 51, 234, 0.3);
    color: var(--purple-light); 
    font-size: 0.85rem; 
    font-weight: 600; 
    margin-bottom: 20px;
}

.badge-dot { 
    width: 8px; 
    height: 8px; 
    background-color: #22c55e; 
    border-radius: 50%; 
}

.hero-title { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 3rem; 
    font-weight: 700; 
    line-height: 1.2; 
    color: white; 
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #c084fc 50%, var(--cyan-accent) 100%);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.hero-subtitle { 
    color: var(--text-muted); 
    font-size: 1.1rem; 
    margin-top: 15px; 
}

/* ==========================================
   SEZIONI GENERICHE & CHI SIAMO
   ========================================== */
.section-container { 
    max-width: 900px; 
    margin: 60px auto; 
    padding: 0 20px; 
}

.section-header { 
    text-align: center; 
    margin-bottom: 40px; 
}

.section-header h2 { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 2rem; 
    color: white; 
}

.section-header p { 
    color: var(--text-muted); 
}

.about-card {
    background: rgba(13, 15, 23, 0.7);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 16px;
    padding: 35px 40px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), 
                inset 0 0 15px rgba(147, 51, 234, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--purple-primary), var(--cyan-accent));
}

.about-card:hover {
    border-color: rgba(147, 51, 234, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(147, 51, 234, 0.15);
}

.about-card p {
    line-height: 1.9;
    font-size: 1.08rem;
    color: #cbd5e1;
    margin: 0;
}

.about-card strong, .accordion-content strong {
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(120deg, rgba(147, 51, 234, 0.25), rgba(6, 182, 212, 0.25));
    padding: 2px 6px;
    border-radius: 4px;
    border-bottom: 1px solid rgba(147, 51, 234, 0.5);
    transition: all 0.2s ease;
}

.about-card strong:hover {
    color: #38bdf8;
    background: rgba(147, 51, 234, 0.4);
}

/* ==========================================
   REGOLAMENTO (ACCORDION)
   ========================================== */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.accordion-item {
    background: rgba(13, 15, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.accordion-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

summary {
    padding: 16px 22px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s ease;
    list-style: none;
    color: white;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '＋';
    font-size: 1.2rem;
    font-weight: 800;
    transition: transform 0.3s ease;
    color: #94a3b8;
}

.accordion-item[open] summary::after {
    content: '✕';
    transform: rotate(90deg);
}

.accordion-content {
    padding: 15px 22px 20px 22px;
    font-size: 0.98rem;
    line-height: 1.7;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 5px;
}

/* Severità Regole */
.rule-red {
    border-color: rgba(239, 68, 68, 0.3);
}
.rule-red summary {
    color: #ef4444;
}
.rule-red[open] {
    border-color: rgba(239, 68, 68, 0.7);
    background: rgba(239, 68, 68, 0.04);
}
.rule-red summary::after {
    color: #ef4444;
}

.rule-yellow {
    border-color: rgba(234, 179, 8, 0.3);
}
.rule-yellow summary {
    color: #eab308;
}
.rule-yellow[open] {
    border-color: rgba(234, 179, 8, 0.7);
    background: rgba(234, 179, 8, 0.04);
}
.rule-yellow summary::after {
    color: #eab308;
}

.rule-green {
    border-color: rgba(34, 197, 94, 0.3);
}
.rule-green summary {
    color: #22c55e;
}
.rule-green[open] {
    border-color: rgba(34, 197, 94, 0.7);
    background: rgba(34, 197, 94, 0.04);
}
.rule-green summary::after {
    color: #22c55e;
}

.accordion-item.special-staff {
    border: 1px solid rgba(147, 51, 234, 0.5);
    background: rgba(147, 51, 234, 0.04);
}
.accordion-item.special-staff summary {
    color: #c084fc;
}
.accordion-item.special-staff[open] {
    border-color: rgba(147, 51, 234, 0.9);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.15);
}
.accordion-item.special-staff summary::after {
    color: #c084fc;
}

/* ==========================================
   MODULI E INPUT
   ========================================== */
.form-card {
    background: var(--card-bg); 
    border: 1px solid var(--card-border);
    border-radius: 16px; 
    padding: 30px;
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: white; 
}

.form-group input, .form-group textarea {
    width: 100%; 
    padding: 12px; 
    border-radius: 10px; 
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border); 
    color: white; 
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--purple-light);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    resize: vertical;
    max-width: 100%;
    min-height: 120px;
}

.btn-primary {
    background: var(--purple-primary); 
    color: white; 
    border: none; 
    padding: 14px 28px;
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: background 0.3s, transform 0.2s;
}

.btn-primary:hover { 
    background: #7e22ce; 
    transform: translateY(-1px);
}

/* ==========================================
   MODALE DI AUTENTICAZIONE
   ========================================== */
.modal {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    justify-content: center; 
    align-items: center; 
    z-index: 2000;
}

.modal-content {
    background: #121420; 
    border: 1px solid var(--card-border); 
    border-radius: 20px;
    padding: 35px; 
    width: 100%; 
    max-width: 420px; 
    position: relative; 
    color: white;
}

.close-modal { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: var(--text-muted); 
}

.oauth-buttons { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin: 20px 0; 
}

.btn-oauth {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    padding: 12px;
    border-radius: 10px; 
    border: 1px solid var(--card-border); 
    background: rgba(255, 255, 255, 0.05);
    color: white; 
    font-weight: 600; 
    cursor: pointer;
    transition: background 0.2s;
}

.btn-oauth:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-oauth img { 
    width: 20px; 
    height: 20px; 
}

.divider { 
    text-align: center; 
    margin: 20px 0; 
    border-bottom: 1px solid var(--card-border); 
    line-height: 0.1em; 
}

.divider span { 
    background: #121420; 
    padding: 0 10px; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
}

/* ==========================================
   FOOTER MULTI-COLONNA (Font isolati qui)
   ========================================== */
.footer {
    background-color: #080b11;
    color: #94a3b8;
    padding: 50px 5%;
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: 80px;
}

/* Chakra Petch per tutti i testi e i link del footer */
.footer,
.footer p,
.footer a,
.footer-list,
.footer-disclaimer,
.footer-company-info,
.vibotech-text {
    font-family: 'Chakra Petch', sans-serif !important;
}

/* Roboto Slab unicamente per i titoli delle colonne del footer */
.footer-title {
    color: #ffffff;
    font-family: 'Roboto Slab', serif !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 30px;
    align-items: start;
    max-width: 1300px;
    margin: 0 auto;
}

.footer-col-brand {
    max-width: 450px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.vibotech-logo-img {
    height: 30px;
    width: auto;
}

.vibotech-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-disclaimer {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.footer-disclaimer strong {
    color: #e2e8f0;
}

.footer-company-info {
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.copyright-line {
    color: #ffffff;
    margin-bottom: 3px;
}

.address-line {
    color: #64748b;
}

.footer-legal-links {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
}

.footer-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal-links a:hover {
    color: #ffffff;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 10px;
}

.footer-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-list a:hover {
    color: #ffffff;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #ffffff;
    font-size: 1.2rem;
    transition: opacity 0.2s, color 0.2s;
}

.social-links a:hover {
    color: var(--purple-light);
    opacity: 0.9;
}

/* Responsiveness per schermi piccoli */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-col-brand {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-col-brand {
        grid-column: span 1;
    }
}