/* Escola virtual — protótipo 01. Regras visuais em design.md (raiz do repositório). Tema claro. */

:root {
  --page: var(--zl-ink-50);
  --radius: 12px;
  --shadow: 0 4px 16px rgb(20 15 38 / 0.08);
  --side-w: 240px;
  --ok: var(--zl-success);
  --half: var(--zl-warning);
  --bad: var(--zl-danger);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--zl-text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 500; font-size: 14px; margin-bottom: 8px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--zl-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--zl-focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--zl-text-muted); }
.hint { color: var(--zl-ink-500); font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  padding: 8px 16px; border-radius: 8px;
  background: var(--zl-accent); color: var(--zl-on-accent); font-weight: 500;
}
.skip-link:focus { top: 8px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 8px;
  font-weight: 500; font-size: 15px; white-space: nowrap;
  background: transparent; color: var(--zl-text);
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--zl-accent); color: var(--zl-on-accent); }
.btn-primary:hover { background: var(--zl-accent-hover); }
.btn-secondary { border-color: var(--zl-border); background: var(--zl-bg); }
.btn-secondary:hover { border-color: var(--zl-ink-300); background: var(--zl-ink-50); }
.btn-ghost:hover { background: var(--zl-ink-100); }
.btn-danger { background: var(--zl-danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-text { color: var(--zl-danger); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803D; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 56px; padding: 0 24px; font-size: 18px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--zl-text-muted);
}
.icon-btn:hover { background: var(--zl-ink-100); color: var(--zl-text); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 500; font-size: 14px; }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--zl-border); border-radius: 8px;
  background: var(--zl-bg);
}
.field textarea, textarea.input { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: 2px solid var(--zl-focus); outline-offset: 0; border-color: transparent;
}
.field input[readonly] { background: var(--zl-ink-50); color: var(--zl-text-muted); }
.field-inline {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid var(--zl-border); border-radius: 8px; background: var(--zl-bg);
}
.field-inline:focus-within { outline: 2px solid var(--zl-focus); border-color: transparent; }
.field-inline input, .field-inline select { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 8px 0; }
.field-inline .input { border: 0; padding-left: 0; min-height: 36px; }
.field-inline .icon { color: var(--zl-ink-400); }
.form-error { color: var(--zl-danger); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: start; }
.modal-foot .grow { flex: 1; }
/* enviar arquivo dentro de um campo */
.file-link { position: relative; display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 14px; color: var(--zl-accent); font-weight: 500; cursor: pointer; }
.file-link input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-link:hover { text-decoration: underline; }
.is-busy { opacity: 0.5; pointer-events: none; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--zl-accent); flex: none; }
.checks { display: grid; gap: 2px; }

/* ---------- elementos ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--zl-ink-100); color: var(--zl-ink-700);
}
.pill-accent { background: var(--zl-violet-100); color: var(--zl-violet-800); }
.pill-ok { background: #DCFCE7; color: #166534; }

.avatar {
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--zl-violet-100); color: var(--zl-violet-800);
  font-weight: 600; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 28px; }

.eyebrow { font-size: 13px; font-weight: 600; color: var(--zl-accent); letter-spacing: 0.02em; }

.panel {
  background: var(--zl-bg);
  border: 1px solid var(--zl-border);
  border-radius: var(--radius);
  padding: 24px;
}
.panel > h2 { margin-bottom: 16px; }

.empty { display: grid; justify-items: start; gap: 12px; padding: 8px 0; }

.rows { display: grid; }
.rows > li + li { border-top: 1px solid var(--zl-ink-100); }
ul.rows.panel { padding: 8px 24px; }
.row, .row-link {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0; color: inherit;
}
.row-link { margin: 0 -12px; padding: 12px; border-radius: 8px; }
.row-link:hover { text-decoration: none; background: var(--zl-ink-50); }
.row-link > .icon { color: var(--zl-ink-400); }
.row-main { display: grid; flex: 1; min-width: 0; }
.row-main strong { font-weight: 500; }
.row-main .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main-link { color: inherit; }
.row-main-link:hover { text-decoration: none; }
.row-main-link:hover strong { color: var(--zl-accent); }
.row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.progress { width: 80px; height: 6px; border-radius: 999px; background: var(--zl-ink-100); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--zl-accent); }

.count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--zl-accent); color: var(--zl-on-accent); font-size: 12px; font-weight: 600;
}

.copy-box {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 8px 8px 8px 12px; border-radius: 8px; background: var(--zl-ink-100);
}
.copy-box code { flex: 1; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }

/* aviso */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 8px;
  background: var(--zl-ink); color: var(--zl-paper); font-weight: 500;
  box-shadow: var(--shadow);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal */
