/* ── Agrotech Tools – CSS global ─────────────────────────────────── */

/* Variáveis de marca */
:root {
  --at-orange:      #BF4000;
  --at-orange-light:#E86020;
  --at-orange-pale: #FFF0E0;
  --at-dark:        #1a1a1a;
  --at-dark-soft:   #2c2c2c;
  --at-gray:        #f4f6f9;

  /* Override Bootstrap primary → laranja Agrotech */
  --bs-primary:             #BF4000;
  --bs-primary-rgb:         191, 64, 0;
  --bs-link-color:          #BF4000;
  --bs-link-hover-color:    #8C2D00;
}

/* ── Geral ──────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  background-color: #f4f6f9;
  font-size: 0.93rem;
}

/* Scrollbar customizada */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(191,64,0,.35) transparent;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(191,64,0,.30);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(191,64,0,.50); }

/* Force Bootstrap primary overrides */
.bg-primary           { background-color: var(--at-orange)  !important; }
.text-primary         { color: var(--at-orange)             !important; }
.border-primary       { border-color: var(--at-orange)      !important; }
.btn-primary          { background-color: var(--at-orange); border-color: var(--at-orange); }
.btn-primary:hover    { background-color: #8C2D00; border-color: #8C2D00; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(191,64,0,.30); }
.btn-primary:focus,
.btn-primary:active   { background-color: #8C2D00; border-color: #8C2D00; box-shadow: 0 0 0 0.2rem rgba(191,64,0,.35); }
.btn-outline-primary  { color: var(--at-orange); border-color: var(--at-orange); }
.btn-outline-primary:hover { background-color: var(--at-orange); border-color: var(--at-orange); color:#fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(191,64,0,.25); }
.bg-primary-subtle    { background-color: var(--at-orange-pale) !important; }

/* Transição suave global para botões */
.btn {
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--at-orange);
  box-shadow: 0 0 0 0.18rem rgba(230,81,0,.18);
}

/* Foco acessível para elementos interativos */
a:focus-visible,
button:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--at-orange);
  outline-offset: 2px;
}

/* ── Animações utilitárias ───────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out both;
}
.animate-fade-in {
  animation: fadeIn 0.3s ease-out both;
}

/* ── Navbar (base.html) ─────────────────────────────────────────── */
.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
nav.navbar.bg-primary {
  background: linear-gradient(135deg, var(--at-dark) 0%, var(--at-dark-soft) 100%) !important;
  border-bottom: 3px solid var(--at-orange);
}

/* ── Cards de ferramenta (index) ─────────────────────────────────  */
.card-ferramenta {
  border-radius: 12px !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  border-top: 3px solid transparent !important;
  overflow: hidden;
}
.card-ativa {
  cursor: pointer;
}
.card-ativa:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
  border-top-color: var(--at-orange) !important;
}
.card-breve {
  opacity: 0.60;
  filter: grayscale(0.15);
}
.card-breve:hover {
  opacity: 0.78;
  filter: grayscale(0);
}
.icone-ferramenta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto;
  transition: transform 0.2s ease;
}
.card-ativa:hover .icone-ferramenta {
  transform: scale(1.08);
}

/* ── Formulário ─────────────────────────────────────────────────── */
.card {
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.card-header {
  border-radius: 10px 10px 0 0 !important;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

label.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
}
label.required::after {
  content: " *";
  color: #dc3545;
}

/* ── Testemunha card ────────────────────────────────────────────── */
.witness-card {
  background-color: #fafbfc;
  border-color: #dee2e6 !important;
  transition: box-shadow 0.15s;
}
.witness-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.witness-card input[data-field="role"] {
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px dashed #adb5bd;
  background-color: transparent;
  color: var(--at-orange);
}
.witness-card input[data-field="role"]:focus {
  border-style: solid;
  background-color: #fff;
}
.witness-card .form-label.small {
  color: #6c757d;
  font-size: 0.76rem;
}

/* ── Botão gerar ────────────────────────────────────────────────── */
.btn-primary.btn-lg {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  font-size: 0.78rem;
}

/* ══════════════════════════════════════════════════════════════════
   SHELL – Sistema de Abas
══════════════════════════════════════════════════════════════════ */

/* O html/body da shell ocupa a tela inteira */
html:has(.shell-body),
.shell-body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.shell-body {
  display: flex;
  flex-direction: column;
  background: #f4f6f9;
}

/* ── Barra superior ─────────────────────────────────────────────── */
.shell-topbar {
  display: flex;
  align-items: stretch;
  height: 48px;
  min-height: 48px;
  background: var(--at-dark);
  border-bottom: 3px solid var(--at-orange);
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
  z-index: 1030;
  flex-shrink: 0;
  /* overflow: visible permite que o dropdown apareça abaixo da barra */
  overflow: visible;
  position: relative;
}

/* ── Marca / logo ───────────────────────────────────────────────── */
.shell-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  white-space: nowrap;
}
.shell-brand:hover { background: rgba(255,255,255,.08); }

