/* ===== Accesso visitatori, installazione app ===== */
.guest-only { display: none !important; }
body.guest .guest-only { display: flex !important; }

/* ===== Istanze: scuola (logo e nome) e demo ===== */
body.demo .reg-only { display: none !important; }
.instance-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; max-width: 260px; flex: none; }
.instance-badge img { width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.instance-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-banner { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: var(--accent); color: #1c1c1c; font-size: .9rem; text-align: center; }
.demo-banner b { text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; background: #1c1c1c; color: var(--accent); padding: 2px 8px; border-radius: 999px; }
.lp-school-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; padding: 4px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.auth-logo img { width: 88px; height: 88px; }
.auth-logo { flex-direction: column; align-items: center; gap: 6px; }
.auth-logo small { font-size: .82rem; text-align: center; max-width: 320px; }
.demo-accounts { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; text-align: left; }
.demo-accounts-title { margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.demo-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.demo-account div { display: flex; flex-direction: column; }
.demo-account small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.demo-account code { font-size: .82rem; background: var(--surface-2); padding: 0 5px; border-radius: 5px; }
.demo-or { text-align: center; margin: 10px 0 0; }
.lp-demo-box { margin-top: 20px; max-width: 460px; }
.lp-demo-box .demo-accounts-title { color: rgba(255,255,255,.8); }
.guest-nav { margin-left: auto; align-items: center; gap: 14px; }
.guest-nav a:not(.btn) { color: #fff; text-decoration: none; font-weight: 600; opacity: .9; }
.guest-nav a:not(.btn):hover { opacity: 1; text-decoration: underline; }
.btn-accent { background: var(--accent) !important; color: #1c1c1c !important; }
.btn-ghost-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
[data-install][hidden] { display: none !important; }

/* Pulsante "Installa l'app" nella barra in alto, presente in ogni pagina */
.install-top {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.install-top:hover { background: var(--accent); border-color: var(--accent); color: #1c1c1c; }
.install-top svg { width: 18px; height: 18px; }

/* Finestra con le istruzioni di installazione */
.install-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 22px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.install-dialog::backdrop { background: rgba(8, 30, 20, .55); }
.install-dialog-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.install-dialog-head svg { width: 48px; height: 48px; flex: none; }
.install-dialog-head h2 { margin: 0; font-size: 1.3rem; }
.install-dialog-head p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.install-dialog h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.install-dialog h4 { margin: 14px 0 8px; font-size: .95rem; }
.install-dialog details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.install-dialog summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.install-steps { list-style: none; counter-reset: istep; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { counter-increment: istep; position: relative; padding-left: 34px; line-height: 1.45; }
.install-steps li::before { content: counter(istep); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: #7a5a00; font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
:root[data-theme="dark"] .install-steps li::before { color: var(--accent); }
.install-steps.small li { font-size: .9rem; }
.footer-links { margin-top: 6px !important; }

/* ===== Pagina di presentazione ===== */
.landing { display: flex; flex-direction: column; gap: 56px; max-width: 1180px; margin: 0 auto; width: 100%; }
.lp-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center;
  padding: 56px; border-radius: 28px; color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(242,183,5,.28), transparent 40%), linear-gradient(135deg, #0f5132 0%, #0b3d26 60%, #08301e 100%);
}
.lp-hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); left: -160px; bottom: -220px; }
.lp-hero-text { position: relative; }
.lp-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 14px; }
.lp-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; letter-spacing: -.01em; margin-bottom: 18px; }
.lp-hero h1 span { color: var(--accent); }
.lp-lead { font-size: 1.12rem; opacity: .92; max-width: 560px; margin: 0 0 26px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-cta .btn { padding: 13px 22px; font-size: 1rem; }
.lp-install-inline { margin-top: 16px; display: flex; gap: 12px; align-items: center; }
.lp-link-light { color: #fff !important; opacity: .85; }
.lp-hero-visual { position: relative; display: flex; justify-content: center; min-height: 380px; }
.lp-phone {
  width: 270px; padding: 14px; border-radius: 34px; background: var(--bg); color: var(--ink);
  box-shadow: 0 30px 60px rgba(0,0,0,.35), 0 0 0 8px rgba(255,255,255,.08); transform: rotate(-3deg);
  display: flex; flex-direction: column; gap: 10px;
}
.lp-phone-bar { display: flex; align-items: center; gap: 8px; background: #0f5132; color: #fff; border-radius: 18px; padding: 10px 12px; }
.lp-phone-bar svg { width: 22px; height: 22px; }
.lp-phone-bar b span { color: var(--accent); }
.lp-mini { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: .8rem; display: flex; flex-direction: column; gap: 4px; }
.lp-mini small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.lp-mini b { font-size: .88rem; line-height: 1.3; }
.lp-mini ol { margin: 2px 0 0; padding-left: 18px; color: var(--muted); }
.lp-mini .tag { align-self: flex-start; font-size: .7rem; }
.lp-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.lp-bar i { display: block; height: 100%; width: 80%; background: var(--brand); }
.lp-float {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px;
  background: #fff; color: #17221d; font-size: .82rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.lp-float svg { width: 20px; height: 20px; color: #0f5132; }
.lp-float-doc { left: -14px; bottom: -6px; }
.lp-float-ok { right: -18px; top: -8px; }

.lp-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: -24px; }
.lp-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; text-align: center; box-shadow: var(--shadow); }
.lp-stats b { display: block; font-size: 2.1rem; color: var(--brand); line-height: 1.1; }
.lp-stats span { color: var(--muted); font-size: .9rem; }

.lp-head { text-align: center; max-width: 720px; margin: 0 auto 28px; }
.lp-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.lp-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.lp-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.lp-ico svg { width: 26px; height: 26px; }
.lp-ico-accent { background: var(--accent-soft); color: #7a5a00; }
:root[data-theme="dark"] .lp-ico-accent { color: var(--accent); }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-feature { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s ease, box-shadow .15s ease; }
.lp-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lp-feature h3 { margin: 6px 0 0; font-size: 1.15rem; }
.lp-feature p { margin: 0; color: var(--muted); }

.lp-band { background: var(--surface-2); border-radius: 28px; padding: 44px; }
.lp-audience { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.lp-aud { display: flex; gap: 16px; background: var(--surface); border-radius: 18px; padding: 20px; border: 1px solid var(--line); }
.lp-aud h3 { margin: 0 0 4px; font-size: 1.08rem; }
.lp-aud p { margin: 0; color: var(--muted); font-size: .95rem; }

.lp-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-steps li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 56px 22px 22px; display: flex; flex-direction: column; gap: 6px; }
.lp-steps li::before { content: counter(step); position: absolute; top: 18px; left: 22px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
:root[data-theme="dark"] .lp-steps li::before { color: #0b1a13; }
.lp-steps b { font-size: 1.1rem; }
.lp-steps span { color: var(--muted); }
.lp-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lp-roles div { border-left: 4px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; }
.lp-roles span { color: var(--muted); font-size: .92rem; }

/* Sezione "Installala sul tuo dispositivo" */
.lp-install {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; padding: 40px;
  background: radial-gradient(circle at 100% 0%, rgba(242,183,5,.22), transparent 45%), linear-gradient(160deg, var(--accent-soft) 0%, var(--surface) 55%);
}
.lp-install-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; margin-bottom: 28px; }
.lp-install-intro { display: flex; flex-direction: column; gap: 10px; }
.lp-install-intro h2 { margin: 6px 0 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.lp-install-intro p { margin: 0; color: var(--muted); max-width: 560px; }
.lp-perks { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-perks li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.lp-perks svg { width: 16px; height: 16px; color: var(--brand); }
.lp-install-cta { display: flex; justify-content: flex-end; }
.lp-cta-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lp-cta-card small { color: var(--muted); }
.lp-big-btn { padding: 14px 22px !important; font-size: 1.05rem !important; justify-content: center; }
.lp-installed { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.lp-installed svg { width: 24px; height: 24px; color: var(--brand); flex: none; }
.lp-cta-hint b { font-size: 1.1rem; }
.lp-cta-hint span { color: var(--muted); }

.lp-platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-platform { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; transition: border-color .15s ease, box-shadow .15s ease; }
.lp-platform.is-current { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.lp-platform header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lp-platform header svg { width: 26px; height: 26px; color: var(--brand); flex: none; }
.lp-platform h3 { margin: 0; font-size: 1.08rem; }
.lp-you { display: none; margin-left: auto; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.lp-platform.is-current .lp-you { display: inline-block; }
.lp-platform ol { list-style: none; counter-reset: pstep; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lp-platform li { counter-increment: pstep; position: relative; padding-left: 34px; font-size: .95rem; line-height: 1.45; }
.lp-platform li::before {
  content: counter(pstep); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: #7a5a00; font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
:root[data-theme="dark"] .lp-platform li::before { color: var(--accent); }
.lp-key { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; line-height: 1; vertical-align: middle; }
.lp-key svg { width: 15px; height: 15px; }

.lp-final { text-align: center; background: #0f5132; color: #fff; border-radius: 28px; padding: 48px 28px; }
.lp-final h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.lp-final > p { opacity: .9; margin: 0 0 22px; }
.lp-final .lp-cta { justify-content: center; }
.lp-final .lp-note { font-size: .82rem; opacity: .75; margin: 24px auto 0; max-width: 640px; }
.lp-note a { color: #fff; }

.privacy h2 { margin-top: 1.6em; font-size: 1.2rem; }

/* Ritorno alla pagina di presentazione dalle pagine di accesso */
.auth-back {
  display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 8px -8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none;
}
.auth-back:hover { background: var(--brand-soft); color: var(--brand); }
.auth-back svg { width: 16px; height: 16px; }
.privacy-check a { color: var(--brand); }

@media (max-width: 1000px) {
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  .lp-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .landing { gap: 36px; }
  .lp-hero { grid-template-columns: 1fr; padding: 30px 22px; border-radius: 22px; }
  .lp-hero-visual { min-height: 0; }
  .lp-phone { transform: none; width: 100%; max-width: 300px; }
  .lp-float { display: none; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .lp-stats div:last-child { grid-column: 1 / -1; }
  .lp-features, .lp-audience, .lp-steps, .lp-roles { grid-template-columns: 1fr; }
  .lp-band, .lp-install { padding: 26px 18px; border-radius: 22px; }
  .lp-install-top { grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }
  .lp-install-cta { justify-content: stretch; }
  .lp-cta-card { max-width: none; }
  .lp-platforms { grid-template-columns: 1fr; }
  .lp-platform.is-current { order: -1; }
  .lp-final { border-radius: 22px; }
  .guest-nav { gap: 10px; }
  .install-top { padding: 0; width: 40px; justify-content: center; }
  .install-top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .guest-nav a:first-child { display: none; }
  .instance-badge { padding: 0; background: none; }
  .instance-badge span { display: none; }
  .demo-banner { font-size: .82rem; padding: 6px 12px; }
  .lp-school-logo { width: 76px; height: 76px; }
}
@media print {
  .landing .lp-hero-visual { display: none; }
}