.modal {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--zl-bg); color: var(--zl-text); box-shadow: var(--shadow);
}
.modal-wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(20 15 38 / 0.4); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 0; }
.modal-body { display: grid; gap: 16px; padding: 16px 24px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--zl-ink-100); }

/* seletor de imagem */
.picker-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-bar .btn-secondary { cursor: pointer; }
.picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
  min-height: 120px; align-content: start;
}
.picker-item {
  position: relative; display: block; height: 0; padding: 0 0 75%;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--zl-ink-100);
}
.picker-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.picker-item:hover, .picker-item:focus-visible { border-color: var(--zl-accent); }

/* ---------- login ---------- */
.page-login { background: var(--zl-paper); }
.login {
  min-height: 100vh; display: grid; place-content: center; gap: 24px;
  grid-template-columns: minmax(0, 400px); padding: 48px 16px;
}
.login-card { background: var(--zl-bg); border: 1px solid var(--zl-border); border-radius: var(--radius); padding: 32px; display: grid; gap: 8px; }
.login-card form { margin-top: 16px; }
.login-school { font-weight: 600; color: var(--zl-accent); }
.demo-box { display: grid; gap: 8px; padding: 0 8px; }
.demo-box h2 { font-size: 14px; font-weight: 500; }
.demo-box > .muted { font-size: 14px; }
.demo-list { display: grid; gap: 8px; margin-top: 4px; }
.demo-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; text-align: left;
  border: 1px solid var(--zl-violet-200); border-radius: 8px; background: var(--zl-bg);
}
.demo-btn:hover { border-color: var(--zl-accent); }
.demo-btn strong { font-weight: 500; }
.demo-btn span { color: var(--zl-text-muted); font-size: 14px; }
.demo-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--zl-ink-500); font-size: 13px; }
.login > .back-link { justify-self: start; }

/* ---------- página de divulgação (index.html) ---------- */
.page-site { background: var(--zl-bg); }
.site-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-head { position: sticky; top: 0; z-index: 10; background: rgb(255 255 255 / 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--zl-ink-100); }
.site-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.site-brand { font-weight: 600; font-size: 18px; color: var(--zl-text); }
.site-brand:hover { text-decoration: none; color: var(--zl-accent); }

.site-hero { background: var(--zl-paper); }
.site-hero-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.site-hero-text { display: grid; gap: 20px; justify-items: start; }
.site-hero-text h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.01em; }
.site-hero-text p:not(.site-eyebrow) { font-size: 19px; color: var(--zl-ink-700); max-width: 34em; }
.site-eyebrow { font-weight: 500; font-size: 15px; color: var(--zl-accent); }
.site-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.site-photo { position: relative; margin: 0; }
.site-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow); }
.site-photo-empty { display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 24px; background: var(--zl-violet-100); }
.site-photo figcaption {
  position: absolute; left: 16px; bottom: 16px; display: grid;
  padding: 10px 16px; border-radius: 12px; background: var(--zl-bg); box-shadow: var(--shadow);
}
.site-photo figcaption strong { font-weight: 600; }
.site-photo figcaption span { font-size: 14px; color: var(--zl-text-muted); }

.site-band { border-bottom: 1px solid var(--zl-ink-100); }
.site-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 32px; padding-top: 32px; padding-bottom: 32px; }
.site-points li { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
.site-points .icon { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--zl-violet-100); color: var(--zl-accent); }

