/* Login da Produza. Tokens e controles: os mesmos do portal (portal-produza/public/app.css). */
:root {
  --verde-700: #3d7222;
  --verde-800: #2c5518;
  --verde-900: oklch(32% 0.08 137);
  --green-50: oklch(98.2% 0.018 155.826);
  --green-100: oklch(96.2% 0.044 156.743);
  --green-200: oklch(92.5% 0.084 155.995);
  --white: #fff;
  --gray-50: oklch(98.5% 0.002 247.839);
  --gray-100: oklch(96.7% 0.003 264.542);
  --gray-200: oklch(92.8% 0.006 264.531);
  --gray-300: oklch(87.2% 0.01 258.338);
  --gray-500: oklch(55.1% 0.027 264.364);
  --gray-600: oklch(44.6% 0.03 256.802);
  --gray-700: oklch(37.3% 0.034 259.733);
  --gray-800: oklch(27.8% 0.033 256.848);
  --gray-900: oklch(21% 0.034 264.665);
  --red-50: oklch(97.1% 0.013 17.38);
  --red-100: oklch(93.6% 0.032 17.717);
  --red-200: oklch(88.5% 0.062 18.334);
  --red-700: oklch(50.5% 0.213 27.518);
  --red-800: oklch(44.4% 0.177 26.899);
  --red-900: oklch(39.6% 0.141 25.723);
  --fonte: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --r-sm: 0.25rem;
  --r-md: 0.375rem;
  --r-lg: 0.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  color: var(--gray-900); font-family: var(--fonte);
  font-size: 0.875rem; line-height: 1.25rem; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.pular {
  position: absolute; left: -9999px; top: 0.5rem; z-index: 50;
  padding: 0.5rem 0.75rem; border-radius: var(--r-md);
  background: var(--white); color: var(--verde-700); font-weight: 500;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
.pular:focus { left: 0.5rem; outline: 2px solid var(--verde-700); outline-offset: 2px; }

.ico { width: 1rem; height: 1rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 0.875rem; height: 0.875rem; }
.ico-lg { width: 1.25rem; height: 1.25rem; }
.simbolo { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.marca { font-weight: 700; letter-spacing: -0.03em; color: var(--verde-700); text-decoration: none; border-radius: var(--r-sm); }
.marca:focus-visible { outline: 2px solid var(--verde-700); outline-offset: 3px; }

.btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  min-height: 2.25rem; border-radius: var(--r-md);
  font: inherit; font-size: 0.875rem; line-height: 1.25rem; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 150ms, border-color 150ms, color 150ms, opacity 150ms;
}
.btn { padding: 0.375rem 0.75rem; border: 1px solid var(--gray-300); background: var(--white); color: var(--gray-700); font-weight: 500; }
.btn:hover { background: var(--gray-100); }
.btn:active { background: var(--gray-200); }
.btn-primary { padding: 0.5rem 1rem; border: 0; background: var(--verde-700); color: var(--white); font-weight: 600; }
.btn-primary:hover { background: var(--verde-800); }
.btn:focus-visible, .btn-primary:focus-visible { outline: 2px solid var(--verde-700); outline-offset: 2px; }
.btn:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--white); }
.btn-primary:disabled:hover { background: var(--verde-700); }
.btn-sm { min-height: 2rem; padding: 0.25rem 0.625rem; }
.btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.btn[aria-busy="true"] .ico { animation: girar 900ms linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.field {
  display: block; width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--white); color: var(--gray-900);
  font: inherit; font-size: 0.875rem; line-height: 1.25rem; resize: vertical;
}
.field::placeholder { color: var(--gray-500); }
.field:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
.hint { font-size: 0.75rem; line-height: 1rem; color: var(--gray-600); }

.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; line-height: 1rem; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--green-100); color: var(--verde-800); }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-red { background: var(--red-100); color: var(--red-800); }
.hora { font-size: 0.75rem; line-height: 1rem; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.fora { font-weight: 600; color: var(--red-700); }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.75rem 1rem; border: 1px solid; border-radius: var(--r-lg); }
.notice p { flex: 1 1 16rem; }
.notice-red { border-color: var(--red-200); background: var(--red-50); color: var(--red-900); }


