:root {
  --navy: #091421; --navy2: #142131; --red: #EF4444; --redD: #C81E1E; --green: #39D353; --greenD: #1F9D3A;
  --ink: #101828; --gray: #475467; --line: #D0D5DD; --tint: #F5F8FC; --bg: #EEF2F7; --white: #fff;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Calibri, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.45; }
.top { background: var(--navy); color: #fff; border-bottom: 4px solid var(--green); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.top img { height: 38px; width: auto; display: block; }
.top .tag { font-size: 13px; letter-spacing: 1px; color: var(--green); text-transform: uppercase; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
main { padding: 24px 0 64px; }
h1 { font-size: 28px; margin: 0 0 6px; color: var(--navy); line-height: 1.2; }
h2 { font-size: 21px; margin: 28px 0 10px; color: var(--navy); }
.sub { color: var(--gray); margin: 0 0 18px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.fact { background: var(--tint); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fact b { display: block; font-size: 22px; color: var(--navy); }
.fact span { font-size: 13px; color: var(--gray); }
label { display: block; font-weight: bold; margin: 12px 0 4px; font-size: 15px; }
label .opt { font-weight: normal; color: var(--gray); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=date], select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, .opt-row:focus-within { outline: 3px solid rgba(47,128,237,.35); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; margin-top: 16px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
a { color: #1D5FC2; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 12px 20px; font: inherit; font-weight: bold; cursor: pointer; background: var(--navy); color: #fff; text-decoration: none; }
.btn:hover { background: var(--navy2); }
.btn.green { background: var(--greenD); }
.btn.red { background: var(--redD); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.msg.err { background: #FDECEC; color: var(--redD); border: 1px solid #F5B5B5; }
.msg.ok { background: #E9F9EE; color: #14532D; border: 1px solid #A7E3B8; }
.msg.info { background: var(--tint); color: var(--ink); border: 1px solid var(--line); }
.hidden { display: none !important; }

/* barra di avanzamento */
.progress { position: sticky; top: 0; z-index: 5; background: var(--white); border-bottom: 1px solid var(--line); }
.progress .wrap { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; font-size: 15px; }
.bar { flex: 1; height: 8px; background: var(--tint); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--greenD); transition: width .2s; }

/* domande */
fieldset.q { margin: 0 0 14px; min-width: 0; }
.q { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.q.missing { border-color: var(--red); box-shadow: 0 0 0 2px rgba(239,68,68,.15); }
.q h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.35; }
.q h3 .n { display: inline-block; min-width: 34px; height: 34px; line-height: 34px; text-align: center; border-radius: 50%; background: var(--navy); color: var(--green); font-size: 15px; margin-right: 8px; }
.opt-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-weight: normal; font-size: 16px; }
.opt-row:hover { background: var(--tint); }
.opt-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.opt-row .l { font-weight: bold; color: var(--navy); min-width: 18px; }
.opt-row.sel { border-color: var(--navy); background: var(--tint); }

/* risultato */
.result { text-align: center; padding: 30px 20px; }
.result .big { font-size: 56px; font-weight: bold; color: var(--navy); line-height: 1; }
.badge { display: inline-block; padding: 6px 14px; border-radius: 99px; font-weight: bold; margin-top: 12px; }
.badge.pass { background: #E9F9EE; color: var(--greenD); }
.badge.fail { background: #FDECEC; color: var(--redD); }
.corr { border-left: 0; }
.corr .ok { color: var(--greenD); font-weight: bold; }
.corr .ko { color: var(--redD); font-weight: bold; }
.corr p { margin: 4px 0; }
.small { font-size: 14px; color: var(--gray); }

/* area docente */
table { border-collapse: collapse; width: 100%; background: #fff; }
th { text-align: left; background: var(--navy); color: #fff; padding: 8px 10px; font-size: 14px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: bold; }
.pill.open { background: #E9F9EE; color: var(--greenD); }
.pill.closed { background: #EEF0F3; color: var(--gray); }
.pill.pass { background: #E9F9EE; color: var(--greenD); }
.pill.fail { background: #FDECEC; color: var(--redD); }
.mini { height: 10px; background: var(--tint); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; min-width: 90px; }
.mini i { display: block; height: 100%; background: var(--greenD); }
.mini i.low { background: var(--red); }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: Consolas, monospace; font-size: 14px; word-break: break-all; }
.sess { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.sess h3 { margin: 0 0 4px; font-size: 18px; }
footer { text-align: center; color: var(--gray); font-size: 13px; padding: 24px 0; }
.mt { margin-top: 12px; }
td.ok { font-weight: bold; color: var(--greenD); }
.card > h2:first-child { margin-top: 0; }
.btn.small { color: #fff; font-size: 14px; }
.btn.ghost.small { color: var(--navy); }
.linkbox .btn { font-family: Calibri, "Segoe UI", Arial, sans-serif; flex: none; }
.linkbox span { flex: 1; }
.wrap.wide .facts { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.courses { display: grid; gap: 10px; margin-top: 14px; }
.course { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); color: var(--ink); text-decoration: none; }
.course:hover, .course:focus-visible { border-color: var(--navy); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(47,128,237,.25); }
.course b { display: block; font-size: 18px; color: var(--navy); }
.course span { font-size: 14px; color: var(--gray); }
.tests td .btn { margin: 2px 4px 2px 0; }
.pill.up { background: #EAF2FE; color: #1D5FC2; }
.pill.std { background: #EEF0F3; color: var(--gray); }
.course.sel { border-color: var(--greenD); background: #E9F9EE; box-shadow: 0 0 0 2px rgba(31,157,58,.25); }
#c-code, #code { text-transform: uppercase; letter-spacing: 2px; font-family: Consolas, monospace; }