.site-section { padding: 72px 0; }
.site-section-alt { background: var(--zl-ink-50); }
.site-section h2 { font-size: 30px; }
.site-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
.site-prose { display: grid; gap: 16px; font-size: 18px; color: var(--zl-ink-700); }
.site-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 8px; }
.site-quote { display: grid; align-content: space-between; gap: 24px; padding: 28px; border: 1px solid var(--zl-border); border-radius: var(--radius); background: var(--zl-bg); }
.site-quote blockquote { margin: 0; font-size: 17px; }
.site-quote-who { display: flex; align-items: center; gap: 12px; }
.site-quote-who > span:last-child { display: grid; }
.site-quote-who strong { font-weight: 600; }
.site-quote-who .muted { font-size: 14px; }

.site-final { background: var(--zl-ink); color: var(--zl-paper); }
.site-final-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 56px; padding-bottom: 56px; }
.site-final h2 { font-size: 30px; }
.site-final p { margin-top: 8px; color: var(--zl-ink-300); }
.site-final .btn-primary { background: var(--zl-violet-light); color: var(--zl-night); }
.site-final .btn-primary:hover { background: var(--zl-violet-300); }

.site-foot { border-top: 1px solid var(--zl-ink-100); }
.site-foot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; padding-bottom: 24px; font-size: 14px; color: var(--zl-text-muted); }
.site-foot .demo-foot { margin: 0 0 0 auto; }
.site-credit { font-size: 13px; color: var(--zl-ink-500); }

/* No celular (quem chega pela bio) o botão do WhatsApp fica sempre à mão. */
.site-sticky { display: none; }
@media (max-width: 760px) {
  .site-wrap { padding: 0 16px; }
  .site-hero-row { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; padding-bottom: 40px; }
  .site-photo { order: -1; max-width: 360px; width: 100%; justify-self: center; }
  .site-photo img, .site-photo-empty { aspect-ratio: 1; }
  .site-hero-text p:not(.site-eyebrow) { font-size: 17px; }
  .site-actions { width: 100%; }
  .site-actions .btn { flex: 1; }
  .site-about { grid-template-columns: 1fr; gap: 16px; }
  .site-section { padding: 48px 0; }
  .site-final-btn { width: 100%; }
  .site-foot .demo-foot { margin-left: 0; }
  .page-site { padding-bottom: 88px; }
  .site-sticky {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.95); border-top: 1px solid var(--zl-ink-100);
  }
}

/* ---------- painel do professor ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-content: start; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px; background: var(--zl-bg); border-right: 1px solid var(--zl-border);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side-brand div { display: grid; min-width: 0; }
.side-brand strong { font-weight: 600; }
.side-brand span:not(.avatar) { font-size: 14px; color: var(--zl-text-muted); }
.side-nav { display: grid; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--zl-ink-700); font-weight: 500; font-size: 15px; text-align: left;
}
.side-link:hover { background: var(--zl-ink-100); text-decoration: none; }
.side-link.active { background: var(--zl-violet-50); color: var(--zl-violet-800); }
.side-link.active .icon { color: var(--zl-accent); }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.side-foot .side-link { font-size: 14px; color: var(--zl-text-muted); }

/* Conteúdo ocupa a largura da tela (até 1600px); formulários longos ficam numa coluna legível. */
.main { padding: 32px 40px 64px; max-width: 1600px; width: 100%; outline: none; display: grid; gap: 24px; align-content: start; }
.q-list, #q-list + .form-actions, #grade-form { max-width: 960px; width: 100%; }
.view-head { display: grid; gap: 8px; }
.view-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h1 + .muted { margin-top: 4px; }
.view-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--zl-text-muted); font-size: 14px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--zl-text); text-decoration: none; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.cols-wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.saved { font-size: 14px; min-width: 40px; }

.title-input, .sub-input {
  display: block; width: 100%; border: 0; border-radius: 8px; background: none;
  padding: 2px 8px; margin-left: -8px;
}
.title-input { font-size: 32px; font-weight: 600; line-height: 1.2; }
.sub-input { color: var(--zl-text-muted); margin-top: 4px; }
.title-input:hover, .sub-input:hover { background: var(--zl-ink-100); }
.title-input:focus, .sub-input:focus { outline: 2px solid var(--zl-focus); background: var(--zl-bg); }