.shell-brand .brand-logo-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.shell-brand .brand-logo {
  width: auto;
  height: 40px;
  object-fit: contain;
  display: block;
}
.shell-brand .brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.shell-brand .brand-name span:first-child {
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
}
.shell-brand .brand-name span:last-child {
  font-size: .62rem;
  color: var(--at-orange-light);
  font-weight: 400;
  letter-spacing: .02em;
}

/* ── Aba fixa (Menu) ────────────────────────────────────────────── */
#fixedTabArea {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  padding: 0 2px;
}

/* ── Área de abas rolantes (flex: 1 absorve o espaço disponível) ── */
.shell-tabs-area {
  flex: 1 1 0;        /* cresce para preencher; pode encolher */
  min-width: 0;       /* permite encolher abaixo do conteúdo  */
  display: flex;
  align-items: stretch;
  overflow: hidden;   /* abas não saem desta área             */
}

/* ── Botões de scroll < > ───────────────────────────────────────── */
.shell-scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.shell-scroll-btn:hover {
  color: var(--at-orange-light);
  background: rgba(255,255,255,.1);
}

/* ── Faixa de abas (dentro da área de scroll) ───────────────────── */
.shell-tab-strip {
  display: flex;
  align-items: flex-end;
  flex: 1 1 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 0 2px;
  gap: 2px;
}
.shell-tab-strip::-webkit-scrollbar { display: none; }

/* ── Aba individual ─────────────────────────────────────────────── */
.shell-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px 0 10px;
  height: 38px;
  margin-top: auto;
  min-width: 100px;
  max-width: 180px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.75);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 0.78rem;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  position: relative;
}
.shell-tab:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.shell-tab.active {
  background: #f4f6f9;
  color: var(--at-orange);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--at-orange);
}
/* Aba fixada (Menu) */
.shell-tab.pinned {
  min-width: 80px;
  max-width: 110px;
}
.shell-tab.pinned.active {
  border-left: 2px solid var(--at-orange);
}

.tab-icon { font-size: 0.82rem; flex-shrink: 0; }
.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tab-close-btn {
  background: none;
  border: none;
  color: inherit;
  padding: 1px 2px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.1s, background 0.1s;
}
.tab-close-btn:hover { opacity: 1; background: rgba(0,0,0,.12); }
.shell-tab.active .tab-close-btn:hover { background: rgba(230,81,0,.15); }
.tab-recovery-spinner {
  display: none;
  color: #f0ad4e;
  margin-left: 2px;
  font-size: 0.85rem;
}
.shell-tab.recovering .tab-recovery-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shell-tab.recovering .tab-recovery-spinner i {
  animation: agrotechSpin 0.9s linear infinite;
}
.shell-tab.recovering .tab-icon {
  opacity: 0.45;
}

@keyframes agrotechSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Banner de rede offline dentro de abas ─────────────────────── */
.agrotech-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #d32f2f;
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  animation: agrotechSlideDown 0.3s ease-out;
}

@keyframes agrotechSlideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* ── Overlay de sessão expirada ─────────────────────────────────── */
/* Fica acima dos modais do Bootstrap (z-index 1055) para cobrir a aba inteira,
   preservando por baixo tudo que o usuário já havia preenchido. */
.agrotech-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  padding: 16px;
  animation: agrotechFadeIn 0.25s ease-out;
}

.agrotech-session-overlay.d-none { display: none !important; }

.agrotech-session-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.agrotech-session-icon {
  font-size: 2.2rem;
  color: #1a237e;
  display: block;
  margin-bottom: 10px;
}

.dark-theme .agrotech-session-card { background: #1e1e2e; color: #e8e8e8; }

@keyframes agrotechFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Banner de rede offline na shell ───────────────────────────── */
.shell-offline-bar {
  background: #d32f2f;
  color: #fff;
  text-align: center;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  animation: agrotechSlideDown 0.3s ease-out;
}

/* ── Controles (tema + usuário) — ficam sempre no lado direito ──── */
.shell-controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;       /* nunca encolhe nem sai da tela */
  padding: 0 14px 0 4px;
  border-left: 1px solid rgba(255,255,255,.12);
  gap: 0;
}

