/* --- RESET E VARIABILI --- */
:root {
    --bg-dark: #090a0f;
    --nav-bg: rgba(20, 22, 28, 0.92);
    --nav-border: rgba(255, 255, 255, 0.08);
    --pill-dark: #1b1e24;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-hover: #ffffff;
    --accent-blue: #2563eb;
    --accent-hover: #1d4ed8;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Lexend', sans-serif; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-dark); color: var(--text-main); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); font-weight: 300; }
.small { font-size: .82rem; }
.link { color: var(--accent-blue); text-decoration: underline; }

/* --- PRELOADER --- */
.preloader { position: fixed; inset: 0; background: var(--bg-dark); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.preloader img { width: 130px; opacity: 0; transform: scale(0.8); filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.3)); }
.pre-ok .preloader, .no-gsap .preloader { display: none !important; }
.no-gsap .gs-reveal { visibility: visible !important; }
.no-gsap .navbar-wrapper { opacity: 1 !important; }
.gs-reveal { visibility: hidden; }

/* --- NAVBAR --- */
.navbar-wrapper { position: fixed; top: 25px; left: 0; right: 0; margin: 0 auto; width: 95%; max-width: 1400px; z-index: 1000; opacity: 0; }
.navbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nav-pill { background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 999px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.nav-logo { padding: 4px 18px 4px 8px; display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 1px; font-size: .95rem; white-space: nowrap; }
.nav-logo img { height: 36px; width: auto; object-fit: contain; }
.nav-center a { padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: .92rem; color: var(--text-main); white-space: nowrap; transition: background .2s ease, color .2s ease; }
.nav-center a:hover { background: rgba(255, 255, 255, 0.07); }
.nav-center a.active-link { background: var(--accent-blue); color: #fff; }
.nav-bell { width: 36px; height: 36px; display: grid; place-items: center; color: var(--text-muted); position: relative; transition: color .2s; }
.nav-bell:hover { color: #fff; }
.bell-dot { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.nav-area { background: var(--accent-blue); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .2s ease, transform .2s; }
.nav-area:hover { background: var(--accent-hover); transform: scale(1.04); }
.nav-burger { display: none; width: 36px; height: 36px; border: none; background: transparent; color: var(--text-main); cursor: pointer; place-items: center; }
.nav-panel { display: none; position: absolute; top: 68px; right: 0; width: min(320px, 100%); background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 20px; padding: 10px; flex-direction: column; gap: 2px; backdrop-filter: blur(12px); box-shadow: 0 15px 40px rgba(0, 0, 0, .6); }
.nav-panel.open { display: flex; }
.nav-panel a { padding: 12px 16px; border-radius: 12px; color: var(--text-muted); font-weight: 500; }
.nav-panel a:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* --- HERO --- */
.hero { position: relative; min-height: 100vh; width: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 120px 0 60px; }
.hero-background-slideshow { position: absolute; inset: 0; z-index: 1; }
.hero-slide { position: absolute; inset: 0; background-size: cover, cover; background-position: center, center; background-repeat: no-repeat; opacity: 0; animation: slideShow 16s infinite; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(9, 10, 15, 0.55), var(--bg-dark)); }
.slide-1 { background-image: url('/img/hero1.jpg'), linear-gradient(135deg, #0d1b3a, #090a0f); animation-delay: 0s; }
.slide-2 { background-image: url('/img/hero2.jpg'), linear-gradient(135deg, #131a2e, #090a0f); animation-delay: 8s; }
@keyframes slideShow { 0% { opacity: 0; } 6% { opacity: 1; } 50% { opacity: 1; } 56% { opacity: 0; } 100% { opacity: 0; } }
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 20px; width: 100%; max-width: 760px; }
.hero-logo { max-width: 110px; height: auto; display: block; margin: 0 auto 12px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6)); }
.hero h1 { font-size: 5rem; font-weight: 800; letter-spacing: -2px; line-height: 1.05; margin-bottom: 26px; text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); }
.hero-sub { color: var(--text-muted); font-size: 1.05rem; font-weight: 500; margin-bottom: 22px; }
.hero-search { position: relative; max-width: 640px; margin: 0 auto 22px; }
.hero-search-box { display: flex; align-items: center; gap: 14px; background: rgba(20, 22, 28, .75); border: 1px solid var(--nav-border); border-radius: 999px; padding: 0 20px; height: 58px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text-muted); transition: border-color .2s; cursor: text; }
.hero-search-box:focus-within { border-color: var(--accent-blue); }
.hero-search-box input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text-main); font-size: 1rem; font-weight: 400; }
.hero-search-box input::placeholder { color: var(--text-muted); }
.hero-search-box input::-webkit-search-cancel-button { display: none; }
.hero-search-box kbd { font-size: .72rem; background: rgba(255, 255, 255, .08); border: 1px solid var(--nav-border); padding: 4px 8px; border-radius: 6px; color: var(--text-muted); }
.hero-results { display: none; position: absolute; top: 66px; left: 0; right: 0; background: rgba(20, 22, 28, .98); border: 1px solid var(--nav-border); border-radius: 18px; padding: 8px; max-height: 320px; overflow-y: auto; text-align: left; z-index: 20; box-shadow: 0 15px 40px rgba(0, 0, 0, .6); }
.hero-results.open { display: block; }
.hero-results a { display: block; padding: 12px 14px; border-radius: 12px; }
.hero-results a strong { display: block; font-weight: 600; font-size: .95rem; }
.hero-results a span { font-size: .8rem; color: var(--text-muted); font-weight: 300; }
.hero-results a.sel, .hero-results a:hover { background: rgba(37, 99, 235, .18); }
.hero-results .vuoto { padding: 14px; color: var(--text-muted); font-size: .9rem; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 640px; margin: 0 auto 26px; }
.hero-chips a { background: rgba(20, 22, 28, .8); border: 1px solid var(--nav-border); border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: .9rem; backdrop-filter: blur(8px); transition: all .2s ease; }
.hero-chips a:hover { background: var(--accent-blue); border-color: var(--accent-blue); transform: translateY(-2px); }
.contact-info { font-size: 1rem; color: var(--text-muted); font-weight: 300; line-height: 1.6; }
.contact-info a:hover { color: var(--text-hover); text-decoration: underline; }