/* editor de perguntas */
.q-list { display: grid; gap: 16px; }
.q-edit { display: grid; gap: 16px; }
.q-edit-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-tools { margin-left: auto; display: flex; gap: 2px; }
.q-num {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--zl-ink-100); font-weight: 600; font-size: 14px;
}
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--zl-ink-100); gap: 2px; }
.seg button, .seg label span {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; font-weight: 500; font-size: 14px; color: var(--zl-ink-600); cursor: pointer;
}
.seg button[aria-checked="true"] { background: var(--zl-bg); color: var(--zl-text); box-shadow: 0 1px 2px rgb(20 15 38 / 0.08); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label input:focus-visible + span { outline: 2px solid var(--zl-focus); }
.seg-grade label input:checked + span { background: var(--zl-bg); color: var(--zl-text); box-shadow: 0 1px 2px rgb(20 15 38 / 0.08); }
.seg-grade label.is-ok input:checked + span { color: var(--ok); }
.seg-grade label.is-half input:checked + span { color: var(--half); }
.seg-grade label.is-bad input:checked + span { color: var(--bad); }
.seg-grade input:disabled + span { cursor: default; }
.seg-n { font-size: 12px; color: var(--zl-ink-500); font-weight: 500; }

.q-image { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.q-image-actions { display: flex; gap: 8px; }
.q-figure { margin: 0; display: grid; gap: 4px; }
.q-figure img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; background: var(--zl-ink-100); }
.q-figure figcaption { font-size: 12px; color: var(--zl-ink-500); }
.q-figure figcaption a { color: inherit; }
.q-figure-sm img { width: 240px; height: 160px; object-fit: cover; }

.options { display: grid; gap: 8px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--ok); flex: none; margin: 0; }
.opt-letter {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--zl-border); font-weight: 600; font-size: 13px; color: var(--zl-ink-600);
}
.options .btn { justify-self: start; }

/* correção */
.grade-q { display: grid; gap: 12px; }
.grade-head { display: flex; align-items: flex-start; gap: 12px; }
.q-text { font-weight: 500; font-size: 18px; padding-top: 1px; }
.opt-review { display: grid; gap: 6px; }
.opt-review li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; }
.opt-review .is-correct { background: #DCFCE7; }
.opt-review .is-correct .opt-letter { border-color: var(--ok); color: var(--ok); }
.opt-review .is-wrong { background: #FEE2E2; }
.opt-review .is-wrong .opt-letter { border-color: var(--bad); color: var(--bad); }
.answer { display: grid; gap: 4px; padding: 12px 16px; border-radius: 8px; background: var(--zl-ink-50); border: 1px solid var(--zl-ink-100); }
.answer .muted { font-size: 13px; }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.verdict.ok { color: var(--ok); }
.verdict.half { color: var(--half); }
.verdict.bad { color: var(--bad); }
.comment { padding-left: 12px; border-left: 3px solid var(--zl-violet-300); }

/* aula em andamento (aviso no topo) */
.class-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--zl-violet-200); border-radius: var(--radius); background: var(--zl-violet-50);
}
.class-banner > .icon { color: var(--zl-accent); }
.class-banner .muted { font-size: 14px; }

