:root {
  --amarelo: #f9b800;
  --teal: #00aeb9;
  --azul: #0081a7;
  --rosa: #ff3377;
  --claro: #f6f8f8;
  --escuro: #141414;
  --ficha: #d7eef1;
  --lapis: #f5b400;
  --vermelho: #c0392b;
  --texto: #1b1b1b;
  --titulo: 'Baloo 2', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.4 Inter, system-ui, sans-serif;
  color: var(--texto);
  background: var(--claro);
}
body.amarelo { background: var(--amarelo); color: var(--texto); }
body.teal { background: var(--teal); color: #fff; }
body.escuro { background: var(--escuro); color: #fff; }
body.ficha-ver { background: var(--ficha); }

.doodles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; color: transparent; }
.amarelo .doodles, .teal .doodles { color: rgba(255, 255, 255, .16); }
.escuro .doodles { color: #2a2a2a; }

main { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; padding: 56px 24px 48px; }
h1, h2, h3, .marca { font-family: var(--titulo); margin: 0; line-height: 1.15; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }

.voltar { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--titulo); font-size: 19px; margin-bottom: 28px; }
.icone { width: 24px; height: 24px; flex: none; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acoes { display: flex; gap: 14px; }
.acoes a, .acoes button, .icon-btn { background: none; border: 0; padding: 4px; display: inline-flex; line-height: 0; text-decoration: none; }
.lapis { color: var(--lapis); }
.xis { color: var(--vermelho); }
.sub { font-size: 13px; color: #33434a; margin-top: 6px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* cartões com espiral (login, aluno) */
.caderno { position: relative; background: var(--claro); border-radius: 22px; padding: 56px 28px 28px; color: var(--texto); margin-top: 40px; }
main > .caderno:first-child { margin-top: max(40px, calc(50vh - 240px)); }
.espiral { position: absolute; top: -12px; left: 0; right: 0; display: flex; justify-content: space-evenly; padding: 0 56px; }
.espiral span { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--amarelo); top: 28px; }
.escuro .espiral span { background: var(--escuro); }
.espiral span::before { content: ''; position: absolute; left: 0; bottom: 7px; width: 16px; height: 38px; border: 2.5px solid var(--azul); border-left-color: transparent; border-radius: 10px; }
.marca { color: var(--azul); font-size: 34px; text-align: center; margin-bottom: 28px; }
.campo-linha { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--azul); padding: 8px 4px; margin-bottom: 24px; color: var(--azul); }
.campo-linha input { border: 0; background: none; flex: 1; outline: none; color: var(--texto); padding: 4px 0; }
.link-pequeno { display: block; text-align: center; font-size: 13px; color: #555; margin: -8px 0 14px; }

.btn { display: block; width: 100%; border: 0; border-radius: 10px; padding: 9px 16px; font-family: var(--titulo); font-weight: 600; font-size: 20px; text-align: center; text-decoration: none; }
.btn-azul { background: var(--azul); color: #fff; }
.btn-rosa { background: var(--rosa); color: #fff; }
.btn-claro { background: var(--claro); color: var(--teal); }
.escuro .btn-claro { color: var(--rosa); }
.btn + .btn { margin-top: 20px; }
.btn[disabled] { opacity: .6; cursor: wait; }

.erro { background: #fff0f3; color: #b0003a; border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 0 0 16px; }
.erro:empty { display: none; }
.ok { background: #e6f7ef; color: #0b6b3a; border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 0 0 16px; }

/* formulários sobre fundo teal */
.form { display: grid; gap: 20px; margin-top: 28px; }
.form input, .form select { width: 100%; border: 0; border-radius: 10px; padding: 11px 14px; background: var(--claro); color: var(--texto); }
.form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.form label { font-size: 13px; display: grid; gap: 6px; }
.form .btn { margin-top: 12px; }

/* listas */
.secao { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 16px; }
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.lista.alunos { gap: 20px; }
.cartao { display: block; background: var(--teal); color: var(--texto); border-radius: 12px; padding: 12px 14px; text-decoration: none; }
.cartao strong { display: block; font-family: var(--titulo); font-size: 17px; }
.cartao span { display: block; font-size: 13px; }
.alunos .cartao { padding: 10px 12px; }
.vazio { color: #555; font-size: 14px; }

.perfil-topo { text-align: center; margin-bottom: 24px; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--rosa); color: #fff; text-decoration: none; }
.prof { color: var(--rosa); font-family: var(--titulo); font-size: 24px; font-weight: 600; }
.dado { margin-bottom: 18px; }
.dado small { display: block; color: #777; font-size: 12px; }
.sair { background: none; border: 0; color: #555; text-decoration: underline; margin-top: 24px; padding: 0; }

/* fichas do aluno */
.fichas-lista { list-style: none; margin: 0; padding: 0; }
.fichas-lista a { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-bottom: 2px solid var(--rosa); color: var(--rosa); text-decoration: none; font-weight: 600; margin-bottom: 22px; }
.fichas-lista a.feita { color: var(--azul); border-color: var(--azul); }
.fichas-lista .chevron { margin-left: auto; }
.fichas-lista small { font-weight: 400; color: #666; }

/* ficha */
.ficha-cab h1 { font-size: 24px; }
.ficha-cab .nome { font-family: var(--titulo); font-size: 24px; font-weight: 700; }
.ficha-cab input[type=date] { border: 1px solid #b9d7dc; border-radius: 6px; padding: 2px 6px; background: #fff; font-size: 13px; }
.campo-titulo { color: var(--lapis); font-size: 22px; font-weight: 600; border-bottom: 1.5px solid currentColor; opacity: .95; padding-bottom: 4px; margin: 34px 0 6px; }
.ficha-ver .campo-titulo { color: var(--azul); }
.atividade { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }
.atividade legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 10px; }
.atividade p { margin: 0 0 6px; font-size: 14px; color: #33434a; }
.notas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.notas label { position: relative; }
.notas input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.notas span { display: block; text-align: center; padding: 6px 0; border-radius: 8px; background: var(--ficha); font-weight: 500; }
.ficha-ver .notas span { background: transparent; }
.notas input:checked + span { background: var(--azul); color: #fff; }
.ficha-ver .notas input:checked + span { color: var(--texto); }
.notas input:focus-visible + span { outline: 3px solid var(--rosa); outline-offset: 2px; }
.notas input:disabled { cursor: default; }
.escala { font-size: 12px; color: #555; margin-top: 18px; }
.obs { width: 100%; min-height: 130px; margin-top: 30px; border: 0; border-radius: 10px; padding: 12px; background: var(--ficha); resize: vertical; }
.ficha-ver .obs { background: var(--azul); color: var(--escuro); min-height: 0; }
.progresso { font-size: 13px; color: #555; margin-top: 8px; }
.salvar-fixo { position: sticky; bottom: 12px; margin-top: 28px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }

@media print {
  body, body.ficha-ver { background: #fff; }
  .doodles, .voltar, .acoes, .salvar-fixo, .progresso { display: none !important; }
  main { max-width: none; padding: 0; }
  .atividade { break-inside: avoid; }
  .campo-titulo { break-after: avoid; color: #000 !important; }
  .notas span { border: 1px solid #999; background: #fff !important; }
  .notas input:checked + span { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .obs { background: #fff !important; border: 1px solid #999; color: #000 !important; }
}
