/* Certificado Vigilante — visual do sistema (mesma linguagem da página de vendas) */
@font-face { font-family: "Sora"; font-weight: 500; font-display: swap; src: url(/escolas-kit/fontes/sora-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url(/escolas-kit/fontes/sora-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url(/escolas-kit/fontes/sora-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/escolas-kit/fontes/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/escolas-kit/fontes/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/escolas-kit/fontes/inter-latin-600-normal.woff2) format("woff2"); }

:root {
  --titulo: "Sora", system-ui, sans-serif;
  --texto: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fundo: #faf9f6;
  --papel: #ffffff;
  --suave: #fbf5e7;
  --tinta: #14192a;
  --tinta-suave: #5a6475;
  --linha: rgba(20, 25, 42, .10);
  --linha-forte: rgba(20, 25, 42, .18);
  --ouro: #ecb931;
  --ouro-texto: #8a6608;
  --forte: #101f37;
  /* cor de destaque: a da escola quando houver, senão o azul-marinho da plataforma */
  /* (a cor de destaque --acento é definida no body, onde a cor da escola é aplicada) */
  --ok-bg: #e9f6ee; --ok: #1d6b39;
  --err-bg: #fdeeee; --err: #a12626;
  --warn: #9a6400; --warn-bg: #fff6e0;
  --raio: 16px;
  --sombra: 0 1px 2px rgba(16, 31, 55, .04), 0 12px 32px -20px rgba(16, 31, 55, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 var(--texto); color: var(--tinta); background: var(--fundo);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  --acento: var(--brand, #101f37);
}
main { flex: 1; }
a { color: var(--forte); text-decoration-color: color-mix(in srgb, var(--forte) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 .45em; color: var(--tinta); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
h1 em, h2 em { font-style: normal; color: var(--brand, var(--ouro-texto)); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--tinta-suave); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt { margin-top: 24px; }
.mt-s { margin-top: 10px; }
code { background: #f1efe9; padding: 2px 6px; border-radius: 6px; font-size: .88em; }
::selection { background: color-mix(in srgb, var(--ouro) 40%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ouro) 70%, transparent); outline-offset: 2px; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--papel) 86%, transparent);
  backdrop-filter: saturate(150%) blur(12px); -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--linha);
}
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--acento), color-mix(in srgb, var(--acento) 40%, var(--ouro))); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--tinta); text-decoration: none; min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text > span { font-family: var(--titulo); font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; }
.brand small { font: 600 .68rem/1.3 var(--texto); letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-suave); margin-top: 2px; }
.brand-logo { height: 42px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; border: 1px solid var(--linha); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--forte); color: var(--ouro); flex: none; }
.topbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { color: var(--tinta-suave); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .94rem; transition: background .15s, color .15s; }
.topbar nav a:hover { color: var(--tinta); background: #f1efe9; }
.topbar nav a.on { color: var(--tinta); background: var(--suave); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ouro) 35%, transparent); }
.topbar nav form { margin: 0; }
.topbar .btn-ghost { color: var(--tinta-suave); border-color: transparent; padding: 8px 14px; }
.topbar .btn-ghost:hover { color: var(--tinta); background: #f1efe9; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem/1 var(--texto); padding: 12px 20px; border-radius: 999px;
  border: 1.5px solid var(--linha-forte); background: var(--papel); color: var(--tinta);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s, filter .15s;
}
.btn:hover { background: #f6f4ef; transform: translateY(-1px); }
.btn-primary { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-primary:hover { background: var(--acento); filter: brightness(1.12); box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--acento) 70%, #000); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f1efe9; }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); background: var(--papel); }
.btn-danger:hover { background: var(--err-bg); }
.btn-small { padding: 8px 14px; font-size: .86rem; }
.btn-block { width: 100%; padding: 15px; font-size: 1rem; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- Formulários ---------- */
label { display: flex; flex-direction: column; gap: 7px; font: 600 .9rem/1.3 var(--texto); color: var(--tinta); }
input, textarea, select {
  font: 400 1rem/1.3 var(--texto); color: var(--tinta); background: var(--papel);
  padding: 13px 14px; border: 1.5px solid var(--linha-forte); border-radius: 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9aa1ad; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ouro); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ouro) 22%, transparent); }