/* alunos: tela inicial */
.list-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pick-search { flex: 1; max-width: 360px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pick-card {
  display: grid; justify-items: start; align-content: start; gap: 8px; height: 100%;
  padding: 20px; border: 1px solid var(--zl-border); border-radius: var(--radius);
  background: var(--zl-bg); color: inherit;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.pick-card:hover { text-decoration: none; border-color: var(--zl-accent); box-shadow: var(--shadow); }
.pick-card.is-today { border-color: var(--zl-violet-200); }
.pick-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.pick-when { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--zl-ink-700); }
.pick-when strong { font-weight: 600; }
.pick-when .icon { color: var(--zl-accent); }

/* espaço do aluno: unidades */
.aula-who { display: flex; align-items: center; gap: 16px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.unit-card {
  display: grid; justify-items: start; align-content: start; gap: 6px; height: 100%;
  padding: 20px; border: 1px solid var(--zl-border); border-radius: var(--radius);
  background: var(--zl-bg); color: inherit; font-size: 14px;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.unit-card:hover { text-decoration: none; border-color: var(--zl-accent); box-shadow: var(--shadow); }
.unit-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.unit-card .progress { width: 100%; margin: 4px 0; }

/* unidade: agenda das aulas e aula escolhida */
.agenda-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.agenda { display: grid; gap: 4px; }
.agenda-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px;
  border-radius: 10px; color: inherit;
}
.agenda-item:hover { text-decoration: none; background: var(--zl-ink-50); }
.agenda-item.is-selected { background: var(--zl-violet-50); box-shadow: inset 0 0 0 1px var(--zl-violet-200); }
.agenda-date {
  display: grid; place-items: center; flex: none; width: 48px; height: 52px;
  border-radius: 10px; background: var(--zl-ink-100); line-height: 1.1;
}
.agenda-date strong { font-size: 20px; font-weight: 600; }
.agenda-date span { font-size: 12px; color: var(--zl-ink-600); text-transform: uppercase; }
.agenda-item.is-selected .agenda-date { background: var(--zl-accent); color: var(--zl-on-accent); }
.agenda-item.is-selected .agenda-date span { color: inherit; }
.agenda-item.is-done .row-main strong { color: var(--zl-text-muted); font-weight: 400; }
.lesson-panel { display: grid; gap: 12px; position: sticky; top: 24px; }
.lesson-panel > h2 { margin: 0; font-size: 24px; }
.lesson-when { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--zl-ink-700); }
.lesson-text { color: var(--zl-ink-700); white-space: pre-line; }
.materials { display: grid; margin: 4px 0 8px; }
.materials li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.materials li + li { border-top: 1px solid var(--zl-ink-100); }
.materials li > .icon { color: var(--zl-accent); }
.materials .muted { font-size: 13px; }

/* ficha */
.photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-row .btn-secondary { cursor: pointer; }

/* Minha página: editor da página de divulgação */
.page-editor { max-width: 960px; width: 100%; }
.dep-list { display: grid; }
.dep-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; }
.dep-item + .dep-item { border-top: 1px solid var(--zl-ink-100); }
.dep-photo { display: grid; justify-items: center; gap: 4px; }
.dep-photo .btn { cursor: pointer; }
.dep-add { justify-self: start; }
@media (max-width: 600px) {
  .dep-item { flex-wrap: wrap; }
  .dep-photo { grid-auto-flow: column; align-items: center; }
}

/* slides */
.file-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--zl-violet-100); color: var(--zl-violet-800); flex: none; }
label.btn { cursor: pointer; }

