:root {
    --bg: #0a0c0e;
    --bg1: #0e1114;
    --bg2: #13161a;
    --bg3: #1a1e23;
    --bg4: #22272d;
    --line: rgba(255, 255, 255, .06);
    --line2: rgba(255, 255, 255, .11);
    --text: #e9edf0;
    --muted: #8a939b;
    --dim: #5d656c;
    --accent: #e8262d;
    --accent-dim: rgba(232, 38, 45, .12);
    --accent-line: rgba(232, 38, 45, .38);
    --ok: #3ddc84;
    --warn: #ffc24a;
    --danger: #ff5f5f;
    --info: #5fb4ff;
    --radius: 12px;
    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    background: var(--bg);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--text); font-size: 14px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 12.5px; }
::selection { background: var(--accent-line); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .09); border-radius: 8px; }

/* ── bottoni ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line2);
    background: var(--bg3); font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg4); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.steam { background: #171d25; border-color: #2a475e; color: #c7d5e0; }
.btn.ok { background: rgba(61, 220, 132, .14); border-color: rgba(61, 220, 132, .4); color: var(--ok); }
.btn.warn { background: rgba(255, 194, 74, .12); border-color: rgba(255, 194, 74, .4); color: var(--warn); }
.btn.danger { background: rgba(255, 95, 95, .12); border-color: rgba(255, 95, 95, .4); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

/* ── landing ── */
.landing {
    min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
    background: radial-gradient(1000px 520px at 50% -12%, rgba(232, 38, 45, .18), transparent 62%), var(--bg);
}
.hero { width: min(760px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero img { width: 84px; height: 84px; filter: drop-shadow(0 10px 40px rgba(232, 38, 45, .35)); }
.hero h1 { font-size: 46px; font-weight: 800; letter-spacing: .22em; padding-left: .22em; }
.hero .tag { color: var(--muted); font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; margin: 18px 0 8px; }
.step { background: var(--bg1); border: 1px solid var(--line2); border-radius: var(--radius); padding: 16px 14px; text-align: left; }
.step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-line); font-size: 13px; margin-bottom: 10px; }
.step span { display: block; font-weight: 600; }
.step small { color: var(--muted); font-size: 12.5px; }
.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 13.5px; text-align: left; }
.alert.error { background: rgba(255, 95, 95, .08); border-color: rgba(255, 95, 95, .35); color: #ffb3b3; }
.alert.warn { background: rgba(255, 194, 74, .08); border-color: rgba(255, 194, 74, .35); color: #ffe0a3; }
.alert.ok { background: rgba(61, 220, 132, .08); border-color: rgba(61, 220, 132, .35); color: #a8f0c8; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr 1fr; } .hero h1 { font-size: 34px; } }

/* ── layout area riservata ── */
.topbar {
    position: sticky; top: 0; z-index: 20; height: 62px; padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
    background: rgba(10, 12, 14, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .16em; }
.brand img { width: 30px; height: 30px; }
.brand small { font-weight: 600; letter-spacing: .04em; color: var(--muted); font-size: 12px; padding: 2px 8px; border: 1px solid var(--line2); border-radius: 6px; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--bg3); }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg4); object-fit: cover; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.page { width: min(980px, 100%); margin: 0 auto; padding: 28px 20px 80px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--bg1); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; }
.card h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.check .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; }
.check.done .dot { background: rgba(61, 220, 132, .12); color: var(--ok); }
.check.todo .dot { background: rgba(255, 194, 74, .12); color: var(--warn); }
.check div { min-width: 0; flex: 1; }
.check b { display: block; font-size: 13.5px; }
.check small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .checks { grid-template-columns: 1fr; } }

/* ── moduli ── */
.apps { display: flex; flex-direction: column; gap: 12px; }
.app-card { border: 1px solid var(--line2); border-radius: 14px; background: var(--bg2); overflow: hidden; }
.app-card .head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.app-card .head h3 { font-size: 16px; }
.app-card .head .meta { color: var(--muted); font-size: 12.5px; }
.app-card .head .badge { margin-left: auto; }
.app-card .note { margin: 0 18px 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg3); border-left: 3px solid var(--line2); white-space: pre-wrap; }
.app-card .note b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.app-card.s-accepted .note { border-left-color: var(--ok); }
.app-card.s-rejected .note { border-left-color: var(--danger); }
.app-card.s-changes .note { border-left-color: var(--warn); }
.app-card .actions { padding: 0 18px 16px; display: flex; gap: 8px; }
.app-card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { color: var(--info); border-color: rgba(95, 180, 255, .35); background: rgba(95, 180, 255, .08); }
.badge.pending::before { animation: blink 1.4s infinite; }
.badge.accepted { color: var(--ok); border-color: rgba(61, 220, 132, .35); background: rgba(61, 220, 132, .08); }
.badge.rejected { color: var(--danger); border-color: rgba(255, 95, 95, .35); background: rgba(255, 95, 95, .08); }
.badge.changes { color: var(--warn); border-color: rgba(255, 194, 74, .35); background: rgba(255, 194, 74, .08); }
@keyframes blink { 50% { opacity: .3; } }

.empty { text-align: center; padding: 34px 10px; color: var(--muted); }

