/* Cursos SEMEC – visual enxuto (cores da SEMEC: azul-marinho e verde) */
:root {
  --azul: #082358;
  --azul-2: #00447a;
  --verde: #2f7d29;
  --texto: #1f2933;
  --cinza: #5b6670;
  --borda: #dde2e8;
  --fundo: #f4f6f9;
  --erro: #b42318;
  --raio: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--texto); background: var(--fundo); }
a { color: var(--azul-2); }
a:hover { color: var(--azul); }
:focus-visible { outline: 3px solid #f7a941; outline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; color: var(--azul); }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; color: var(--azul); }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
code { background: #eef1f4; padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--cinza); }
.pequeno { font-size: .875rem; }
.num { text-align: right; white-space: nowrap; }

/* Topo e rodapé */
.topo { background: var(--azul); color: #fff; }
.topo .dentro, .rodape .dentro { max-width: 1080px; margin: 0 auto; padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
/* A barra do topo é mais larga que a página: logo, menu, portal, nome e Sair cabem numa linha a partir de 1280 px. */
.topo .dentro { max-width: 1240px; }
.marca { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: .01em; }
.marca:hover { color: #fff; }
/* Logo da Prefeitura (versão branca) e, ao lado, só "CDE". */
.logo-topo { display: block; height: 36px; width: auto; max-width: 48vw; }
.logo-topo + .marca { padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, .35); }
.menu { display: flex; flex-wrap: wrap; gap: .25rem; }
.menu a { color: #d9e2f3; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; }
.menu a:hover, .menu a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.conta { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.conta form { margin: 0; }
.quem { color: #d9e2f3; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botao-sair { background: none; border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 6px; padding: .25rem .7rem; font: inherit; cursor: pointer; }
.botao-sair:hover { background: rgba(255, 255, 255, .14); }
.botao-portal { border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 6px; padding: .25rem .7rem; text-decoration: none; white-space: nowrap; }
.botao-portal:hover { background: rgba(255, 255, 255, .14); color: #fff; }
main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.rodape { color: var(--cinza); font-size: .85rem; border-top: 1px solid var(--borda); }
.rodape .dentro { justify-content: space-between; }
.rodape a { color: var(--cinza); }

/* Blocos */
.cartao { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.25rem; margin: 0 0 1rem; }
.cartao > :last-child { margin-bottom: 0; }
.destaque-borda { border-left: 4px solid var(--verde); }
.estreito { max-width: 560px; }
.aviso-central { max-width: 640px; margin: 2rem auto; }
.cabecalho-secao { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cabecalho-secao h1, .cabecalho-secao h2 { margin: 0; }
.migalhas { font-size: .875rem; color: var(--cinza); margin-bottom: .5rem; }
.acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
td.acoes { display: table-cell; white-space: nowrap; }
td.acoes > * { display: inline-block; margin: .15rem .35rem .15rem 0; vertical-align: middle; }
.zona-perigo { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px dashed var(--borda); }
details.cartao > summary { cursor: pointer; list-style-position: inside; }
details.cartao > summary h2 { display: inline; }
details.cartao[open] > summary { margin-bottom: .75rem; }
form.incluir { display: inline-flex; gap: .4rem; align-items: center; }
form.incluir select { width: auto; max-width: 14rem; padding: .3rem .5rem; }
form.alerta.acoes { justify-content: space-between; }
.lista-simples { margin: 0; padding-left: 1.2rem; }

/* Página inicial */
.capa { background: #fff; border: 1px solid var(--borda); border-top: 5px solid var(--verde); border-radius: var(--raio); padding: 2rem 1.5rem; margin-bottom: 1rem; }
.capa h1 { font-size: 1.9rem; }
.boas-vindas { max-width: 760px; margin: 1rem auto; }
.logo-boas-vindas { display: block; height: 48px; width: auto; max-width: 100%; margin-bottom: 1.5rem; }
.boas-vindas .sobre-curso { color: var(--verde); font-weight: 600; margin-top: -.25rem; }
.boas-vindas .prosa { font-size: 1.05rem; }
.destaque { font-size: 1.05rem; max-width: 70ch; }
.capa h2 { margin-top: 1.75rem; }
.capa .btn-google { margin-top: .25rem; }
.btn-google { display: inline-flex; align-items: center; gap: .65rem; padding: .65rem 1.3rem; border: 1px solid #747775; border-radius: 999px; background: #fff; color: #1f1f1f; font-weight: 600; text-decoration: none; }
.btn-google:hover { background: #f2f5fa; color: #1f1f1f; }
.lista-modulos { margin: 0; padding-left: 1.4rem; }
.lista-modulos li { padding: .3rem 0; }
.lista-modulos li span + span { margin-left: .5rem; }

/* Botões e formulários */
.btn { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--azul); border-radius: 8px; background: #fff; color: var(--azul); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.btn:hover { background: #eef2fa; color: var(--azul); }
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: var(--azul-2); color: #fff; }
.btn-perigo { border-color: var(--erro); color: var(--erro); }
.btn-perigo:hover { background: #fdecea; color: var(--erro); }
.btn-pequeno { padding: .3rem .65rem; font-size: .875rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.campo { margin-bottom: 1rem; }
label, legend { display: block; font-weight: 600; margin-bottom: .3rem; }
.campo small { display: block; margin-top: .25rem; color: var(--cinza); font-size: .85rem; }
input[type=text], input[type=date], input[type=number], select, textarea { width: 100%; padding: .55rem .7rem; border: 1px solid #c3cbd4; border-radius: 8px; font: inherit; color: inherit; background: #fff; }
textarea { resize: vertical; }
.linha { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.linha > .campo { flex: 1 1 220px; }
.campo-curto { max-width: 260px; }
.linha-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.linha-form input { flex: 1 1 260px; width: auto; }
.linha-form.quantidade { align-items: center; margin: 0 0 1rem; }
.linha-form.quantidade label { margin: 0; }
.linha-form.quantidade input { flex: 0 0 5.5rem; }
.marcar { display: flex; gap: .5rem; align-items: center; font-weight: 400; }

/* Mensagens e selos */
.alerta { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alerta-ok { background: #ecf7ea; border-color: #b8dfb2; color: #1e5e19; }
.alerta-erro { background: #fdecea; border-color: #f4c2bd; color: #8a1c12; }
.alerta-aviso { background: #fff6e0; border-color: #f2d48a; color: #6b4600; }
.selo { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eceff3; color: #3b4651; white-space: nowrap; }
.selo-ok { background: #e3f3e1; color: #1e5e19; }
.selo-aviso { background: #fff1d1; color: #6b4600; }
.selo-erro { background: #fdecea; color: #8a1c12; }

/* Tabelas */
.tabela { overflow-x: auto; position: relative; } /* position: rótulos .sr-only dentro da tabela não alargam a página */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--borda); vertical-align: middle; }
thead th { font-size: .82rem; color: var(--cinza); font-weight: 600; }
th.num, td.num { text-align: right; }
tr.total th, tr.total td { font-weight: 700; border-bottom: 0; }
table.notas td, table.notas th { padding: .45rem .4rem; }
.a-corrigir { font-weight: 700; color: #6b4600; }

/* Resumo em números */
.resumo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.numero { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem 1rem; color: inherit; text-decoration: none; }
.numero strong { font-size: 1.6rem; color: var(--azul); line-height: 1.2; }
.numero span { color: var(--cinza); font-size: .875rem; }
a.numero:hover { border-color: var(--azul-2); }

/* Módulos (aluno) */
.modulos { list-style: none; margin: 0; padding: 0; }
.modulo { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem 1rem; margin-bottom: .6rem; }
.titulo-modulo { font-weight: 600; }
.modulo.bloqueado { background: #f9fafb; }
.modulo.bloqueado .titulo-modulo { color: var(--cinza); }

/* Conteúdo de estudo */
.prosa { line-height: 1.65; }
.prosa h2 { margin-top: 1.5rem; }
.prosa h2:first-child { margin-top: 0; }
.prosa li { margin-bottom: .25rem; }
.prosa table { margin: 1rem 0; }
.prosa img { max-width: 100%; height: auto; }
.prosa iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* Editor de questões */
.questao { border: 1px solid var(--borda); border-radius: 8px; margin-bottom: .5rem; background: #fbfcfd; padding: 0 .8rem; }
.questao > summary { cursor: pointer; padding: .6rem .8rem; margin: 0 -.8rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.questao[open] > summary { border-bottom: 1px solid var(--borda); }
.questao > label { margin-top: .75rem; }
.previa { color: var(--cinza); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.alternativas { border: 0; padding: 0; margin-top: .75rem; margin-bottom: .8rem; }
.alternativa { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.alternativa .letra { margin: 0; min-width: 1.6rem; }
.alternativa input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--verde); }
.enunciado { white-space: pre-wrap; }
.resposta-aluno { white-space: pre-wrap; background: #f7f9fb; border: 1px solid var(--borda); border-radius: 8px; padding: .9rem 1rem; margin-bottom: 1rem; }

/* Editor de texto (Toast UI) */
.editor-visual { margin-bottom: .25rem; }

/* Certificado */
.certificado { background: #fff; border: 8px double var(--azul); padding: 2.5rem 3rem; max-width: 980px; margin: 0 auto; }
.logo-certificado { display: block; height: 56px; width: auto; max-width: 100%; margin: 0 auto 1.75rem; }
.texto-certificado { font-size: 1.15rem; line-height: 1.8; text-align: justify; }
.texto-certificado p:first-child { text-align: center; font-weight: 700; color: var(--azul); line-height: 1.5; margin-bottom: 2rem; }
.local-data { text-align: right; margin: 2rem 0 3rem; }
.assinatura { display: flex; flex-direction: column; align-items: center; text-align: center; }
.linha-assinatura { width: 340px; max-width: 100%; border-top: 1px solid var(--texto); margin-bottom: .4rem; }
.codigo { margin-top: 2.5rem; font-size: .8rem; color: var(--cinza); text-align: center; }

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .capa { padding: 1.4rem 1rem; }
  .capa h1 { font-size: 1.5rem; }
  .cartao { padding: 1rem; }
  .resumo { gap: .5rem; }
  .numero { padding: .7rem .75rem; }
  .numero strong { font-size: 1.3rem; }
  .numero span { font-size: .8rem; }
  .conta { margin-left: 0; width: 100%; justify-content: space-between; }
  .certificado { padding: 1.25rem; }
  .texto-certificado { font-size: 1.05rem; text-align: left; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .nao-imprimir { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  /* ocupa a folha inteira (A4 deitada menos as margens), com o texto centralizado na altura */
  .certificado { border-width: 6px; max-width: none; height: 184mm; padding: 10mm 18mm; display: flex; flex-direction: column; justify-content: center; break-inside: avoid; }
  .logo-certificado { height: 15mm; margin-bottom: 7mm; }
  .texto-certificado { font-size: 14pt; line-height: 1.75; text-align: justify; }
  .local-data { font-size: 12.5pt; margin: 1.25rem 0 2.5rem; }
  .assinatura { font-size: 12pt; }
  .codigo { margin-top: 1.75rem; font-size: 9pt; }
}

/* Portal da CDE: escolha entre o Instrumento Controle e o curso, depois do login (sem menu, rodapé, saudação nem descrições). */
.escolha { min-height: calc(100vh - 4rem); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; text-align: center; }
.escolha-sistemas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; width: min(640px, 100%); }
.sistema { display: flex; align-items: center; justify-content: center; min-height: 6rem; padding: 1.25rem; border: 1px solid var(--borda); border-top: 5px solid var(--azul-2); border-radius: var(--raio); background: #fff; color: var(--azul); font-size: 1.2rem; font-weight: 700; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.sistema:hover { box-shadow: 0 6px 18px rgba(8, 35, 88, .12); transform: translateY(-2px); color: var(--azul); }