/* ── Conteúdo (iframes) ─────────────────────────────────────────── */
.shell-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.shell-iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   SHELL – Responsividade mobile
══════════════════════════════════════════════════════════════════ */

/* Tablet (≤768px): esconde texto do brand, mantém logo */
@media (max-width: 768px) {
  .shell-brand .brand-name { display: none; }
  .shell-brand { padding: 0 8px; gap: 0; border-right: 1px solid rgba(255,255,255,.10); }
  .shell-tab { min-width: 72px; max-width: 130px; font-size: 0.74rem; }
  .shell-controls { padding: 0 8px 0 4px; }
}

/* Mobile pequeno (≤576px): comprime bastante */
@media (max-width: 576px) {
  .shell-topbar { height: 48px; min-height: 48px; }
  .shell-brand .brand-logo { height: 28px; }
  .shell-brand { padding: 0 6px; }
  /* Abas só mostram ícone no mobile – label some */
  .shell-tab .tab-label { display: none; }
  .shell-tab { min-width: 38px; max-width: 44px; padding: 0 6px; gap: 0; }
  .shell-tab.pinned { min-width: 44px; max-width: 52px; padding: 0 8px; }
  .shell-tab.pinned .tab-label { display: inline; font-size: 0.70rem; }
  .tab-close-btn { font-size: 0.85rem; padding: 1px 1px; }
  /* Esconde o toggle de tema no mobile */
  .shell-controls .form-check { display: none !important; }
  /* Esconde nome do usuário – só ícone */
  .shell-controls .d-none.d-md-inline { display: none !important; }
  /* Reduz padding dos controles */
  .shell-controls { padding: 0 6px 0 4px; gap: 0; }
}

/* Mobile muito pequeno (≤400px) */
@media (max-width: 400px) {
  .shell-brand .brand-logo { height: 24px; }
  .shell-brand { padding: 0 4px; }
  .shell-tab { min-width: 32px; max-width: 40px; padding: 0 5px; }
  .shell-tab.pinned { min-width: 38px; max-width: 46px; }
}

/* ── Cards de ferramenta – responsivo mobile ────────────────────── */
/* 2 colunas em telas pequenas */
@media (max-width: 575px) {
  .card-ferramenta .card-body { padding: 0.75rem !important; }
  .icone-ferramenta { width: 54px; height: 54px; border-radius: 12px; }
  .icone-ferramenta .fs-1 { font-size: 1.6rem !important; }
  .card-ferramenta .card-title { font-size: 0.82rem; }
  .card-ferramenta .card-text { font-size: 0.72rem; }
}