/* ── form ── */
.form { display: flex; flex-direction: column; gap: 22px; }
.form fieldset { border: 0; display: flex; flex-direction: column; gap: 14px; }
.form legend { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 680px) { .grid, .grid.three { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; gap: 8px; }
.field .hint .count.bad { color: var(--warn); }
input[type=text], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px;
    padding: 10px 12px; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
textarea.big { min-height: 260px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; text-align: center; padding: 10px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-weight: 600; }
.seg input { display: none; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-dim); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── staff ── */
.staff { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 62px); }
.staff .side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg1); }
.tabs { display: flex; gap: 4px; padding: 12px 12px 0; flex-wrap: wrap; }
.tabs button { padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button.active { background: var(--bg3); color: var(--text); border-color: var(--line2); }
.tabs button i { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 10px; background: var(--bg4); }
.tabs button[data-s=pending] i { background: var(--accent); color: #fff; }
.search { padding: 12px; border-bottom: 1px solid var(--line); }
.list { overflow-y: auto; flex: 1; }
.row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--bg2); }
.row.active { background: var(--bg3); box-shadow: inset 3px 0 0 var(--accent); }
.row .who { min-width: 0; flex: 1; }
.row .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who small { color: var(--muted); font-size: 12px; }
.row.flash { animation: rowflash 1.6s ease-out; }
@keyframes rowflash { 0% { background: var(--accent-dim); } 100% { background: transparent; } }
.detail { overflow-y: auto; min-height: 0; }
.detail .inner { padding: 26px 30px 120px; display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.detail h1 { font-size: 24px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv div { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kv small { display: block; color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.kv b { font-weight: 600; word-break: break-all; }
.text { white-space: pre-wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; line-height: 1.7; }
.qa { display: flex; flex-direction: column; gap: 10px; }
.qa .q { font-weight: 600; margin-bottom: 4px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline div { display: flex; gap: 10px; font-size: 13px; align-items: baseline; }
.timeline time { color: var(--dim); font-size: 12px; white-space: nowrap; }
.decision { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 18%); padding-top: 26px; }
.decision .box { background: var(--bg1); border: 1px solid var(--line2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.decision .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.placeholder { height: 100%; display: grid; place-items: center; color: var(--dim); }
@media (max-width: 900px) { .staff { grid-template-columns: 1fr; height: auto; } .staff .side { max-height: 50vh; } .kv { grid-template-columns: 1fr 1fr; } }

/* ── toast ── */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg3); border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 16px; max-width: 360px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: tin .25s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.error { border-left-color: var(--danger); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

/* ── percorso candidatura → colloquio → whitelist ── */
.track { display: flex; gap: 6px; padding: 0 18px 14px; }
.track span { flex: 1; font-size: 12px; font-weight: 600; color: var(--dim); padding-top: 8px; border-top: 3px solid var(--bg4); }
.track span.done { color: var(--ok); border-color: var(--ok); }
.track span.now { color: var(--info); border-color: var(--info); }
.track span.bad { color: var(--danger); border-color: var(--danger); }
.sheet { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.wizard .sheet { padding: 0; }
.sheet-block h4 { font-size: 13px; margin-bottom: 6px; color: var(--muted); font-weight: 600; }
.sheet .grid { gap: 14px; }

/* ── modulo a passaggi ── */
.wizard { display: flex; flex-direction: column; gap: 18px; padding-bottom: 90px; }
.wizard-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stepper li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg1); border: 1px solid var(--line2); cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.stepper li b { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--bg3); font-size: 12px; flex-shrink: 0; }
.stepper li.now { border-color: var(--accent-line); background: var(--accent-dim); color: var(--text); }
.stepper li.now b { background: var(--accent); color: #fff; }
.stepper li.done { color: var(--text); }
.stepper li.done b { background: rgba(61, 220, 132, .15); color: var(--ok); }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(5, 1fr); } .stepper li span { display: none; } .stepper li { justify-content: center; } }
.step-title { margin-bottom: 4px; }
.step-title h2 { font-size: 20px; }
.req { color: var(--accent); }
.field label { display: flex; align-items: center; gap: 6px; }
.info { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg3); color: var(--muted); font-size: 11px; font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: pointer; display: grid; place-items: center; }
.info:hover { color: var(--text); border-color: var(--accent-line); }
.help { font-size: 13px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; }
.help a, .confirm a { color: var(--accent); text-decoration: underline; }
.confirm { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line2); cursor: pointer; }
.confirm input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.bar {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30;
    width: min(940px, calc(100vw - 32px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: 16px; background: rgba(19, 22, 26, .92); backdrop-filter: blur(12px);
    border: 1px solid var(--line2); box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ── pagina linee guida ── */
.doc { width: min(820px, 100%); margin: 0 auto; padding: 40px 20px 90px; display: flex; flex-direction: column; gap: 18px; }
.doc h1 { font-size: 36px; font-weight: 800; }
.doc h2 { font-size: 19px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.doc h2 b { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-line); font-size: 13px; }
.doc p, .doc li { color: #c9d0d6; }
.doc ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.doc .no { color: var(--danger); font-weight: 600; }
.doc .yes { color: var(--ok); font-weight: 600; }
.badge.interview { color: #b78bff; border-color: rgba(183, 139, 255, .38); background: rgba(183, 139, 255, .09); }
.badge.interview::before { animation: blink 1.4s infinite; }
.badge.failed { color: var(--danger); border-color: rgba(255, 95, 95, .35); background: rgba(255, 95, 95, .08); }
.app-card.s-failed .note { border-left-color: var(--danger); }
.app-card.s-interview .note { border-left-color: #b78bff; }
.track span.now { color: #b78bff; border-color: #b78bff; }
.tabs button i.zero { background: var(--bg4) !important; color: var(--muted) !important; }
.tabs button[data-s=interview] i { background: #7c4dff; color: #fff; }