/* ---------- área do aluno ---------- */
.page-student { background: var(--page); }
.topbar { background: var(--zl-bg); border-bottom: 1px solid var(--zl-border); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-school { font-weight: 600; color: var(--zl-text); }
.topbar-school:hover { text-decoration: none; color: var(--zl-accent); }
.topbar-me { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--zl-text-muted); }
.student { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; display: grid; gap: 24px; outline: none; }
.student-head { display: grid; gap: 4px; }
.answer-q fieldset { display: grid; gap: 16px; }
.answer-q legend { margin: 0 0 16px; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--zl-border); border-radius: 8px; cursor: pointer;
}
.choice:hover { border-color: var(--zl-ink-300); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: var(--zl-accent); background: var(--zl-violet-50); }
.choice:has(input:checked) .opt-letter { background: var(--zl-accent); color: #fff; border-color: var(--zl-accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--zl-focus); outline-offset: 2px; }
.note { background: var(--zl-violet-50); border-color: var(--zl-violet-200); }
.note h2 { font-size: 16px; margin-bottom: 8px; }
.plan-note { margin: -8px 0 16px; font-size: 14px; }
.plan + .plan { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--zl-ink-100); }
.plan h3 { display: grid; gap: 2px; font-size: 18px; }
.plan-list { display: grid; gap: 4px; margin-top: 12px; }
.plan-list li { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.plan-list li.is-next { margin: 0 -12px; padding: 8px 12px; border-radius: 8px; background: var(--zl-violet-50); }
.plan-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 999px; border: 1.5px solid var(--zl-ink-300); flex: none; }
.plan-list .is-done .plan-mark { background: var(--zl-accent); border-color: var(--zl-accent); color: #fff; }
.plan-body { display: grid; gap: 2px; min-width: 0; }
.plan-body strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.plan-body .muted { font-size: 14px; }
.plan-text { font-size: 14px; color: var(--zl-ink-600); }
.plan-list .is-done .plan-body strong { color: var(--zl-text-muted); font-weight: 400; }

/* ---------- quiz ao vivo ---------- */
.page-live { background: var(--zl-bg); min-height: 100vh; display: flex; flex-direction: column; }
.live-bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--zl-ink-100); }
.live-title { flex: 1; text-align: center; font-weight: 500; color: var(--zl-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-bar-right { display: flex; align-items: center; gap: 12px; }
.live-score { font-weight: 600; color: var(--zl-accent); }
.live { flex: 1; display: grid; place-items: center; padding: 32px 24px 48px; }
.live-card { width: min(560px, 100%); display: grid; gap: 16px; }
.live-start h1 { font-size: 48px; }
.live-start .btn-lg { justify-self: start; }
.live-q {
  width: min(1100px, 100%); display: grid; gap: 24px; justify-items: center; text-align: center;
}
.live-progress { color: var(--zl-text-muted); font-weight: 500; }
.live-text { font-size: clamp(28px, 4vw, 48px); max-width: 24ch; }
.live-figure img { max-height: 42vh; width: auto; max-width: 100%; margin: 0 auto; }
.live-figure figcaption { text-align: center; }
.live-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 900px; }
.live-opt {
  display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 12px 20px;
  border: 2px solid var(--zl-border); border-radius: var(--radius); background: var(--zl-bg);
  font-size: 22px; font-weight: 500; text-align: left;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out;
}
.live-opt .opt-letter { width: 40px; height: 40px; font-size: 18px; }
.live-opt:hover:not(:disabled) { border-color: var(--zl-accent); }
.live-opt:disabled { cursor: default; }
.live-opt.is-correct { border-color: var(--ok); background: #DCFCE7; }
.live-opt.is-correct .opt-letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.live-opt.is-wrong { border-color: var(--bad); background: #FEE2E2; }
.live-opt.is-wrong .opt-letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.live-opt.is-dim { opacity: 0.45; }
.live-oral { display: grid; gap: 20px; justify-items: center; }
.live-oral-hint { display: inline-flex; align-items: center; gap: 8px; }
.live-judge { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.live-verdict { display: inline-flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; }
.live-verdict .icon { width: 28px; height: 28px; }
.live-verdict.ok { color: var(--ok); }
.live-verdict.bad { color: var(--bad); }
.live-answer { display: grid; gap: 4px; padding: 16px 32px; border-radius: var(--radius); background: var(--zl-violet-50); }
.live-answer p { font-size: 28px; font-weight: 600; }
.live-next { display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 56px; }
.live-big { font-size: 96px; font-weight: 600; line-height: 1; }
.live-big span { color: var(--zl-ink-300); font-size: 48px; }
.live-summary { display: grid; gap: 8px; margin: 8px 0; }
.live-summary li { display: flex; align-items: center; gap: 10px; }
.live-summary .ok .icon { color: var(--ok); }
.live-summary .bad .icon { color: var(--bad); }
/* dentro da tela da aula: deixa livre o canto do botão de tela cheia e a barra da aula */
.is-embed .live-bar { padding-right: 72px; }
.is-embed .live { padding-bottom: 96px; }

/* ---------- lousa ---------- */
.page-board { overflow: hidden; background: #fff; overscroll-behavior: none; }
/* a folha tem a altura de todas as páginas; o canvas fica parado na tela e desenha a parte visível */
.board-scroll { position: fixed; inset: 0; overflow: auto; overscroll-behavior: none; scrollbar-width: thin; }
.board-sheet { position: relative; min-width: 100%; }
#board { position: sticky; top: 0; left: 0; display: block; touch-action: none; }
.board-top, .board-tools, .board-right {
  position: fixed; top: 12px; z-index: 5;
  display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--zl-bg); border: 1px solid var(--zl-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.board-top { left: 12px; padding-right: 12px; max-width: calc(50vw - 300px); min-width: 200px; }
.board-right { right: 12px; }
.board-tools { left: 50%; transform: translateX(-50%); }
.board-btn { color: var(--zl-text); }
.board-title {
  flex: 1; min-width: 0; height: 36px; padding: 0 8px; border: 0; border-radius: 8px;
  background: none; font-weight: 500;
}
.board-title:hover { background: var(--zl-ink-100); }
.board-title:focus { outline: 2px solid var(--zl-focus); }
.board-status { font-size: 13px; white-space: nowrap; }
.tool-group { display: flex; align-items: center; gap: 2px; }
.tool-group + .tool-group,
.tool-opts > .tool-group,
.tool-opts + .tool-group { padding-left: 6px; margin-left: 4px; border-left: 1px solid var(--zl-ink-100); }
.tool-opts { display: contents; }
.board-pages { display: flex; align-items: center; gap: 2px; padding-right: 4px; margin-right: 2px; border-right: 1px solid var(--zl-ink-100); }
.board-pages .icon-btn:disabled { opacity: 0.35; pointer-events: none; }
.board-page-num { min-width: 44px; text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--zl-text-muted); }
.tool {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px;
  border: 0; border-radius: 8px; background: none; color: var(--zl-ink-700);
}
.tool:hover { background: var(--zl-ink-100); }
.tool[aria-pressed="true"] { background: var(--zl-violet-100); color: var(--zl-violet-800); }
.tool:disabled { opacity: 0.35; pointer-events: none; }
.tool-text { font-size: 14px; font-weight: 500; }
.swatch {
  width: 28px; height: 28px; padding: 0; border-radius: 999px;
  border: 2px solid var(--zl-bg); background: var(--c); box-shadow: 0 0 0 1px var(--zl-ink-200);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--zl-accent); }
.size span { display: block; width: var(--d); height: var(--d); border-radius: 999px; background: currentColor; }
.board-hint {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  color: var(--zl-ink-400); font-size: 14px; pointer-events: none;
}
.text-editor {
  position: absolute; z-index: 4; margin: 0; padding: 0; min-width: 24px;
  border: 0; outline: 1px dashed var(--zl-violet-400); background: transparent;
  white-space: pre; cursor: text;
}
.text-editor[hidden] { display: none; }
.text-editor > div { min-height: 1lh; }

/* tela da aula: Lousa, Slides e Quiz, contador e encerrar */
.board-right { z-index: 8; }
.board-class {
  position: fixed; right: 12px; bottom: 12px; z-index: 8;
  display: flex; align-items: center; gap: 8px; padding: 4px;
  background: var(--zl-bg); border: 1px solid var(--zl-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.board-modes { padding: 2px; }
.board-modes button { height: 36px; }
.class-timer {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px 2px; border-radius: 8px; overflow: hidden;
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--zl-text);
}
.class-timer > .icon { color: var(--zl-accent); }
.timer-total { font-weight: 400; color: var(--zl-text-muted); font-size: 14px; }
.timer-bar { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 999px; background: var(--zl-ink-100); }
.timer-bar span { display: block; height: 100%; border-radius: inherit; background: var(--zl-accent); }
.class-timer.is-over { color: var(--half); }
.class-timer.is-over > .icon, .class-timer.is-over .timer-bar span { color: var(--half); background: var(--half); }
.class-timer.is-over > .icon { background: none; }

.board-layer { position: fixed; inset: 0; z-index: 6; overflow: auto; background: var(--zl-bg); }
body:not([data-mode="lousa"]) .board-tools,
body:not([data-mode="lousa"]) .board-top,
body:not([data-mode="lousa"]) .board-hint,
body:not([data-mode="lousa"]) .text-editor { display: none; }
.layer-pick { width: min(760px, 100%); margin: 0 auto; padding: 64px 24px 120px; display: grid; gap: 24px; }
.layer-head { display: grid; gap: 4px; }
.layer-fill { position: absolute; inset: 0; }
.layer-frame { display: block; width: 100%; height: 100%; border: 0; }

.slides { position: absolute; inset: 0; background: var(--zl-ink-100); }
.slides-stage { position: absolute; inset: 60px 0 64px; display: grid; place-items: center; }
.slides-paper { position: relative; box-shadow: var(--shadow); background: #fff; }
.slides-page { display: block; }
.slides-ink { position: absolute; inset: 0; touch-action: none; }
.slides-ink.is-pen { cursor: crosshair; }
.slides-bar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--zl-bg); border: 1px solid var(--zl-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.slides-count { min-width: 56px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.slides-name { max-width: 200px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--zl-text-muted); }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .board-top { max-width: none; top: auto; bottom: 12px; }
  .board-hint { bottom: 72px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* barra do topo compacta: 56px, só ícones */
  .side {
    position: sticky; top: 0; z-index: 10; height: auto;
    flex-direction: row; align-items: center; gap: 4px;
    padding: 8px 8px; padding-top: calc(8px + env(safe-area-inset-top));
    border-right: 0; border-bottom: 1px solid var(--zl-border);
  }
  .side-brand div, .side-foot .side-link:first-child { display: none; }
  .side-brand { padding: 0 4px 0 0; }
  .side-brand .avatar { width: 32px; height: 32px; font-size: 12px; }
  .side-nav { display: flex; flex: 1; justify-content: space-around; gap: 0; }
  .side-link { width: 40px; height: 40px; padding: 0; justify-content: center; flex: none; position: relative; }
  /* o nome continua para leitores de tela */
  .side-link > span:not(.count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side-nav .count { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .side-foot { margin: 0; }
  .main { padding: 24px 16px 48px; }
  .cols, .cols-wide, .agenda-wrap { grid-template-columns: 1fr; }
  .lesson-panel { position: static; }
  .live-options { grid-template-columns: 1fr; }
  /* tela da aula: só ícones na barra da aula */
  .board-modes span, #end span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .slides-name { display: none; }
}

@media (max-width: 640px) {
  h1, .title-input { font-size: 24px; }
  .panel { padding: 16px; }
  ul.rows.panel { padding: 4px 16px; }
  .row { flex-wrap: wrap; }
  .row-meta .muted { display: none; }
  /* lista: nome inteiro em cima, selos embaixo */
  .row-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; }
  .row-link > .avatar { grid-row: 1 / span 2; }
  .row-link > .row-main { grid-column: 2; }
  .row-link > .row-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .row-link > .row-meta:empty { display: none; }
  .row-link > .icon { grid-column: 3; grid-row: 1 / span 2; }
  .row-link:not(:has(.avatar)) { grid-template-columns: minmax(0, 1fr) auto; }
  .row-link:not(:has(.avatar)) > .row-main, .row-link:not(:has(.avatar)) > .row-meta { grid-column: 1; }
  .row-link:not(:has(.avatar)) > .icon { grid-column: 2; }
  .row-link:not(:has(.avatar)) > .btn { grid-column: 2; grid-row: 1 / span 2; }
  .row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .live-start h1 { font-size: 32px; }
  .pick-grid, .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pick-card, .unit-card { padding: 14px; }
  .pick-name, .unit-name { font-size: 16px; }
  .pick-when { font-size: 14px; align-items: flex-start; }
  .pick-when .icon { margin-top: 2px; }
  .aula-who .avatar.lg { display: none; }
  .live-opt { font-size: 18px; min-height: 56px; }
  .board-tools { flex-wrap: wrap; justify-content: center; width: calc(100vw - 24px); top: 60px; }
  .board-top { top: 12px; bottom: auto; right: 64px; }
  .board-class { left: 12px; justify-content: space-between; }
  .slides-bar { width: calc(100vw - 24px); justify-content: center; flex-wrap: wrap; }
  .slides-stage { inset: 112px 0 64px; }
  .layer-pick { padding: 24px 16px 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
