/* AgroFoco — identidade visual compartilhada
   Camada aditiva: só afeta páginas que optam pela classe .agrofoco-app. */
.agrofoco-app {
  --af-navy-950: #03142f;
  --af-navy-900: #061d43;
  --af-navy-800: #0a2c61;
  --af-blue: #1267e8;
  --af-blue-2: #2495f2;
  --af-cyan: #16b8c8;
  --af-ink: #102445;
  --af-muted: #62738d;
  --af-line: rgba(159, 185, 219, .38);
  --af-surface: rgba(255, 255, 255, .92);
  --af-shadow: 0 22px 60px rgba(3, 24, 62, .12);
  min-height: 100vh;
  color: var(--af-ink);
  background:
    radial-gradient(circle at 88% -5%, rgba(22, 184, 200, .17), transparent 30rem),
    radial-gradient(circle at -8% 85%, rgba(18, 103, 232, .13), transparent 34rem),
    linear-gradient(180deg, #f4f8fe 0%, #edf4fd 100%);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.agrofoco-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .36;
  background-image:
    linear-gradient(rgba(8, 48, 105, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 48, 105, .035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.agrofoco-app *, .agrofoco-app *::before, .agrofoco-app *::after { box-sizing: border-box; }
.agrofoco-app a, .agrofoco-app button, .agrofoco-app input, .agrofoco-app select, .agrofoco-app textarea { transition: border-color .2s ease, color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.agrofoco-app :focus-visible { outline: 3px solid rgba(36, 149, 242, .28); outline-offset: 3px; }
.agrofoco-app h1, .agrofoco-app h2, .agrofoco-app h3 { color: var(--af-navy-950); letter-spacing: -.025em; }
.agrofoco-app .eyebrow, .agrofoco-app .bi-eyebrow, .agrofoco-app .section-kicker { color: var(--af-blue); font-weight: 900; letter-spacing: .14em; }

/* Cabeçalhos: público, cliente, administração e BI */
.agrofoco-app > header,
.agrofoco-app .topbar,
.agrofoco-app .admin-header,
.agrofoco-app .painel-barra,
.agrofoco-app .bar {
  border-bottom: 1px solid rgba(174, 199, 229, .25);
  background: linear-gradient(110deg, rgba(3, 20, 47, .97), rgba(7, 38, 82, .95) 58%, rgba(9, 69, 107, .93));
  box-shadow: 0 14px 40px rgba(1, 14, 35, .18);
  backdrop-filter: blur(18px);
}

.agrofoco-app > header:not(.topbar):not(.admin-header):not(.painel-barra):not(.bar) {
  min-height: 82px;
  padding: 12px max(22px, calc((100vw - 1220px) / 2));
  display: flex;
  align-items: center;
  gap: 26px;
}

.agrofoco-app > header .logo-agrofoco,
.agrofoco-app .topbar .brand img,
.agrofoco-app .admin-header .logo-agrofoco,
.agrofoco-app .painel-barra img,
.agrofoco-app .bar img {
  width: 190px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.agrofoco-app > header p, .agrofoco-app .admin-brand p, .agrofoco-app .nav-user, .agrofoco-app .usuario-atual { color: rgba(255, 255, 255, .72); }
.agrofoco-app > header nav, .agrofoco-app .admin-nav, .agrofoco-app .nav, .agrofoco-app .painel-acoes { margin-left: auto; }
.agrofoco-app > header nav a,
.agrofoco-app .admin-nav a,
.agrofoco-app .nav a,
.agrofoco-app .painel-link,
.agrofoco-app .back,
.agrofoco-app .bar .back {
  border-color: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .07);
  text-decoration: none;
}
.agrofoco-app > header nav a { white-space: nowrap; }
.agrofoco-app > header nav a:hover,
.agrofoco-app .admin-nav a:hover,
.agrofoco-app .nav a:hover,
.agrofoco-app .painel-link:hover,
.agrofoco-app .bar .back:hover {
  color: #fff;
  border-color: rgba(63, 178, 255, .75);
  background: rgba(18, 103, 232, .4);
}
.agrofoco-app .nav a[aria-current="page"] { color: #fff; border-color: var(--af-blue-2); background: linear-gradient(135deg, var(--af-blue), var(--af-blue-2)); }
.agrofoco-app .logout, .agrofoco-app .nav-button, .agrofoco-app .painel-sair {
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
}
.agrofoco-app .logout:hover, .agrofoco-app .nav-button:hover, .agrofoco-app .painel-sair:hover { border-color: var(--af-cyan); background: rgba(22, 184, 200, .25); }

/* Superfícies compartilhadas */
.agrofoco-app .auth-card,
.agrofoco-app .choice,
.agrofoco-app .property-card,
.agrofoco-app .new-property,
.agrofoco-app .summary,
.agrofoco-app .group,
.agrofoco-app .document-card,
.agrofoco-app .upload-card,
.agrofoco-app .version,
.agrofoco-app .admin-section,
.agrofoco-app .bi-card,
.agrofoco-app .users-panel,
.agrofoco-app .ad-gallery-card,
.agrofoco-app .contact-card,
.agrofoco-app .gallery-card,
.agrofoco-app .service-item,
.agrofoco-app .about-card,
.agrofoco-app .resultado {
  border-color: var(--af-line);
  background: var(--af-surface);
  box-shadow: var(--af-shadow);
  backdrop-filter: blur(14px);
}

.agrofoco-app .choice,
.agrofoco-app .property-card,
.agrofoco-app .new-property,
.agrofoco-app .admin-section,
.agrofoco-app .bi-card,
.agrofoco-app .auth-card { border-radius: 24px; }
.agrofoco-app .choice:hover,
.agrofoco-app .property-card:hover,
.agrofoco-app .gallery-card:hover,
.agrofoco-app .service-item:hover { transform: translateY(-5px); box-shadow: 0 30px 70px rgba(3, 24, 62, .17); }

/* Formulários e controles */
.agrofoco-app input:not([type="checkbox"]):not([type="radio"]),
.agrofoco-app select,
.agrofoco-app textarea {
  border: 1px solid rgba(148, 178, 215, .55);
  color: var(--af-ink);
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 2px rgba(2, 23, 56, .025);
}
.agrofoco-app input:focus, .agrofoco-app select:focus, .agrofoco-app textarea:focus { border-color: var(--af-blue-2); outline: 3px solid rgba(36, 149, 242, .15); box-shadow: 0 8px 24px rgba(18, 103, 232, .08); }
.agrofoco-app button[type="submit"],
.agrofoco-app .content-button,
.agrofoco-app .bi-submit,
.agrofoco-app .submit,
.agrofoco-app .open-property,
.agrofoco-app .button.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--af-blue), var(--af-blue-2) 58%, var(--af-cyan));
  box-shadow: 0 12px 28px rgba(18, 103, 232, .22);
}
.agrofoco-app button[type="submit"]:hover,
.agrofoco-app .content-button:hover,
.agrofoco-app .bi-submit:hover,
.agrofoco-app .submit:hover,
.agrofoco-app .open-property:hover { transform: translateY(-2px); box-shadow: 0 17px 35px rgba(18, 103, 232, .3); }

/* Login */
.agrofoco-app.login-page main { position: relative; }
.agrofoco-app.login-page main::before {
  content: "";
  position: fixed;
  inset: 82px 0 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(3, 20, 47, .04), transparent 45%), radial-gradient(circle at 50% 20%, rgba(18, 103, 232, .13), transparent 28rem);
}
.agrofoco-app.login-page .auth-card { overflow: hidden; border-top: 4px solid var(--af-blue); }
.agrofoco-app.login-page .login-ad { border-color: var(--af-line); background: rgba(255, 255, 255, .7); box-shadow: 0 15px 38px rgba(3, 24, 62, .09); }

/* Central do cliente */
.agrofoco-app .topbar { position: sticky; top: 0; }
.agrofoco-app .topbar-inner { min-height: 82px; }
.agrofoco-app .user-chip { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.09); }
.agrofoco-app .avatar { background: linear-gradient(135deg, var(--af-blue-2), var(--af-cyan)); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.agrofoco-app .hero h1, .agrofoco-app .heading h1 { background: linear-gradient(105deg, var(--af-navy-950), #1659aa 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.agrofoco-app .secure-note { width: fit-content; padding: 9px 13px; border: 1px solid rgba(34, 176, 110, .2); border-radius: 999px; background: rgba(235, 251, 243, .76); }
.agrofoco-app .choice::before { height: 5px; background: linear-gradient(90deg, var(--af-blue), var(--af-cyan)); }
.agrofoco-app .choice .icon, .agrofoco-app .property-icon { background: linear-gradient(145deg, var(--af-blue), var(--af-blue-2) 58%, var(--af-cyan)); }

/* Propriedades e documentos */
.agrofoco-app .property-card, .agrofoco-app .new-property { overflow: hidden; position: relative; }
.agrofoco-app .property-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -85px; top: -85px; border-radius: 50%; background: rgba(22, 184, 200, .1); pointer-events: none; }
.agrofoco-app .new-property { border: 2px dashed rgba(18, 103, 232, .3); background: rgba(255,255,255,.65); }
.agrofoco-app .owner-select { border-color: var(--af-line); background: rgba(255,255,255,.88); box-shadow: 0 12px 32px rgba(3,24,62,.08); }
.agrofoco-app .summary { border-left: 4px solid var(--af-cyan); }
.agrofoco-app .progress span { background: linear-gradient(90deg, var(--af-blue), var(--af-blue-2), var(--af-cyan)); }
.agrofoco-app .group { overflow: clip; }
.agrofoco-app .group[open] > summary { color: #fff; background: linear-gradient(110deg, var(--af-navy-900), var(--af-navy-800)); }
.agrofoco-app .group[open] .group-icon, .agrofoco-app .group[open] .group-count { color: #fff; background: rgba(255,255,255,.12); }
.agrofoco-app .document-card:hover { border-color: rgba(36,149,242,.48); background: #fff; }
.agrofoco-app .upload-card { border-top: 4px solid var(--af-cyan); }
.agrofoco-app .version.current, .agrofoco-app .version:hover { border-color: rgba(36,149,242,.42); }

/* Administração */
.agrofoco-app.admin-page .admin-header { position: sticky; top: 0; z-index: 30; }
.agrofoco-app .admin-tabs { padding: 6px; border: 1px solid var(--af-line); border-radius: 15px; background: rgba(232,240,252,.7); }
.agrofoco-app .admin-tab { border-radius: 10px; }
.agrofoco-app .admin-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--af-blue), var(--af-blue-2)); box-shadow: 0 9px 21px rgba(18,103,232,.22); }
.agrofoco-app table { overflow: hidden; border-collapse: separate; border-spacing: 0; border: 1px solid var(--af-line); border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 12px 34px rgba(3,24,62,.07); }
.agrofoco-app th { color: #fff; background: linear-gradient(110deg, var(--af-navy-900), var(--af-navy-800)); }
.agrofoco-app tbody tr:hover { background: rgba(18,103,232,.045); }
.agrofoco-app .bi-card { border-top: 3px solid var(--af-blue); }
.agrofoco-app .ad-gallery-card { overflow: hidden; border-radius: 20px; }

/* Painel incorporado */
.agrofoco-app .painel-barra { min-height: 74px; }
.agrofoco-app .visualizacao-shell { background: transparent; }
.agrofoco-app .visualizacao-cabecalho { border: 1px solid var(--af-line); border-radius: 16px 16px 0 0; background: rgba(255,255,255,.91); box-shadow: 0 12px 35px rgba(3,24,62,.08); }
.agrofoco-app #report-container, .agrofoco-app .report-container { overflow: hidden; border: 1px solid var(--af-line); border-radius: 0 0 18px 18px; background: #fff; box-shadow: var(--af-shadow); }

/* Páginas públicas internas */
.agrofoco-app.public-modern > header { position: sticky; top: 0; z-index: 30; }
.agrofoco-app.public-modern > main { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.agrofoco-app.public-modern > main > h1,
.agrofoco-app.public-modern .gallery-heading h1 { font-size: clamp(2.3rem, 5vw, 4.1rem); line-height: 1.02; }
.agrofoco-app.public-modern .about-section,
.agrofoco-app.public-modern .services-section,
.agrofoco-app.public-modern .contact-section,
.agrofoco-app.public-modern .gallery-section { border-radius: 28px; }
.agrofoco-app.public-modern footer { color: rgba(255,255,255,.72); background: var(--af-navy-950); }
.agrofoco-app.public-modern .gallery-tab.is-active { color: #fff; background: linear-gradient(135deg,var(--af-blue),var(--af-cyan)); }

/* Simulador legado */
.agrofoco-app.simulator-page { max-width: none; margin: 0; padding: clamp(24px, 5vw, 64px); }
.agrofoco-app.simulator-page > * { width: min(720px, 100%); margin-inline: auto; }
.agrofoco-app.simulator-page h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.agrofoco-app.simulator-page form { padding: 28px; border: 1px solid var(--af-line); border-radius: 24px; background: var(--af-surface); box-shadow: var(--af-shadow); }

@media (max-width: 760px) {
  .agrofoco-app > header:not(.topbar):not(.admin-header):not(.painel-barra):not(.bar) { min-height: 70px; padding: 9px 14px; display: flex; grid-template-columns: none; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 10px; }
  .agrofoco-app > header .logo-agrofoco, .agrofoco-app .topbar .brand img, .agrofoco-app .admin-header .logo-agrofoco, .agrofoco-app .painel-barra img, .agrofoco-app .bar img { width: 142px; height: 42px; }
  .agrofoco-app > header p, .agrofoco-app .admin-brand p { display: none; }
  .agrofoco-app > header .logo-link { width: auto; flex: 0 0 auto; }
  .agrofoco-app > header nav { width: auto; margin-left: auto; display: flex; flex: 0 1 auto; flex-wrap: nowrap; gap: 5px; }
  .agrofoco-app > header nav a:not(:last-child) { display: none; }
  .agrofoco-app > header nav a:last-child { min-height: 40px; padding-inline: 11px; font-size: .72rem; white-space: nowrap; }
  .agrofoco-app .topbar-inner { min-height: 70px; }
  .agrofoco-app .choice, .agrofoco-app .property-card, .agrofoco-app .new-property, .agrofoco-app .admin-section, .agrofoco-app .bi-card, .agrofoco-app .auth-card { border-radius: 19px; }
  .agrofoco-app table { display: block; overflow-x: auto; }
  .agrofoco-app .painel-acoes { overflow-x: auto; scrollbar-width: none; }
  .agrofoco-app .user-chip { max-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

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