input[readonly] { background: #f6f4ef; color: var(--tinta-suave); }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; margin-bottom: 10px; }
input[type=color] { width: 64px; height: 46px; padding: 4px; cursor: pointer; }
input[type=file] { padding: 10px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; accent-color: var(--acento); }

/* ---------- Cartões e cabeçalhos ---------- */
.card { background: var(--papel); border: 1px solid var(--linha); border-radius: calc(var(--raio) + 4px); padding: clamp(20px, 3vw, 28px); margin-bottom: 22px; box-shadow: var(--sombra); }
.card > h2:first-child { margin-bottom: .7em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 36px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2em; }
.page-head p { margin: 0; max-width: 62ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .14em; font: 600 .74rem/1 var(--texto); color: var(--ouro-texto); margin: 0 0 16px; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--ouro); border-radius: 2px; }
.narrow { max-width: 560px; margin: 64px auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.grid-2.tight { gap: 12px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack .btn { align-self: flex-start; }
.row-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- Abertura (login do aluno / escola / dono) ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(40px, 7vw, 88px) 0; position: relative; }
.hero::before { content: ""; position: absolute; inset: -40px -10% auto auto; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ouro) 22%, transparent), transparent); }
.hero-text h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; letter-spacing: -.035em; }
.hero-text p { font-size: 1.1rem; color: var(--tinta-suave); max-width: 32em; }
.login { display: flex; flex-direction: column; gap: 16px; max-width: 440px; width: 100%; justify-self: end; padding: clamp(22px, 3vw, 32px); box-shadow: 0 30px 60px -30px rgba(16, 31, 55, .35), 0 0 0 1px var(--linha); border: 0; }
.login h2 { font-size: 1.3rem; margin-bottom: 2px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 24px; } .login { justify-self: stretch; max-width: none; } }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; color: var(--tinta-suave); display: grid; gap: 10px; }
.ticks li { padding-left: 32px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--suave); color: var(--ouro-texto); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ouro) 40%, transparent); }

/* ---------- Avisos ---------- */
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; font-size: .95rem; border: 1px solid transparent; }
.alert ul { margin: 6px 0; padding-left: 20px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 18%, transparent); }
.alert-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 18%, transparent); }
.alert a { color: inherit; font-weight: 600; }

/* ---------- Certificados do aluno ---------- */
.cert-list { list-style: none; margin: 0; padding: 0; }
.cert { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--linha); }
.cert:first-child { border-top: 0; padding-top: 6px; }
.cert-icon { flex: none; width: 50px; height: 60px; border-radius: 10px; background: var(--suave); color: var(--ouro-texto); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ouro) 40%, transparent); display: grid; place-items: center; font: 700 .72rem/1 var(--titulo); letter-spacing: .04em; }
.cert-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-info strong { font-family: var(--titulo); font-weight: 600; letter-spacing: -.01em; }
.cert-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) { .cert { flex-wrap: wrap; } .cert-actions { width: 100%; } .cert-actions .btn { flex: 1; } }