/* ── Container de conteúdo dentro de iframe – mobile ────────────── */
@media (max-width: 575px) {
  body.in-iframe .container,
  body.in-iframe .container-fluid {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
  body.in-iframe .container.py-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   MODO IFRAME – Oculta navbar e footer dentro das abas
══════════════════════════════════════════════════════════════════ */

body.in-iframe > nav.navbar,
body.in-iframe > footer {
  display: none !important;
}

body.in-iframe .container.py-4 {
  padding-top: 1.25rem !important;
  padding-bottom: 1.25rem !important;
}

/* ── LL% color badge (dinâmico por config) ─────────────────────── */
.ll-badge-excellent { background: #0d6efd !important; color: #fff !important; }
.ll-badge-good      { background: #198754 !important; color: #fff !important; }
.ll-badge-regular   { background: #ffc107 !important; color: #000 !important; }
.ll-badge-critical  { background: #dc3545 !important; color: #fff !important; }

/* ══════════════════════════════════════════════════════════════════
   IDENTIDADE PÚBLICA AGROTECH
   Superfícies vistas por quem não está logado (login e rotas públicas
   de certificado). Mescla a identidade do site institucional — laranja
   da marca, grafite, botões pill, títulos leves com ponto laranja —
   com os componentes Bootstrap já usados no sistema.
   Todos os tokens são escopados em .ag-public: nada aqui altera as
   telas internas do sistema.
══════════════════════════════════════════════════════════════════ */
.ag-public {
  /* Laranja de preenchimento: tom do site institucional (bandas, ícones,
     detalhes). Não usar como texto sobre branco — contraste insuficiente. */
  --agb-orange:       #f38433;
  --agb-orange-soft:  #f7a366;
  /* Laranja de texto/ink: tom do sistema (#BF4000), 5.3:1 sobre branco. */
  --agb-orange-ink:   #bf4000;
  --agb-orange-deep:  #a03600;
  --agb-orange-pale:  #fff4ec;
  --agb-graphite:     #30333a;
  --agb-graphite-2:   #23262c;
  --agb-mist:         #f5f5f3;
  --agb-line:         #e6e5e1;
  --agb-ink:          #2b2e33;
  --agb-ink-soft:     #6b7078;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--agb-mist);
  color: var(--agb-ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

/* Brilho orgânico de fundo — evoca a folhagem do site sem imagem extra. */
.ag-public::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 32rem at 88% -8%,  rgba(243,132,51,.16), transparent 62%),
    radial-gradient(46rem 28rem at -6% 12%,  rgba(48,51,58,.07),   transparent 60%),
    radial-gradient(52rem 30rem at 50% 108%, rgba(243,132,51,.10), transparent 64%);
}
.ag-public > * { position: relative; z-index: 1; }
/* O conteúdo cresce para empurrar o rodapé até o fim da janela. */
.ag-public > main,
.ag-public > .ag-login-shell { flex: 1 0 auto; }

/* ── Tipografia da marca ────────────────────────────────────────── */
/* Títulos em peso leve, como no site institucional. */
.ag-title {
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--agb-ink);
  margin: 0;
}
/* Ponto laranja após o título — assinatura visual do site
   ("Especializações•", "Estrutura•", "Contatos•"). */
.ag-title::after {
  content: "";
  display: inline-block;
  width: .38em;
  height: .38em;
  border-radius: 50%;
  background: var(--agb-orange);
  margin-left: .3em;
  vertical-align: baseline;
}
.ag-title strong { font-weight: 700; }
.ag-subtitle {
  color: var(--agb-ink-soft);
  font-size: .9rem;
  line-height: 1.6;
  margin: .55rem 0 0;
}
.ag-eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .68rem;
  font-weight: 600;
  color: var(--agb-orange-ink);
}

/* ── Cabeçalho público ──────────────────────────────────────────── */
/* Cabeçalho claro: o logo aparece nas cores originais da marca, como no site. */
.ag-public-header {
  background: #fff;
  border-bottom: 3px solid var(--agb-orange);
  box-shadow: 0 2px 12px rgba(48,51,58,.06);
}
.ag-public-header .ag-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 0;
}
.ag-public-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
}
.ag-public-slogan {
  color: var(--agb-ink-soft);
  font-size: .82rem;
  font-weight: 400;
  margin: 0;
}
.ag-public-slogan .ag-dot { color: var(--agb-orange); }

/* ── Cartão público ─────────────────────────────────────────────── */
.ag-card {
  background: #fff;
  border: 1px solid var(--agb-line);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(48,51,58,.09);
  overflow: hidden;
}
.ag-card-pad { padding: 1.75rem; }
@media (max-width: 575.98px) {
  .ag-card-pad { padding: 1.25rem; }
}
/* Faixa laranja superior — cita a banda de destaque do site. */
.ag-card-topline { border-top: 4px solid var(--agb-orange); }

/* ── Botões pill (formato do site institucional) ────────────────── */
.ag-btn {
  --agb-btn-bg: linear-gradient(135deg, #c25100 0%, var(--agb-orange-ink) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: none;
  border-radius: 999px;
  background: var(--agb-btn-bg);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  padding: .72rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 18px rgba(191,64,0,.26);
}
.ag-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(191,64,0,.32);
  filter: brightness(1.06);
  color: #fff;
  text-decoration: none;
}
.ag-btn:active:not(:disabled) { transform: translateY(0); }
.ag-btn:disabled { opacity: .72; cursor: not-allowed; transform: none; }
.ag-btn:focus-visible {
  outline: 3px solid rgba(243,132,51,.55);
  outline-offset: 2px;
}
.ag-btn-block { width: 100%; }

/* Botão secundário contornado, mesmo formato pill. */
.ag-btn-ghost {
  background: transparent;
  color: var(--agb-orange-ink);
  border: 1.5px solid var(--agb-orange-ink);
  box-shadow: none;
  font-weight: 600;
}
.ag-btn-ghost:hover:not(:disabled) {
  background: var(--agb-orange-ink);
  color: #fff;
  text-decoration: none;
  filter: none;
  box-shadow: 0 8px 20px rgba(191,64,0,.24);
}

/* ── Campos ─────────────────────────────────────────────────────── */
.ag-public .form-label {
  font-size: .76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--agb-ink-soft);
  margin-bottom: .35rem;
}
.ag-public .form-control {
  border: 1.5px solid var(--agb-line);
  border-radius: 12px;
  padding: .7rem .9rem;
  font-size: .95rem;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ag-public .form-control:focus {
  border-color: var(--agb-orange);
  box-shadow: 0 0 0 .2rem rgba(243,132,51,.2);
}
.ag-public .form-control::placeholder { color: #b3b7bd; }

/* ── Selo de status do certificado ──────────────────────────────── */
.ag-status {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid transparent;
}
.ag-status-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #fff;
}
.ag-status-title { font-weight: 700; font-size: 1rem; margin: 0; }
.ag-status-note  { font-size: .82rem; margin: .15rem 0 0; opacity: .85; }
.ag-status-ok      { background: #eef7ee; border-color: #cfe6cf; color: #1e5b2a; }
.ag-status-ok      .ag-status-icon { background: #2e7d32; }
.ag-status-warn    { background: var(--agb-orange-pale); border-color: #f6d6bd; color: #8a3d00; }
.ag-status-warn    .ag-status-icon { background: var(--agb-orange); }
.ag-status-error   { background: #fdeeee; border-color: #f3cfcf; color: #8a2020; }
.ag-status-error   .ag-status-icon { background: #c62828; }

/* ── Lista de dados do certificado ──────────────────────────────── */
.ag-dl { margin: 0; }
.ag-dl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .68rem 0;
  border-bottom: 1px dashed var(--agb-line);
}
.ag-dl-row:last-child { border-bottom: none; }
.ag-dl-key {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--agb-ink-soft);
  flex: 0 0 auto;
}
.ag-dl-val {
  font-size: .92rem;
  font-weight: 600;
  color: var(--agb-ink);
  text-align: right;
  word-break: break-word;
}

/* ── Rodapé público ─────────────────────────────────────────────── */
.ag-public-footer {
  background: linear-gradient(135deg, var(--agb-graphite) 0%, var(--agb-graphite-2) 100%);
  color: #c9ccd4;
  margin-top: 3rem;
  border-top: 3px solid var(--agb-orange);
}
.ag-public-footer a { color: var(--agb-orange-soft); text-decoration: none; }
.ag-public-footer a:hover { color: #fff; text-decoration: underline; }
.ag-public-footer .ag-footer-inner {
  padding: 1.35rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .78rem;
}

/* ── Login: painel de marca + formulário ────────────────────────── */
.ag-login-shell {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
}
.ag-login-aside {
  background: linear-gradient(150deg, var(--agb-graphite) 0%, var(--agb-graphite-2) 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Marca-d'água triangular — ecoa o símbolo do logo Agrotech. */
.ag-login-aside::after {
  content: "";
  position: absolute;
  right: -8rem;
  bottom: -6rem;
  width: 26rem;
  height: 26rem;
  background: linear-gradient(135deg, rgba(243,132,51,.10), rgba(243,132,51,0) 70%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
}
.ag-login-aside > * { position: relative; z-index: 1; }
.ag-login-logo {
  height: 160px;
  width: auto;
  max-width: 100%;
}
.ag-login-headline {
  font-weight: 300;
  font-size: 2rem;
  line-height: 1.25;
  margin: 2rem 0 0;
  color: #fff;
}
.ag-login-headline strong { font-weight: 700; }
.ag-login-headline .ag-dot { color: var(--agb-orange); }
.ag-login-lead {
  color: #c9ccd4;
  font-size: .92rem;
  line-height: 1.65;
  margin: .9rem auto 0;
  max-width: 34rem;
}
.ag-login-points {
  list-style: none;
  padding: 0;
  margin: 2rem auto 0;
  display: grid;
  gap: .7rem;
  text-align: left;
  width: fit-content;
}
.ag-login-points li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .86rem;
  color: #d7dae0;
}
.ag-login-points i { color: var(--agb-orange); font-size: 1rem; line-height: 1.35; }

/* Coluna direita: faixa de marca (mobile) + formulário centralizado. */
.ag-login-col {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.ag-login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
.ag-login-form-wrap { width: 100%; max-width: 25rem; }
.ag-login-brand-mobile { display: none; }

/* Botão de mostrar/ocultar senha dentro do campo. */
.ag-pass-wrap { position: relative; }
.ag-pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--agb-ink-soft);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
  transition: color .15s ease;
}
.ag-pass-toggle:hover { color: var(--agb-orange-ink); }
.ag-pass-toggle:focus-visible {
  outline: 2px solid var(--agb-orange);
  outline-offset: 1px;
}

@media (max-width: 991.98px) {
  .ag-login-shell { grid-template-columns: 1fr; min-height: auto; }
  .ag-login-col { min-height: auto; }
  /* No mobile o painel de marca vira uma faixa compacta no topo. */
  .ag-login-aside { display: none; }
  .ag-login-brand-mobile {
    display: block;
    background: linear-gradient(135deg, var(--agb-graphite) 0%, var(--agb-graphite-2) 100%);
    border-bottom: 3px solid var(--agb-orange);
    padding: 1.5rem 1rem;
    text-align: center;
  }
  .ag-login-brand-mobile .ag-login-logo { height: 108px; }
  .ag-login-brand-mobile .ag-login-lead { margin-inline: auto; }
  .ag-login-main { min-height: auto; padding-block: 2.5rem; }
}

/* Reduz movimento para quem prefere. */
@media (prefers-reduced-motion: reduce) {
  .ag-public *,
  .ag-public *::before,
  .ag-public *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── Painel lateral informativo das páginas públicas ────────────── */
/* Dá corpo à tela de validação sem competir com o formulário. */
.ag-aside-card {
  background: linear-gradient(150deg, var(--agb-graphite) 0%, var(--agb-graphite-2) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(48,51,58,.16);
}
/* Marca-d'água triangular — ecoa o símbolo do logo Agrotech. */
.ag-aside-card::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -5rem;
  width: 15rem;
  height: 15rem;
  background: linear-gradient(135deg, rgba(243,132,51,.10), rgba(243,132,51,0) 70%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
}
.ag-aside-card > * { position: relative; z-index: 1; }
.ag-aside-title {
  font-weight: 300;
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 1.1rem;
}
.ag-aside-title .ag-dot { color: var(--agb-orange); }

.ag-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.ag-points li { display: flex; gap: .8rem; align-items: flex-start; }
.ag-points .ag-point-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(243,132,51,.16);
  color: var(--agb-orange);
  font-size: 1rem;
}
.ag-point-title { font-size: .86rem; font-weight: 600; color: #fff; margin: 0; }
.ag-point-text  { font-size: .78rem; color: #b9bdc5; margin: .15rem 0 0; line-height: 1.5; }

/* Nota discreta de rodapé de cartão (privacidade, ajuda). */
.ag-note {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--agb-ink-soft);
  background: var(--agb-mist);
  border: 1px dashed var(--agb-line);
  border-radius: 12px;
  padding: .8rem .9rem;
}
.ag-note i { color: var(--agb-orange-ink); font-size: .95rem; line-height: 1.35; }

/* Lista de documentos (página pública de produto). */
.ag-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--agb-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ag-doc-item + .ag-doc-item { margin-top: .6rem; }
.ag-doc-item:hover {
  border-color: var(--agb-orange);
  box-shadow: 0 8px 20px rgba(48,51,58,.08);
  transform: translateY(-1px);
}
.ag-doc-name {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--agb-ink);
  word-break: break-word;
}
.ag-doc-name i { color: var(--agb-orange-ink); font-size: 1.1rem; }

/* Estado vazio explícito. */
.ag-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--agb-ink-soft);
}
.ag-empty i { font-size: 2.2rem; color: #c9ccd4; display: block; margin-bottom: .6rem; }

/* ── Login: atalho para a consulta pública de certificado ───────────
   O cliente que edita o link do certificado acaba caindo no login da
   equipe. Este bloco o encaminha para /validar em vez de deixá-lo preso
   numa tela onde ele nunca terá credenciais. */
.ag-login-cliente {
  margin-top: 1.75rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1.5px solid #f6d6bd;
  border-radius: 16px;
  background: var(--agb-orange-pale);
  text-align: center;
}
.ag-login-cliente-titulo {
  font-size: .92rem;
  font-weight: 700;
  color: #8a3d00;
  margin: 0 0 .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.ag-login-cliente-titulo i { color: var(--agb-orange-ink); }
.ag-login-cliente-texto {
  font-size: .82rem;
  line-height: 1.55;
  color: #7a4a25;
  margin: 0 0 .9rem;
}
