/* App da carteirinha — tela cheia no celular. Mesmas cores e mesma linguagem do portal:
   formas retas, cantos levemente arredondados, a cruz do logo como único ornamento. */
:root {
  --verde: #009142; --verde-escuro: #00702c; --floresta: #0f3320; --floresta-2: #174a2e;
  --oliva: #afc376; --oliva-claro: #e6edd3; --papel: #f4f6f1; --texto: #1b2a21; --texto-suave: #4b5c51;
  --linha: #d5ddd1; --erro: #b3261e;
  --serifa: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.app {
  background: var(--floresta); color: #fff; font: 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--oliva); outline-offset: 2px; }
[hidden] { display: none !important; }

.app__tela { min-height: 100vh; min-height: 100dvh; padding: 24px 20px 32px; }
.app__tela--centro { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; max-width: 420px; margin: 0 auto; }
.app__logo { width: 150px; height: auto; margin-bottom: 8px; }
.app__suave { color: #b9c9ae; }
.app__titulo-claro { font-family: var(--serifa); font-weight: 600; font-size: 1.9rem; line-height: 1.15; margin: 0 0 8px; }
.app__texto-claro { color: #dfe8d6; margin: 0 0 12px; }
.app__nota-claro { color: #b9c9ae; font-size: .88rem; margin-top: 8px; }
.app__links-claros a { color: #fff; }

.app__entrar { width: 100%; text-align: left; }
.app__campo { display: block; font-weight: 600; margin-bottom: 14px; font-size: .95rem; }
.app__campo input {
  display: block; width: 100%; margin-top: 6px; min-height: 50px; padding: 10px 14px; font: 1.05rem var(--sans);
  border: 1px solid #b8c4b5; border-radius: 6px; background: #fff; color: var(--texto);
}
.app__campo--escuro input { border-color: transparent; }
.app__campo input:focus { outline: none; box-shadow: 0 0 0 3px rgba(175, 195, 118, .6); }
.app__ajuda { font-size: .88rem; color: var(--texto-suave); margin: -6px 0 14px; }
.app__ajuda--claro { color: #b9c9ae; }
.app__ajuda--alerta { color: #8a5a00; }
.app__erro { color: var(--erro); font-size: .92rem; margin: -6px 0 12px; }
.app__erro--claro { color: #ffd2cc; margin: 0 0 12px; }

.app__botao {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 18px;
  border-radius: 6px; border: 2px solid transparent; font: 700 1.05rem var(--sans); text-decoration: none; cursor: pointer;
  background: var(--verde); color: #fff;
}
.app__botao--claro { background: #fff; color: var(--floresta); }
.app__botao--linha { background: transparent; border-color: var(--oliva); color: #fff; }
.app__botao:disabled { opacity: .6; }
.app__acoes-coluna { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 8px; }

/* ---------- carteirinha vertical ---------- */
.app__tela--cartao { max-width: 440px; margin: 0 auto; padding: 14px 14px 28px; }
.cid { background: #fff; color: var(--texto); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); text-align: center; }
.cid__topo { background: var(--floresta-2); display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: #fff; }
.cid__topo img { width: 82px; height: auto; display: block; }
.cid__topo span { font-family: var(--serifa); font-size: 1.05rem; }
.cid__foto-moldura {
  width: 56%; margin: 22px auto 14px; aspect-ratio: 3 / 4; position: relative;
  padding: 5px; border: 1px solid var(--oliva); border-radius: 12px; background: #fff;
}
.cid__foto { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--papel); border-radius: 8px; }
/* selo com a cruz do logo no canto da foto */
.cid__foto-moldura::after {
  content: ""; position: absolute; right: -10px; bottom: -10px; width: 30px; height: 30px; border-radius: 7px;
  background:
    linear-gradient(#fff, #fff) center / 16% 56% no-repeat,
    linear-gradient(#fff, #fff) center / 56% 16% no-repeat,
    var(--verde);
  box-shadow: 0 0 0 3px #fff;
}
.cid__nome { font-family: var(--serifa); font-weight: 600; font-size: 1.65rem; line-height: 1.15; color: var(--floresta); margin: 0 18px 2px; overflow-wrap: anywhere; }
.cid__curso { margin: 0 0 14px; color: var(--texto-suave); font-weight: 600; }
.cid__dados { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 14px; border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha); }
.cid__dados div { padding: 10px 4px; }
.cid__dados div + div { border-left: 1px solid var(--linha); }
.cid__dados dt { font-size: .72rem; color: var(--texto-suave); }
.cid__dados dd { margin: 2px 0 0; font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; }

/* faixa "ao vivo": hora correndo e trama de cruzes se movendo, para quem confere saber que não é um print */
.cid__vivo {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 14px 0; padding: 8px 10px;
  border-radius: 6px; background: var(--oliva-claro); color: var(--floresta); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  overflow: hidden;
}
.cid__vivo::before {
  content: ""; position: absolute; inset: 0; opacity: .2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M11 7v8M7 11h8' stroke='%23009142' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 22px 22px; animation: trama 5s linear infinite;
}
.cid__vivo span { position: relative; }
.cid__ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--verde); animation: pulso 1.2s ease-in-out infinite; }
@keyframes trama { to { background-position: 44px 0; } }
@keyframes pulso { 50% { opacity: .25; transform: scale(.7); } }
.app--offline .cid__ponto { background: #c08a00; }

.cid__qr-area { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px 10px; }
.cid__qr { width: 112px; height: 112px; flex: none; display: grid; place-items: center; font-size: .75rem; color: var(--texto-suave); text-align: center; }
.cid__qr svg { width: 100%; height: 100%; display: block; }
.cid__codigo { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; letter-spacing: .08em; color: var(--floresta); font-variant-numeric: tabular-nums; }
.cid__instrucao { margin: 0; font-size: .8rem; color: var(--texto-suave); line-height: 1.4; }
.cid__rodape { font-size: .7rem; color: var(--texto-suave); padding: 8px 14px 12px; border-top: 1px solid var(--oliva-claro); }

.app__estado { text-align: center; font-size: .85rem; color: #cfdcc6; margin: 14px 4px 10px; }
.app--offline .app__estado { color: #ffe08a; }
.app__menu { display: grid; gap: 8px; }
.app__menu-item {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 6px; border: 1px solid rgba(175, 195, 118, .55);
  background: transparent; color: #fff; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
}
.app__menu-item:first-child { background: var(--floresta-2); }
.app__dica { margin-top: 14px; background: #fff8e1; color: #4a3b00; border-radius: 8px; padding: 12px 14px; font-size: .9rem; }
.app__dica p { margin: 0 0 8px; }
.app__dica-fechar { background: none; border: 0; padding: 0; color: #4a3b00; font: 600 .9rem var(--sans); text-decoration: underline; cursor: pointer; }

/* ---------- Meus dados ---------- */
body.app--conta { background: var(--papel); color: var(--texto); }
.app__barra { background: var(--floresta); padding: 14px 18px; }
.app__voltar { color: #fff; font-weight: 600; text-decoration: none; }
.app__voltar::before { content: "‹ "; font-size: 1.2em; }
.app__conteudo { max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; }
.app__titulo { font-family: var(--serifa); font-weight: 600; font-size: 2rem; color: var(--floresta); margin: 4px 0 14px; }
.app__bloco { background: #fff; border: 1px solid var(--linha); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.app__bloco h2 { font-size: 1.05rem; margin: 0 0 12px; }
.app__fotos { display: flex; gap: 14px; margin-bottom: 12px; }
.app__fotos figure { margin: 0; text-align: center; font-size: .8rem; color: var(--texto-suave); }
.app__fotos img { width: 96px; height: 128px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linha); display: block; margin-bottom: 4px; }
.app__arquivo { display: block; border: 2px dashed #b8c4b5; border-radius: 8px; padding: 14px; text-align: center; font-weight: 600; color: var(--verde-escuro); margin-bottom: 10px; cursor: pointer; }
.app__arquivo input { display: block; width: 100%; margin-top: 8px; font: .9rem var(--sans); color: var(--texto); }
.app__dados { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; }
.app__dados dt { color: var(--texto-suave); }
.app__dados dd { margin: 0; font-weight: 600; }
.app__aviso { padding: 10px 14px; border-radius: 8px; background: #e5f3ea; border-left: 4px solid var(--verde); margin: 0 0 14px; }
.app__aviso--erro { background: #fbeceb; border-color: var(--erro); color: #6d1611; }
.app__rodape { text-align: center; font-size: .9rem; margin-top: 18px; }
.app__rodape a { color: var(--verde-escuro); }

@media (prefers-reduced-motion: reduce) { .cid__vivo::before, .cid__ponto { animation: none; } }

/* girar a foto antes de enviar (Meus dados) */
.foto-girar { margin: 10px 0 12px; text-align: center; }
.foto-girar canvas { display: block; width: 150px; height: 200px; margin: 0 auto; border: 1px solid var(--linha); border-radius: 8px; background: #fff; }
.foto-girar__botoes { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.foto-girar__botoes button { flex: 1; max-width: 200px; min-height: 46px; border: 2px solid var(--verde); background: #fff; color: var(--verde-escuro); border-radius: 6px; font: 700 .95rem var(--sans); cursor: pointer; }
.foto-girar__dica { font-size: .85rem; color: var(--texto-suave); margin: 8px 0 0; }