/* ---------- Números ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 18px 20px; color: var(--tinta-suave); font-size: .88rem; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--ouro), transparent); opacity: .7; }
.stat a { color: inherit; text-decoration: none; display: block; }
.stat span { display: block; font: 600 clamp(1.6rem, 3vw, 2.1rem)/1.1 var(--titulo); letter-spacing: -.03em; color: var(--tinta); margin-bottom: 4px; }
.stat-warn { background: var(--warn-bg); }
.stat-warn span { color: var(--warn); }

/* ---------- Envio de arquivos ---------- */
.upload { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.drop { position: relative; width: 100%; border: 2px dashed color-mix(in srgb, var(--ouro) 55%, var(--linha-forte)); border-radius: var(--raio); padding: 38px 20px; text-align: center; align-items: center; background: var(--suave); cursor: pointer; font-weight: 400; transition: background .15s, border-color .15s; }
.drop.over, .drop:hover { border-color: var(--ouro); background: color-mix(in srgb, var(--ouro) 14%, var(--papel)); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-title { font: 600 1rem/1.3 var(--titulo); color: var(--tinta); }
.drop-sm { padding: 22px 16px; }
.progress { width: 100%; background: #efece5; border-radius: 99px; height: 10px; overflow: hidden; position: relative; }
.progress.big { height: 14px; margin: 12px 0; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--acento), color-mix(in srgb, var(--acento) 50%, var(--ouro))); border-radius: 99px; transition: width .4s; }
.upload .progress { height: auto; background: none; overflow: visible; }
.upload .progress .progress-bar { height: 10px; }
.jobs { list-style: none; padding: 0; margin: 0; }
.jobs li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--linha); }
.jobs li:first-child { border-top: 0; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font: 600 .72rem/1.2 var(--texto); text-transform: uppercase; letter-spacing: .1em; color: var(--tinta-suave); border-bottom-color: var(--linha-forte); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fcfbf8; }
td strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.row-off td { opacity: .55; }
.row-err td { color: var(--err); }
.school-cell { min-width: 230px; }
.school-cell form { margin: 0; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-block; font: 600 .7rem/1 var(--texto); padding: 4px 8px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); vertical-align: middle; }
.pill { display: inline-block; font: 600 .74rem/1 var(--texto); padding: 6px 10px; border-radius: 99px; text-transform: capitalize; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-off { background: var(--err-bg); color: var(--err); }
.pill-run { background: #e8efff; color: #1f4fbf; }

/* ---------- Filtros e edição em linha ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[name=q] { flex: 1; min-width: 220px; }
.inline-form { display: flex; gap: 6px; min-width: 220px; }
.inline-form input { width: 140px; padding: 9px 11px; border-radius: 10px; }
.inline-form input.missing { border-color: #e6c46a; background: var(--warn-bg); }
.inline-form select { width: auto; padding: 9px 11px; border-radius: 10px; }

/* ---------- Telas da escola e do dono ---------- */
.impersonate { background: var(--forte); color: #e8ecf3; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.impersonate strong { color: var(--ouro); }
.impersonate form { margin: 0; }
.impersonate .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.impersonate .btn:hover { background: rgba(255, 255, 255, .1); }
.logo-preview { display: flex; align-items: center; justify-content: center; min-height: 100px; border: 1.5px dashed var(--linha-forte); border-radius: var(--raio); padding: 12px; background: var(--fundo); }
.logo-preview img { max-height: 90px; max-width: 100%; }
.slug-row, .color-row { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.slug-row input { flex: 1; }
.creds { background: var(--papel); color: var(--tinta); border-radius: 12px; padding: 12px 14px; margin-top: 10px; display: grid; gap: 6px; border: 1px solid var(--linha); }
details summary { cursor: pointer; color: var(--tinta-suave); font-weight: 500; }
details[open] summary { margin-bottom: 8px; }

/* Liberar acesso */
.liberar input[type=search] { width: 100%; }
.liberar-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
@media (max-width: 640px) { .liberar-form { grid-template-columns: 1fr; } }
.busca { position: relative; }
.busca-res { list-style: none; margin: 6px 0 0; padding: 6px; border: 1px solid var(--linha); border-radius: 14px; background: var(--papel); max-height: 340px; overflow-y: auto; box-shadow: 0 20px 40px -20px rgba(16, 31, 55, .3); }
.busca-res li button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; font: inherit; cursor: pointer; color: var(--tinta); }
.busca-res li button:hover, .busca-res li button:focus { background: var(--suave); outline: none; }
.busca-res .vazio { padding: 10px 12px; }
.selecionado { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--fundo); border: 1px solid var(--linha); }
.selecionado .aviso { color: var(--warn); }
pre.msg { white-space: pre-wrap; font: inherit; background: var(--papel); color: var(--tinta); border-radius: 12px; padding: 12px 14px; margin: 8px 0 12px; border: 1px solid var(--linha); }

/* ---------- Rodapé ---------- */
.foot { padding: 34px 20px; font-size: .875rem; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--tinta-suave); }
.foot a { color: var(--tinta-suave); }
.foot-line { text-align: center; }
.powered { font-size: .74rem; opacity: .7; }

@media (max-width: 560px) {
  .topbar-in { min-height: 60px; gap: 10px; }
  .brand-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .98rem; }
  .brand small { display: none; }
  .topbar nav a { padding: 7px 10px; font-size: .88rem; }
  .area-aluno .ticks { display: none; }
  .hero { padding-top: 24px; }
  .page-head { padding-top: 26px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .drop, tbody tr { transition: none; } .btn:hover { transform: none; } }
[hidden] { display: none !important; }
