:root {
  --bg: #f5f8fd;
  --surface: #ffffff;
  --surface-2: #f0f5fc;
  --line: #dde6f3;
  --text: #0f1b2d;
  --muted: #5c6b82;
  --accent: #1f6feb;
  --accent-2: #3b8cff;
  --accent-soft: #e6f0ff;
  --ok: #138a52;
  --ok-soft: #e3f6ec;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --danger: #c93c37;
  --danger-soft: #fde8e7;
  --shadow: 0 18px 48px -24px rgba(16, 52, 112, .28);
  --radius: 18px;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* aloni blu in movimento, come nel programma */
.halos { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.halos i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.halos i:nth-child(1) { width: 520px; height: 520px; background: #cfe2ff; left: -120px; top: -140px; }
.halos i:nth-child(2) { width: 420px; height: 420px; background: #dbeaff; right: -100px; top: 120px; animation-duration: 28s; }
.halos i:nth-child(3) { width: 380px; height: 380px; background: #e5f0ff; left: 35%; bottom: -160px; animation-duration: 34s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .halos i, .reveal { animation: none !important; } }

.wrap { position: relative; z-index: 1; width: min(1120px, 100% - 32px); margin: 0 auto; }

/* intestazione */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand b { display: block; font-size: 19px; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; }
.admin-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 6px 10px; border-radius: 999px; border: 1px solid transparent; transition: .2s; }
.admin-link:hover { border-color: var(--line); background: var(--surface); color: var(--text); }
.admin-link svg { width: 13px; height: 13px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; padding: 34px 0 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(31, 111, 235, .18); }
h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.08; margin: 18px 0 14px; letter-spacing: -1px; }
h1 span { background: linear-gradient(90deg, var(--accent), #5aa2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0 0 26px; }
.hero-art { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .flow { stroke-dasharray: 2 9; animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -11; } }

/* pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 11px 18px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { border-color: #c4d4ea; box-shadow: 0 8px 22px -14px rgba(16, 52, 112, .45); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: var(--accent); color: #fff; }
.btn.primary:hover { box-shadow: 0 12px 26px -12px rgba(31, 111, 235, .7); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* schede */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card h2, .card h3 { margin: 0 0 6px; }
.card .muted, .muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.section { padding: 26px 0; }
.section > h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.3px; }
.section > p.muted { margin: 0 0 20px; }

.dl-card { display: flex; flex-direction: column; gap: 14px; }
.dl-card .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.dl-card .icon svg { width: 24px; height: 24px; }
.dl-card .meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; font-size: 12.5px; color: var(--muted); }
.hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--muted); word-break: break-all; }

.steps { counter-reset: s; display: grid; gap: 14px; }
.steps li { list-style: none; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.steps { padding: 0; margin: 0; }
.steps b { display: block; }

.timeline { display: grid; gap: 12px; }
.release { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: start; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.release .v { font-weight: 700; font-size: 17px; }
.release .date { color: var(--muted); font-size: 12.5px; }
.release .notes { white-space: pre-line; color: var(--text); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.grey { background: var(--surface-2); color: var(--muted); }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; color: #9db8e0; margin-bottom: 10px; }

footer { color: var(--muted); font-size: 13px; padding: 34px 0 40px; text-align: center; }

/* comparsa */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.reveal.d1 { animation-delay: .08s; } .reveal.d2 { animation-delay: .16s; } .reveal.d3 { animation-delay: .24s; } .reveal.d4 { animation-delay: .32s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* moduli */
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 10px 12px; font-weight: 500; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(59, 140, 255, .16); }
textarea { resize: vertical; min-height: 84px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* tabelle */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fbff; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* barra di avanzamento */
.progress { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; }

/* notifiche */
.toast-host { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); animation: rise .3s ease forwards; max-width: 360px; }
.toast.err { background: var(--danger); }

/* finestra modale */
.modal-back { position: fixed; inset: 0; background: rgba(15, 27, 45, .38); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fade .2s ease; }
.modal { width: min(520px, 100%); background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(10, 30, 70, .55); padding: 26px; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal .btn-row { justify-content: flex-end; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

@media (max-width: 860px) {
  .hero, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .release { grid-template-columns: 1fr; gap: 8px; }
  .hero-art { order: -1; }
}
.btn.disabled { opacity: .45; pointer-events: none; }
.steps span { display: block; font-size: 13.5px; }
[hidden] { display: none !important; }