/* ---------- acréscimos do login ---------- */
:root {
  --amber-100: oklch(96.2% 0.059 95.617);
  --amber-800: oklch(47.3% 0.137 46.201);
}
h1, h2 { text-wrap: balance; }
label { display: block; margin-bottom: 0.375rem; font-weight: 500; color: var(--gray-800); }
.field:focus { outline: none; border-color: var(--verde-700); box-shadow: 0 0 0 2px color-mix(in oklab, var(--verde-700) 25%, transparent); }
.field[aria-invalid="true"] { border-color: var(--red-700); }
.field[aria-invalid="true"]:focus { box-shadow: 0 0 0 2px color-mix(in oklab, var(--red-700) 25%, transparent); }
.hint { margin-top: 0.375rem; }
.notice { flex-wrap: nowrap; align-items: flex-start; }
.notice .ico { margin-top: 0.0625rem; color: var(--red-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-800); }
.btn .ico, .btn-primary .ico { transition: transform 150ms var(--ease); }
.btn:hover .ico, .btn-primary:hover .ico { transform: translateX(2px); }
.link { color: var(--verde-700); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--verde-800); }
.link:focus-visible { outline: 2px solid var(--verde-700); outline-offset: 2px; border-radius: var(--r-sm); }
.btn-quiet, .btn-danger-quiet {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0.25rem 0.5rem; border: 0; border-radius: var(--r-md);
  background: transparent; font: inherit; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.btn-quiet { color: var(--gray-700); }
.btn-quiet:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-danger-quiet { color: var(--red-700); }
.btn-danger-quiet:hover { background: var(--red-50); }
.btn-quiet:focus-visible { outline: 2px solid var(--verde-700); outline-offset: 1px; }
.btn-danger-quiet:focus-visible { outline: 2px solid var(--red-700); outline-offset: 1px; }

/* ---------- tela de entrada: banner do portal + papel com o formulário ---------- */
body.pag-entrada { background: var(--white); }
.entrada { display: grid; min-height: 100vh; min-height: 100dvh; }
@media (min-width: 56rem) { .entrada { grid-template-columns: minmax(0, 1.1fr) minmax(28rem, 1fr); } }

.entrada-marca {
  --cruz: color-mix(in oklab, var(--white) 45%, transparent);
  --linha: color-mix(in oklab, var(--white) 30%, transparent);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background-color: var(--verde-700); color: var(--white);
  /* cruzes de registro nos quatro cantos, como no banner do portal */
  background-image:
    linear-gradient(var(--cruz), var(--cruz)), linear-gradient(var(--cruz), var(--cruz)),
    linear-gradient(var(--cruz), var(--cruz)), linear-gradient(var(--cruz), var(--cruz)),
    linear-gradient(var(--cruz), var(--cruz)), linear-gradient(var(--cruz), var(--cruz)),
    linear-gradient(var(--cruz), var(--cruz)), linear-gradient(var(--cruz), var(--cruz));
  background-size: 17px 1px, 1px 17px, 17px 1px, 1px 17px, 17px 1px, 1px 17px, 17px 1px, 1px 17px;
  background-position: 10px 18px, 18px 10px, calc(100% - 10px) 18px, calc(100% - 18px) 10px,
    10px calc(100% - 18px), 18px calc(100% - 10px), calc(100% - 10px) calc(100% - 18px), calc(100% - 18px) calc(100% - 10px);
  background-repeat: no-repeat;
}
.banner-frase { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.banner-logo { display: block; padding: 0.875rem 1.25rem; background: var(--white); line-height: 0; }
.banner-logo img { display: block; width: clamp(8rem, 18vw, 14.25rem); height: auto; }
.banner-lema {
  max-width: 15ch; padding-top: 1.5rem; border-top: 1px solid color-mix(in oklab, var(--white) 40%, transparent);
  font-size: clamp(1.75rem, 3.6vw, 3.25rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; color: var(--green-100);
}

.banner-simbolos { display: grid; grid-template-columns: repeat(4, 4.5rem); align-self: flex-start; border-top: 1px solid var(--linha); border-left: 1px solid var(--linha); }
.banner-celula { display: grid; place-items: center; aspect-ratio: 1; border-right: 1px solid var(--linha); border-bottom: 1px solid var(--linha); }
.banner-simbolo { width: 2.5rem; height: 2.5rem; color: var(--green-100); stroke-width: 1.75; }
.banner-celula-vazia {
  background-image: radial-gradient(circle, color-mix(in oklab, var(--white) 55%, transparent) 1.5px, transparent 2px);
  background-size: 0.75rem 0.75rem; background-position: center;
}
/* o único movimento: os símbolos se desenham uma vez ao abrir, um depois do outro */
.banner-simbolo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: desenhar 900ms var(--ease) forwards; }
.banner-celula:nth-child(2) path { animation-delay: 110ms; }
.banner-celula:nth-child(3) path { animation-delay: 220ms; }
.banner-celula:nth-child(4) path { animation-delay: 330ms; }
.banner-celula:nth-child(5) path { animation-delay: 440ms; }
.banner-celula:nth-child(6) path { animation-delay: 550ms; }
.banner-celula:nth-child(7) path { animation-delay: 660ms; }
@keyframes desenhar { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .banner-simbolo path { stroke-dashoffset: 0; animation: none; } }

.entrada-papel { display: flex; flex-direction: column; justify-content: center; gap: 2.5rem; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 6vw, 4rem); }
.entrada-miolo { width: 100%; max-width: 23rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.entrada-titulo { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -0.015em; }
.entrada-texto { color: var(--gray-600); max-width: 60ch; margin-top: -0.75rem; }
.form { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-900); }
.campo-fixo { display: flex; flex-direction: column; gap: 0.125rem; color: var(--gray-900); }
.campo-fixo-rotulo { font-weight: 500; color: var(--gray-800); }
.btn-largo { width: 100%; min-height: 2.75rem; font-size: 1rem; }
.form .btn-largo { margin-top: 0.5rem; }
.entrada-nota { padding-top: 1rem; border-top: 1px solid var(--gray-200); font-size: 0.75rem; line-height: 1.125rem; color: var(--gray-600); }
.entrada-pe { width: 100%; max-width: 23rem; margin: 0 auto; font-size: 0.75rem; line-height: 1rem; color: var(--gray-600); }

@media (max-width: 55.99rem) {
  .entrada-marca { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .entrada-papel { justify-content: flex-start; }
}
@media (max-width: 40rem) {
  .entrada-marca { gap: 1.25rem; }
  .banner-frase { gap: 0.875rem; }
  .banner-logo { padding: 0.625rem 0.875rem; }
  .banner-logo img { width: 7.5rem; }
  .banner-lema { padding-top: 0.875rem; font-size: 1.25rem; }
  .banner-simbolos { grid-template-columns: repeat(8, 1fr); width: 100%; }
  .banner-simbolo { width: 1.5rem; height: 1.5rem; }
  .entrada-papel { padding-top: 1.75rem; }
}

/* ---------- administração ---------- */
body.pag-adm { background: var(--white); }
.adm-topo, .adm { max-width: 72rem; margin: 0 auto; padding-left: clamp(1rem, 4vw, 2.5rem); padding-right: clamp(1rem, 4vw, 2.5rem); }
.adm-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-height: 4.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.adm-marca { display: flex; align-items: center; gap: 0.875rem; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.adm-marca:focus-visible { outline: 2px solid var(--verde-700); outline-offset: 3px; }
.adm-logo { display: block; padding: 0.375rem 0.625rem; background: var(--white); border: 1px solid var(--gray-200); line-height: 0; }
.adm-logo img { width: 5.5rem; height: auto; }
.adm-nome { font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--gray-900); }
.adm-quem { font-size: 0.75rem; line-height: 1rem; color: var(--gray-600); }
.adm { display: flex; flex-direction: column; gap: 3rem; padding-top: 2rem; padding-bottom: 4rem; border-top: 1px solid var(--gray-900); }
.adm section { display: flex; flex-direction: column; gap: 0.75rem; }
.adm-titulo { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.secao-titulo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.contagem { display: inline-grid; place-items: center; min-width: 1.5rem; padding: 0 0.375rem; border-radius: 9999px; background: var(--gray-100); font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.adm-texto { max-width: 70ch; color: var(--gray-600); }
.adm-dica { max-width: 80ch; }
.adm-criar { display: grid; gap: 1rem; align-items: end; max-width: 56rem; }
@media (min-width: 48rem) { .adm-criar { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; } }
.adm-recado { max-width: 40rem; align-items: flex-start; }
.botoes { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.tabela-rolagem { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 0.625rem 0.75rem; background: var(--green-50); text-align: left; white-space: nowrap;
  font-size: 0.75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-600);
}
td { padding: 0.625rem 0.75rem; border-top: 1px solid var(--gray-100); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1rem; }
th:last-child, td:last-child { padding-right: 1rem; }
.col-nome { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.apagado { color: var(--gray-500); }
.acoes { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }
.acoes form { display: contents; }
.linha-ruim td { background: color-mix(in oklab, var(--red-50) 60%, var(--white)); }
.vazio-linha { padding: 2rem 1rem; text-align: center; color: var(--gray-600); }

.senha-provisoria {
  align-self: stretch; padding: 1rem 1.25rem; border: 1px dashed var(--verde-700); background: var(--green-50);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; /* a senha é dado: cada caractere conta */
  font-size: 1.5rem; line-height: 2rem; letter-spacing: 0.06em; color: var(--gray-900); user-select: all; font-variant-ligatures: none;
}

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