/* ===================================
   ServiziWP Corsi — Main CSS
   Design System: AI Next Studio Dark
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500&display=swap');

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

:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #18181f;
  --border:    rgba(255,255,255,0.07);
  --cyan:      #00f5d4;
  --cyan-dim:  rgba(0,245,212,0.12);
  --cyan-glow: rgba(0,245,212,0.25);
  --text:      #e8e8f0;
  --text-muted:#8888a0;
  --text-dim:  #555568;
  --radius:    12px;
  --radius-lg: 20px;
  --font-head: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --max-w:     1200px;
  --header-h:  68px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.site-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-logo .logo-icon svg {
  width: 18px;
  height: 18px;
  fill: #0a0a0f;
}

.logo-by {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 2px;
  display: block;
  line-height: 1;
}

.logo-wrap { display: flex; flex-direction: column; gap: 2px; }
.logo-name { line-height: 1; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover { color: var(--text); background: var(--bg3); }
.site-nav a.active { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--cyan);
  color: #0a0a0f;
}
.btn-primary:hover {
  background: #00dfc0;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.btn-ghost {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.15); background: #1e1e28; }

.btn-sm { padding: 7px 14px; font-size: 13px; }

/* === HAMBURGER MOBILE === */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-muted); }

.footer-video-credit {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  margin-top: 12px;
  width: 100%;
  text-align: center;
}
.footer-video-credit a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-video-credit a:hover { color: var(--text-muted); }

/* === SEZIONE TITOLO === */
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 520px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 20px;
  flex-wrap: wrap;
}

/* === CARD BASE === */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* === NOTIFICHE === */
.notice {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid;
}
.notice-info { background: rgba(0,245,212,0.08); border-color: var(--cyan-dim); color: var(--cyan); }
.notice-error { background: rgba(255,80,80,0.08); border-color: rgba(255,80,80,0.2); color: #ff8080; }

/* === LOGIN MODAL === */
.lm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .2s;
}
.lm-overlay.lm-open { opacity: 1; }
.lm-overlay[hidden] { display: none; }

.lm-box {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  padding: 40px;
  width: 100%; max-width: 420px;
  position: relative;
  transform: translateY(16px); transition: transform .25s;
}
.lm-overlay.lm-open .lm-box { transform: translateY(0); }

.lm-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: all .2s;
}
.lm-close:hover { color: var(--text); border-color: rgba(255,255,255,.15); }

.lm-head { text-align: center; margin-bottom: 28px; }
.lm-logo {
  display: inline-flex; margin-bottom: 16px;
}
.lm-logo .logo-icon {
  width: 44px; height: 44px; background: var(--cyan);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.lm-logo .logo-icon svg { width: 24px; height: 24px; fill: #0a0a0f; }
.lm-title {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--text); letter-spacing: -.02em; margin-bottom: 8px;
}
.lm-sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.lm-error {
  background: rgba(255,80,80,.08); border: 1px solid rgba(255,80,80,.2);
  color: #ff8080; font-size: 13px; padding: 10px 14px;
  border-radius: 10px; margin-bottom: 16px;
}

.lm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lm-field label {
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .02em;
}
.lm-field input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
  outline: none; transition: border-color .2s; width: 100%;
}
.lm-field input:focus { border-color: rgba(0,245,212,.4); }
.lm-field input::placeholder { color: var(--text-dim); }

.lm-pwd-wrap { position: relative; }
.lm-pwd-wrap input { padding-right: 44px; }
.lm-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); transition: color .2s; padding: 4px;
}
.lm-eye:hover { color: var(--text-muted); }

.lm-submit {
  width: 100%; justify-content: center; margin-top: 8px;
  padding: 12px 20px; font-size: 15px; position: relative;
}

@keyframes lm-rotate { to { transform: rotate(360deg); } }
.lm-spin { animation: lm-rotate .8s linear infinite; }

/* === COOKIE BANNER === */
#ck-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  width: calc(100% - 40px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
  font-size: 13px;
  color: var(--text-muted);
}
#ck-banner.ck-vis { transform: translateX(-50%) translateY(0); }

#ck-banner p { flex: 1; margin: 0; }
#ck-banner p a { color: var(--cyan); }

.ck-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .section { padding: 56px 0; }

  .site-nav .nav-links { display: none; }
  .site-nav .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
  }
  .menu-toggle { display: flex; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* === PAGINE LEGALI === */
.legal-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}
.legal-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.legal-meta { font-size: 13px; color: var(--text-dim); }

.legal-layout { max-width: 760px; padding: 52px 0 88px; }

.legal-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}
.legal-content h2 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 44px 0 14px;
  padding-top: 44px;
  border-top: 1px solid var(--border);
}
.legal-content h2:first-of-type { border-top: none; margin-top: 24px; padding-top: 0; }
.legal-content h3 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}
.legal-content p { margin-bottom: 16px; color: var(--text-muted); }
.legal-content a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.legal-content a:hover { opacity: 0.8; }
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content ul { margin: 0 0 16px 20px; list-style: disc; }
.legal-content li { margin-bottom: 8px; color: var(--text-muted); }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
.legal-table th,
.legal-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  color: var(--text-muted);
}
.legal-table th {
  background: var(--bg3);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.legal-table code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

@media (max-width: 640px) {
  .legal-table { font-size: 12px; }
  .legal-table th, .legal-table td { padding: 8px 10px; }
}

/* === PAGE GENERICA === */
.page-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.page-hero-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.page-hero-meta {
  font-size: 13px;
  color: var(--text-dim);
}
.page-layout {
  max-width: 760px;
  padding: 48px 0 80px;
}
.page-content { font-size: 16px; line-height: 1.8; color: var(--text); }

/* === 404 === */
.nf-wrap {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 0;
}

/* Sfondo */
.nf-bg { position: absolute; inset: 0; pointer-events: none; }

.nf-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,245,212,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,212,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.nf-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.nf-glow-1 {
  width: 600px; height: 400px;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,245,212,0.09) 0%, transparent 70%);
}
.nf-glow-2 {
  width: 300px; height: 300px;
  bottom: 0; right: 10%;
  background: radial-gradient(ellipse, rgba(0,245,212,0.05) 0%, transparent 70%);
}

.nf-inner {
  position: relative;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Badge */
.nf-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  background: rgba(0,245,212,0.07);
  border: 1px solid rgba(0,245,212,0.2);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.05em;
  margin-bottom: 36px;
}

/* Numero 404 */
.nf-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  line-height: 1;
}

.nf-n {
  font-family: var(--font-head);
  font-size: clamp(80px, 14vw, 130px);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nf-zero {
  width: clamp(72px, 12vw, 116px);
  height: clamp(72px, 12vw, 116px);
  flex-shrink: 0;
  filter: drop-shadow(0 0 24px rgba(0,245,212,0.35));
}
.nf-zero svg { width: 100%; height: 100%; }

/* Testi */
.nf-title {
  font-family: var(--font-head);
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.nf-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

/* Bottoni */
.nf-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Link rapidi */
.nf-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  flex-wrap: wrap;
  justify-content: center;
}
.nf-links a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.nf-links a:hover { color: var(--cyan); }

@media (max-width: 640px) {
  .nf-wrap { padding: 60px 0; }
  .nf-actions { flex-direction: column; width: 100%; }
  .nf-actions .btn { justify-content: center; }
}
