:root {
  color-scheme: dark;
  --page: #191c20;
  --nav: #202428;
  --hero: #24292e;
  --surface: #252a2f;
  --input: #1d2226;
  --line: #454d55;
  --line-soft: #343a40;
  --text: #e9ecef;
  --muted: #adb5bd;
  --subtle: #87919b;
  --info: #5c728f;
  --info-hover: #6e85a3;
  --success: #29c830;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { min-height: 100vh; margin: 0; background: var(--page); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: #a9c8ed; }
[hidden] { display: none !important; }
.container { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
:focus-visible { outline: 3px solid rgba(146, 191, 242, .7); outline-offset: 3px; }
.site-header { background: var(--nav); border-bottom: 1px solid #32383e; }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 57px; }
.brand { flex: none; color: #f8f9fa; font-size: 19px; font-weight: 500; white-space: nowrap; }
.brand strong { font-weight: 700; }
.main-nav { display: flex; align-self: stretch; align-items: center; }
.nav-link { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; background: rgba(255, 255, 255, .045); color: #fff; text-decoration: none; font-size: 14px; }
.offline-label { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: #b7c0c7; font-size: 12px; white-space: nowrap; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(41, 200, 48, .12); }
.hero { background: var(--hero); border-bottom: 1px solid #30363b; }
.hero-inner { display: grid; align-content: center; justify-items: center; min-height: 188px; padding-block: 45px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(36px, 5vw, 50px); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.hero-subtitle { margin: 10px 0 0; color: #a8b2ba; font-size: 14px; }
.main-content { min-height: calc(100vh - 310px); padding-block: 48px 88px; }
.start-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 36px; padding: 21px 24px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface); }
.start-card .eyebrow { margin-bottom: 7px; }
.start-card h2 { font-size: 20px; }
.start-card p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.start-card code { color: var(--text); }
.start-card .button { flex: none; }
.submit-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(350px, 1.2fr); gap: 48px; align-items: start; }
.intro-panel { padding-top: 9px; }
.eyebrow { margin: 0 0 12px; color: #96a9bb; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
h2 { margin: 0; font-size: 25px; font-weight: 500; }
.steps { display: grid; gap: 24px; margin: 29px 0 31px; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; color: #d8dee3; font-size: 14px; line-height: 1.6; }
.steps strong { color: #fff; font-weight: 600; }
.step-number { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #57616a; border-radius: 5px; color: #c5d5e3; font-size: 11px; font-weight: 700; }
.side-note { max-width: 390px; padding: 15px 17px; border-left: 3px solid #6e85a3; background: #252c33; color: #bfcbd5; font-size: 12px; line-height: 1.6; }
.upload-panel { padding: 28px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 40px rgba(0, 0, 0, .12); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 23px; }
.panel-heading .eyebrow { margin-bottom: 8px; }
.format-badge { padding: 6px 8px; border: 1px solid #5c6670; border-radius: 4px; color: #bfcbd5; font: 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.drop-zone { position: relative; display: grid; justify-items: center; gap: 9px; min-height: 210px; padding: 27px 18px 23px; border: 1px dashed #6d7983; border-radius: 5px; background: var(--input); color: #a9baca; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.is-dragging, .drop-zone:focus-within { border-color: #9bb9d9; background: #25313c; }
.drop-zone strong { color: #e5eef5; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.drop-zone span { font-size: 12px; }
.drop-zone .file-limit { margin-top: 2px; color: var(--subtle); font-size: 11px; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-preview { margin: 20px 0 0; border: 1px solid var(--line-soft); border-radius: 5px; overflow: hidden; }
.file-preview div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.file-preview div:last-child { border-bottom: 0; }
.file-preview dt { color: var(--muted); }
.file-preview dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.feedback { margin: 14px 0; min-height: 18px; font-size: 12px; line-height: 1.45; }
.feedback.error { padding: 10px 12px; border: 1px solid #a8545d; border-radius: 5px; background: #4b2a2e; color: #ffd2d6; }
.feedback.info { color: #bed4e9; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 5px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.button-primary { background: var(--info); }
.button-primary:hover:not(:disabled) { background: var(--info-hover); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-outline { border-color: #747e87; background: transparent; color: #e1e5e8; }
.button-outline:hover { background: #3b4249; }
.submit-button { width: 100%; min-height: 43px; }
.receipt { display: flex; gap: 15px; margin-top: 22px; padding: 18px; border: 1px solid #428a50; border-radius: 5px; background: #24452d; color: #d9f3dc; }
.receipt-icon { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #59d16a; color: #14351a; font-weight: 800; }
.receipt h3 { margin: 0 0 7px; font-size: 16px; }
.receipt p { margin: 5px 0; font-size: 12px; line-height: 1.5; }
.receipt-code strong { font: 700 17px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.receipt-details { color: #c4e5c9; }
.site-footer { border-top: 1px solid #30363b; background: #1b1f23; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 20px; color: #8c969f; font-size: 11px; }

/* Il pannello docenti usa gli stessi colori del sito di consegna. */
.admin-content { padding-top: 30px; }
.admin-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 20px; color: #d7e0e7; font-size: 14px; }
.admin-actions span { color: var(--muted); font-size: 12px; }
.admin-back { margin: 0 0 18px; font-size: 13px; }
.admin-summary { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.admin-stats > div { display: grid; gap: 5px; min-width: 150px; padding: 15px 18px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface); }
.admin-stats span { color: var(--muted); font-size: 11px; }
.admin-stats strong { font-size: 20px; font-weight: 600; }
.results-card { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface); }
.table-scroll { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.results-table th { padding: 12px 16px; border-bottom: 1px solid var(--line); color: #d6dce1; font-weight: 600; white-space: nowrap; }
.results-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: #d3d9de; vertical-align: top; }
.results-table tr:last-child td { border-bottom: 0; }
.results-table code { color: #c5e5cb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.results-table small { color: var(--subtle); }
.results-table .empty-row { padding: 30px 16px; color: var(--muted); text-align: center; }
.admin-valid { color: #95e6a1; }
.admin-invalid { color: #ffaab0; }

@media (max-width: 780px) {
  .start-card { align-items: flex-start; flex-direction: column; }
  .submit-layout { grid-template-columns: 1fr; gap: 28px; }
  .intro-panel { padding-top: 0; }
  .steps { gap: 14px; margin: 20px 0; }
  .side-note { max-width: none; }
}
@media (max-width: 520px) {
  .container { width: min(100% - 28px, 1100px); }
  .header-inner { min-height: 54px; gap: 12px; }
  .brand { font-size: 17px; }
  .nav-link { padding: 0 9px; font-size: 12px; }
  .hero-inner { min-height: 148px; padding-block: 30px; }
  .hero h1 { font-size: 35px; }
  .main-content { padding-block: 26px 50px; }
  .start-card { margin-bottom: 28px; padding: 18px; }
  .start-card .button { width: 100%; }
  .upload-panel { padding: 20px; }
  .admin-actions { align-items: flex-start; flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 5px; }
}
