/* student.css — area studente: allenamento e storico personale. */

.st-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 10px clamp(12px, 2vw, 22px);
  border-bottom: 1px solid var(--border); background: var(--header-bg); backdrop-filter: blur(12px);
}
.st-top .brand .logo { width: 30px; height: 30px; border-radius: 6px; }
.st-top > .row { flex-wrap: wrap; gap: 10px; }
.st-nav .brand { margin-right: 6px; }
/* Nome e classe: un riquadro alto quanto i pulsanti vicini. */
.st-user { align-items: stretch; }
.st-who {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: min(560px, 100%);
  padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.st-who b, .st-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-who b { flex: none; max-width: 100%; }
.st-who span { color: var(--muted); }
.st-who span:not(:empty)::before { content: "·"; margin-right: 10px; }
/* Ora del dispositivo, all'estrema destra, alta come i pulsanti. */
.st-user .system-clock { display: inline-flex; align-items: center; font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* La mia pagina: PIN a sinistra, avvisi a destra. */
.st-entry { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 12px; align-items: stretch; }
.st-pin, .st-notices { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.st-pin .st-sub, .st-notices .st-sub { margin: 0; }
.st-pin p { margin: 0; font-size: 0.85rem; }
.st-pin-row { display: flex; gap: 8px; }
.st-pin-row .input { flex: 1; min-width: 0; height: 46px; font-size: 1.25rem; letter-spacing: 0.16em; padding: 0 10px; }
.st-pin-row .btn { height: 46px; min-height: 0; padding-top: 0; padding-bottom: 0; }
.st-notices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-notice { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; line-height: 1.4; }
.st-notice.urgent { padding: 8px 10px; border: 1px solid var(--brand-1); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--brand-1) 16%, transparent); }
.st-notice .btn { min-height: 0; padding: 6px 12px; text-decoration: none; }
/* Avvisi del docente: data e ora, poi il testo con i suoi a capo. */
.st-notices ul { max-height: 260px; overflow-y: auto; }
.st-notice.posted { display: block; padding-top: 8px; border-top: 1px solid var(--border); }
.st-notice.posted time { display: block; font-size: 0.78rem; }
.st-notice.posted span { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .st-entry { grid-template-columns: 1fr; }
  .st-nav .brand .name { display: none; }
  .st-who { max-width: 100%; }
}
.st-main { flex: 1; display: flex; flex-direction: column; }
.st-login { width: min(440px, 100%); padding: clamp(24px, 5vw, 36px); text-align: center; }
.st-login h1 { font-size: 1.5rem; margin-bottom: 6px; }

.st-sub { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 26px 0 10px; }

/* Libreria di allenamento */
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.st-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border: 1px solid var(--border); background: var(--surface);
}
.st-card .t { font-weight: 700; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.st-card .s { color: var(--muted); font-size: 0.85rem; }
.st-card .btn { margin-top: auto; }
/* Stato personale dell'allenamento e novità delle ultime due settimane. */
.st-state { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.st-state.done { color: var(--good); }
.st-new { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--brand-1); color: var(--on-brand); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* Storico (tabella compatta) */
.st-history { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; background: var(--report-bg); }
.st-history th { text-align: left; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px; border-bottom: 1px solid var(--border-strong); background: var(--report-head-bg); }
.st-history td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.st-history td.center, .st-history th.center { text-align: center; }
.st-history tbody tr { cursor: pointer; }
.st-history tbody tr:hover td { background: var(--report-hover-bg); }
.st-history td:first-child, .st-history td.center { white-space: nowrap; }

/* Pratica: domande e opzioni */
/* Spazio tra le istruzioni sotto il titolo e la prima domanda. */
#pracHint { margin: 4px 0 20px; }
.pq { border: 1px solid var(--border); background: var(--surface); padding: 14px 16px; margin-bottom: 12px; }
.pq .qh { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.pq .qn { font-family: ui-monospace, monospace; color: var(--muted); font-weight: 700; }
.pq .qt { font-weight: 600; line-height: 1.35; white-space: pre-wrap; }
.pq .qkind { color: var(--brand-1); font-size: 0.82rem; font-weight: 700; margin: 4px 0 10px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border-strong); background: var(--option-bg);
  color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1.3;
}
/* Segno della risposta, come in un modulo e senza i colori della partita: tondo vuoto dove si
   sceglie una sola risposta (pulsante di opzione), quadrato vuoto dove se ne possono scegliere
   più (casella). La scelta lo riempie con la spunta. */
.opt .g {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center; line-height: 1;
  border: 2px solid var(--border-strong); background: transparent; font-size: 0.95rem; font-weight: 900;
}
.opts.single .opt .g { border-radius: 50%; }
.opts.multi .opt .g { border-radius: 3px; }
.opt .lbl { flex: 1; }
.opt.sel { border-color: var(--brand-1); background: var(--report-selected-bg); }
.opt.sel .g { background: var(--brand-1); border-color: var(--brand-1); color: var(--on-brand); }
.opt.sel .g::after { content: "✓"; }
.pq .qkind { font-size: 0.92rem; }
/* Tema originale (Aurora): su fondo scuro la scelta risaltava poco. Fondo viola più
   carico, bordo doppio, testo pieno e spunta scura nel segno bianco. */
:root:not([data-theme]) .opt.sel, :root[data-theme="original"] .opt.sel {
  border-color: var(--brand-1); box-shadow: inset 0 0 0 2px var(--brand-1);
  background: color-mix(in srgb, var(--brand-1) 42%, transparent); color: #fff; font-weight: 600;
}
:root:not([data-theme]) .opt.sel .g, :root[data-theme="original"] .opt.sel .g { background: #fff; border-color: #fff; color: #1d0f52; }
/* Stati in revisione risultato */
.opt.correct { border-color: var(--good); background: var(--report-correct-bg); }
.opt.correct::after { content: "✓"; color: var(--good); font-weight: 900; }
.opt.wrong { border-color: var(--bad); background: var(--report-incorrect-bg); }
.opt.wrong::after { content: "✕"; color: var(--bad); font-weight: 900; }
.opt.disabled { cursor: default; }

/* Restituzione delle risposte, opzione per opzione:
   - giusta: in evidenza (anche se non scelta, con bordo tratteggiato);
   - scelta ma sbagliata: segnata in rosso;
   - né giusta né scelta: in grigio, perché non conta. */
.opt.correct { font-weight: 600; box-shadow: inset 0 0 0 1px var(--good); }
.opt.correct.missed { border-style: dashed; box-shadow: none; }
.opt.neutral { opacity: 0.45; background: transparent; border-color: var(--border); }
/* Nella restituzione il segno è pieno dove lo studente ha scelto: verde se giusta, rosso se sbagliata. */
.opt.correct:not(.missed) .g { background: var(--good); border-color: var(--good); }
.opt.correct.missed .g { border-color: var(--good); }
.opt.wrong .g { background: var(--bad); border-color: var(--bad); }
.opt-tag { flex: none; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.opt.correct .opt-tag { color: var(--good); }
.opt.wrong .opt-tag { color: var(--bad); }
.pq-outcome { flex: none; margin-left: auto; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.pq-outcome.ok { color: var(--good); }
.pq-outcome.no { color: var(--bad); }
@media (max-width: 520px) { .opt.disabled { flex-wrap: wrap; } .opt.disabled .lbl { flex-basis: calc(100% - 80px); } }

/* Riepilogo risultato */
.st-summary { display: flex; flex-wrap: wrap; gap: 20px; margin: 10px 0 18px; align-items: baseline; }
.st-summary .big { font-family: var(--f-display, inherit); font-weight: 900; font-size: 2rem;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.st-summary .lab { color: var(--muted); font-size: 0.85rem; }
