/* Portal ACTA — base e camada responsiva.
   O desenho veio de uma prancheta de 1440px, com estilos inline em px fixo.
   Estes tokens e media queries são o que transforma aquilo em layout fluido:
   o markup usa var(--shell) e var(--gutter), e os grids são corrigidos aqui. */

:root {
  --navy: #050F2E;
  --ink: #0A1B45;
  --paper: #F2F1ED;
  --paper-2: #E9E7E0;
  --amber: oklch(0.62 0.14 55);

  /* Largura útil: acompanha o monitor em vez de travar em 1240px. */
  --shell: min(1860px, 93vw);
  --gutter: clamp(18px, 2.4vw, 52px);
}

html, body { margin: 0; padding: 0; background: var(--paper); }
* { box-sizing: border-box; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--amber); }
::selection { background: var(--ink); color: var(--paper); }

@keyframes actaUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes actaFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes actaMarquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 17px)); } }
@keyframes actaPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes actaLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ── Responsivo ────────────────────────────────────────────────────────────
   Os grids vivem em atributos style inline, então a correção precisa vir por
   seletor de atributo + !important — é o único jeito de vencer o inline sem
   reescrever as 800 linhas de markup à mão. */

/* Notebook / tablet largo: três colunas viram duas */
@media (max-width: 1180px) {
  [style*="repeat(3,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="1.4fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
  [style*="96px 1fr 220px"] { grid-template-columns: 88px 1fr !important; }
}

/* Tablet e celular: tudo empilha */
@media (max-width: 900px) {
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: clamp(24px, 5vw, 40px) !important;
  }

  /* Cabeçalho: a barra de 74px não cabe com o menu inteiro */
  header [style*="height:74px"] {
    height: auto !important;
    flex-wrap: wrap;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    gap: 14px !important;
  }
  header nav {
    order: 3;
    width: 100%;
    gap: 22px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  header nav::-webkit-scrollbar { display: none; }
}

/* Celular: respiro vertical menor, o desenho foi feito para tela cheia */
@media (max-width: 560px) {
  /* Cabeçalho de seção (título + atalho à direita) não cabe lado a lado */
  [style*="justify-content:space-between"] {
    flex-wrap: wrap;
    gap: 10px;
  }

  [style*="padding:76px"], [style*="padding:80px"], [style*="padding:90px"] {
    padding-top: 44px !important;
    padding-bottom: 48px !important;
  }
}

/* ── Login / cadastro ─────────────────────────────────────────────────────
   Única tela que não veio da prancheta: escrita direto no vocabulário da
   marca (navy sólido, régua mono, serifada no título). */

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 74px);
}
.auth-aside {
  background: var(--navy);
  color: var(--paper);
  padding: clamp(40px, 6vw, 96px) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}
.auth-panel {
  padding: clamp(40px, 5vw, 88px) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.auth-form { width: 100%; max-width: 420px; }

.auth-tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid rgba(10, 27, 69, .14);
  margin-bottom: 34px;
}
.auth-tab {
  background: none;
  border: 0;
  padding: 0 0 14px;
  margin-bottom: -1px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .16em;
  color: rgba(10, 27, 69, .5);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .2s ease;
}
.auth-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.auth-field { margin-bottom: 22px; }
.auth-field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(10, 27, 69, .55);
  margin-bottom: 8px;
}
.auth-field input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(10, 27, 69, .25);
  padding: 10px 0;
  font-family: Archivo, sans-serif;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s ease;
}
.auth-field input:focus { border-bottom-color: var(--ink); }
.auth-field input::placeholder { color: rgba(10, 27, 69, .3); }

.auth-submit {
  width: 100%;
  margin-top: 8px;
  background: var(--navy);
  color: var(--paper);
  border: 0;
  padding: 16px;
  font-family: Archivo, sans-serif;
  font-size: 14.5px;
  letter-spacing: .02em;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, opacity .2s ease;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-2px); background: var(--ink); }
.auth-submit:disabled { opacity: .55; cursor: progress; transform: none; }

.auth-msg {
  margin-top: 20px;
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  border-left: 2px solid;
  animation: actaFade .25s ease both;
}
.auth-msg[data-tone="erro"] { border-color: oklch(.62 .17 25); background: oklch(.62 .17 25 / .07); }
.auth-msg[data-tone="ok"] { border-color: oklch(.55 .12 150); background: oklch(.55 .12 150 / .08); }
.auth-msg[data-tone="aviso"] { border-color: var(--amber); background: oklch(.62 .14 55 / .09); }

.auth-alt {
  margin-top: 26px;
  font-size: 13px;
  color: rgba(10, 27, 69, .6);
}
.auth-alt button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
  border-bottom: 1px solid rgba(10, 27, 69, .35);
  cursor: pointer;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr !important; min-height: 0; }
  .auth-aside { order: 2; }
}

/* ── Redação e painel ─────────────────────────────────────────────────────
   Telas internas: fundo navy, campos discretos, tipografia mono nos rótulos. */

.ed-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  opacity: .5;
}

.ed-campo {
  width: 100%;
  margin-top: 10px;
  background: rgba(242, 241, 237, .06);
  border: 1px solid rgba(242, 241, 237, .18);
  color: #F2F1ED;
  font-family: Archivo, sans-serif;
  font-size: 15px;
  padding: 13px 15px;
  outline: none;
  resize: vertical;
  transition: border-color .2s ease;
}
.ed-campo:focus { border-color: rgba(242, 241, 237, .55); }
.ed-campo::placeholder { color: rgba(242, 241, 237, .32); }
.ed-mono { font-family: 'JetBrains Mono', monospace; font-size: 13.5px; line-height: 1.55; }
.ed-serif { font-family: Newsreader, Georgia, serif; }

/* O select nativo herda o fundo do sistema no menu aberto; forçamos as opções
   para não virarem texto claro sobre fundo claro. */
select.ed-campo option { background: #050F2E; color: #F2F1ED; }

.ed-btn {
  font-family: Archivo, sans-serif;
  font-size: 13px;
  padding: 11px 22px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .22s ease, background .22s ease, opacity .2s ease;
}
.ed-btn:disabled { opacity: .5; cursor: progress; transform: none; }
.ed-btn-ghost { background: transparent; border: 1px solid rgba(242, 241, 237, .3); color: #F2F1ED; }
.ed-btn-ghost:hover:not(:disabled) { background: rgba(242, 241, 237, .08); }
.ed-btn-solid { background: #F2F1ED; border: 1px solid #F2F1ED; color: #050F2E; font-weight: 500; }
.ed-btn-solid:hover:not(:disabled) { transform: translateY(-2px); }

.ed-msg {
  margin-top: 22px;
  padding: 13px 16px;
  font-size: 13.5px;
  border-left: 2px solid;
  animation: actaFade .25s ease both;
}
.ed-msg[data-tone="erro"] { border-color: #F2A78C; background: rgba(242, 167, 140, .1); }
.ed-msg[data-tone="ok"] { border-color: #7FD8A6; background: rgba(127, 216, 166, .1); }

.pn-aba {
  background: none;
  border: 0;
  padding: 0 0 14px;
  margin-bottom: -1px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: rgba(242, 241, 237, .45);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .2s ease;
}
.pn-aba[aria-selected="true"] { color: #F2F1ED; border-bottom-color: #F2F1ED; }

@media (max-width: 900px) {
  .pn-aba { font-size: 10px; }
}