/* --- SERVIZI --- */
.services-section { padding: 100px 5%; max-width: 1600px; margin: 0 auto; position: relative; z-index: 3; }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 800; margin-bottom: 60px; letter-spacing: 1px; text-transform: uppercase; }
.section-title span, .page-title span { color: var(--accent-blue); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service-card { background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.service-card:hover { transform: translateY(-8px); border-color: var(--accent-blue); box-shadow: 0 15px 35px rgba(37, 99, 235, 0.15); }
.service-photo { position: relative; height: 180px; background: linear-gradient(135deg, #12213f, #0b1020); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--nav-border); }
.service-photo > i { font-size: 3rem; color: rgba(37, 99, 235, .55); }
.service-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.service-card:hover .service-photo img { transform: scale(1.05); }
.service-tag { position: absolute; top: 12px; left: 12px; z-index: 2; background: var(--accent-blue); color: #fff; font-size: .7rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.service-content { padding: 25px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.service-content h3 { color: var(--accent-blue); font-size: 1.1rem; font-weight: 600; text-align: center; line-height: 1.4; }
.service-content p, .service-content ul { font-size: .9rem; color: var(--text-muted); line-height: 1.6; font-weight: 300; }
.service-content p a { color: var(--accent-blue); text-decoration: underline; }
.service-label { font-weight: 600 !important; color: var(--text-main) !important; }
.service-content ul { padding-left: 20px; }
.service-content ul li { margin-bottom: 8px; }
.service-btn { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--accent-blue); color: var(--accent-blue); font-size: .85rem; font-weight: 500; transition: all .2s ease; }
.service-btn:hover { background: var(--accent-blue); color: #fff; }
.faq-bar { margin-top: 40px; background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 16px; padding: 28px 32px; }
.faq-bar h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.faq-bar ul { list-style: none; display: grid; gap: 4px; }
.faq-bar a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--nav-border); color: var(--text-muted); font-weight: 300; transition: color .2s; }
.faq-bar a:hover { color: var(--text-hover); }
.faq-bar li:last-child a { border-bottom: none; }

/* --- FOOTER --- */
.site-footer { border-top: 1px solid var(--nav-border); background: var(--bg-dark); position: relative; z-index: 3; color: var(--text-muted); font-weight: 300; font-size: .9rem; }
.sf-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; max-width: 1200px; margin: 0 auto; padding: 60px 5% 40px; text-align: left; }
.sf-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text-main); font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.sf-brand img { height: 34px; }
.sf-tag { line-height: 1.6; max-width: 280px; }
.site-footer h4 { color: var(--text-main); font-weight: 600; font-size: .95rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer a:hover { color: var(--text-hover); }
.sf-contact li { display: flex; align-items: center; gap: 10px; }
.sf-contact i { color: var(--accent-blue); width: 18px; text-align: center; }
.sf-sos a { color: #f87171; }
.sf-bar { border-top: 1px solid var(--nav-border); }
.sf-bar > div { max-width: 1200px; margin: 0 auto; padding: 22px 5%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; }

/* --- BANNER --- */
#new-news-banner { display: none; position: fixed; bottom: 30px; right: 30px; background: linear-gradient(135deg, var(--accent-blue), #1d4ed8); color: #fff; padding: 14px 20px; border-radius: 12px; z-index: 999; align-items: center; gap: 12px; box-shadow: 0 8px 25px rgba(37, 99, 235, .5); max-width: 320px; animation: slideInRight .5s ease-out; }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
#new-news-banner a { color: #fff; font-weight: 700; text-decoration: underline; }
#new-news-banner button { background: rgba(255, 255, 255, .2); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: .9rem; flex-shrink: 0; }
#annunci-speciali { display: none; position: fixed; top: 100px; left: 0; right: 0; margin: 0 auto; z-index: 998; width: 90%; max-width: 800px; }
.annuncio-speciale { background: linear-gradient(135deg, rgba(234, 179, 8, .15), rgba(234, 179, 8, .05)); border: 1px solid rgba(234, 179, 8, .4); color: #fbbf24; padding: 14px 20px; border-radius: 10px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: .95rem; font-weight: 500; box-shadow: 0 5px 20px rgba(0, 0, 0, .4); backdrop-filter: blur(10px); }
.annuncio-speciale button { background: none; border: none; color: inherit; cursor: pointer; margin-left: auto; font-size: 1.1rem; }

/* --- PAGINE INTERNE --- */
.page { max-width: 1100px; margin: 0 auto; padding: 150px 5% 90px; min-height: 80vh; }
.page.wide { max-width: 1400px; }
.page-title { text-align: center; font-size: 2.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.page-sub { text-align: center; color: var(--text-muted); font-weight: 300; margin-bottom: 50px; }
.card { background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 16px; padding: 28px; }
.card-h { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.card-h i { color: var(--accent-blue); }
.card-p { color: var(--text-muted); font-weight: 300; line-height: 1.7; font-size: .93rem; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-top .card-h { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.check-list { list-style: none; display: grid; gap: 12px; color: var(--text-muted); font-weight: 300; font-size: .93rem; line-height: 1.55; }
.check-list li { padding-left: 26px; position: relative; }
.check-list li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; color: var(--accent-blue); font-size: .8rem; top: 2px; }
.check-list strong { color: var(--text-main); font-weight: 600; }

.news-list { display: grid; gap: 20px; max-width: 800px; margin: 0 auto; }
.news-card h3 { font-size: 1.25rem; margin: 6px 0 12px; }
.news-card p { color: var(--text-muted); font-weight: 300; line-height: 1.7; white-space: pre-line; }
.news-meta { color: var(--accent-blue); font-size: .8rem; font-weight: 600; }

.rank-h { font-size: 1.2rem; font-weight: 700; margin: 36px 0 16px; display: flex; align-items: center; gap: 10px; }
.rank-h i { color: var(--accent-blue); }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rank-card { background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; font-weight: 500; transition: all .25s ease; }
.rank-card i { color: var(--accent-blue); }
.rank-card:hover { border-color: var(--accent-blue); transform: translateY(-4px); }

/* --- FORM --- */
.form-grid { display: grid; gap: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea { width: 100%; background: #0f1117; border: 1px solid var(--nav-border); color: var(--text-main); border-radius: 12px; padding: 13px 16px; font-size: .95rem; outline: none; transition: border-color .2s; color-scheme: dark; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-blue); }
textarea { resize: vertical; min-height: 90px; }
select option { background: #14161c; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent-blue); color: #fff; border: none; border-radius: 999px; padding: 14px 28px; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost { background: rgba(255, 255, 255, .05); border: 1px solid var(--nav-border); color: var(--text-main); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.btn-danger { background: #b91c1c; }
.btn-danger:hover { background: #991b1b; }
.form-msg { min-height: 1.2em; font-size: .9rem; line-height: 1.5; }
.form-msg.ok { color: #4ade80; }
.form-msg.err { color: #f87171; }
.need-login { background: rgba(37, 99, 235, .08); border: 1px solid rgba(37, 99, 235, .3); border-radius: 12px; padding: 16px 18px; color: var(--text-muted); font-size: .93rem; }

/* --- STATI, TAB, TABELLE --- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; background: rgba(148, 163, 184, .15); color: var(--text-muted); }
.st-in_attesa, .st-ricevuta { background: rgba(234, 179, 8, .15); color: #fbbf24; }
.st-in_lavorazione, .st-colloquio { background: rgba(37, 99, 235, .2); color: #60a5fa; }
.st-confermata, .st-completata, .st-accettata { background: rgba(34, 197, 94, .15); color: #4ade80; }
.st-rifiutata, .st-respinta { background: rgba(239, 68, 68, .15); color: #f87171; }
.status-box { margin-top: 24px; border-top: 1px solid var(--nav-border); padding-top: 20px; display: grid; gap: 12px; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .93rem; }
.status-note { background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 14px 16px; font-size: .9rem; }
.status-note p { margin-top: 6px; white-space: pre-line; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-btn { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--nav-border); background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 500; font-size: .9rem; transition: all .2s; }
.tab-btn:hover { color: #fff; }
.tab-btn.on { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.app-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.item { padding: 14px 0; border-bottom: 1px solid var(--nav-border); display: grid; gap: 4px; font-size: .92rem; }
.item:last-child { border-bottom: none; }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-note { font-size: .85rem; color: #fbbf24; }
.item.unread { border-left: 3px solid var(--accent-blue); padding-left: 12px; }
.table-wrap { overflow-x: auto; background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--nav-border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td .cell-long { max-width: 320px; white-space: pre-line; color: var(--text-muted); font-weight: 300; }
td select, td input[type=text] { padding: 8px 10px; font-size: .82rem; border-radius: 8px; min-width: 130px; }
.admin-form { display: grid; gap: 14px; max-width: 640px; margin-bottom: 28px; background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 16px; padding: 24px; }

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-center { display: none; }
    .nav-burger { display: grid; }
    .sf-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .services-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 3.2rem; }
    .nav-logo { font-size: .8rem; padding-right: 12px; }
    .nav-area { padding: 9px 14px; font-size: .82rem; }
    .row-2 { grid-template-columns: 1fr; }
    .page-title, .section-title { font-size: 1.8rem; }
    .sf-grid { grid-template-columns: 1fr; }
    #new-news-banner { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (max-width: 480px) {
    .nav-logo span, .nav-left .nav-logo { font-size: 0; gap: 0; }
    .nav-left .nav-logo img { height: 34px; }
    .hero h1 { font-size: 2.5rem; letter-spacing: -1px; }
}
