/* ==========================================================================
   AgroSolo — CSS Global (Páginas Home, Login e Calculadora)
   Mesma identidade visual, Topbar Flutuante, Elementos 3D de Fundo e Rodapé
   ========================================================================== */

:root {
  /* Paleta Oficial AgroSolo */
  --primary: #2d7a3e;
  --primary-dark: #1b4d24;
  --primary-light: #e8f5e9;
  --primary-glow: rgba(45, 122, 62, 0.2);
  --accent: #7bc043;
  --accent-hover: #6cb034;
  --accent-light: rgba(123, 192, 67, 0.16);

  /* Tons Escuros Floresta AgroSolo */
  --dark: #0f1f13;
  --dark-elevated: #152719;
  --dark-surface: #1b3120;
  --dark-border: rgba(123, 192, 67, 0.22);

  /* Tons Neutros Claros */
  --bg-page: #eef2ee;
  --gray-50: #f8faf8;
  --gray-100: #f4f6f4;
  --gray-200: #e2e8e4;
  --gray-300: #cbd5ce;
  --gray-400: #94a398;
  --gray-500: #647468;
  --gray-600: #4b5b4f;
  --gray-700: #334137;
  --gray-800: #1e2921;
  --gray-900: #0f1f13;
  --white: #ffffff;

  /* Status Semânticos */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-text: #075985;

  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 50px;

  --shadow-sm: 0 2px 6px rgba(15, 31, 19, 0.05);
  --shadow: 0 8px 24px -4px rgba(15, 31, 19, 0.08), 0 2px 6px -1px rgba(15, 31, 19, 0.04);
  --shadow-lg: 0 18px 38px -10px rgba(15, 31, 19, 0.16), 0 6px 14px -3px rgba(15, 31, 19, 0.06);

  --topbar-height: 68px;
  --transition: all 0.2s ease-in-out;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-800);
  background-color: var(--bg-page);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   App Shell & Estrutura Principal
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  position: relative;
  overflow-x: hidden;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  z-index: 2;
}

.app-content {
  flex: 1;
  padding: calc(var(--topbar-height) + 2.5rem) 2.25rem 3rem;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Cena 3D de Fundo (Plantas Reais 3D em Alta Definição, Gotas e Esferas NPK)
   ========================================================================== */

.bg-3d-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  perspective: 1200px;
}

.bg-3d-element {
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.bg-3d-element svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 22px 28px rgba(15, 31, 19, 0.14));
}

.bg-3d-plant-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 28px 34px rgba(15, 31, 19, 0.24)) drop-shadow(0 8px 14px rgba(45, 122, 62, 0.14));
  transform-style: preserve-3d;
}

/* Posicionamentos e Profundidades (Z-depth + Bokeh) das Plantas Reais 3D */
.plant-3d-top-left {
  width: 310px;
  height: 310px;
  top: 11%;
  left: -65px;
  opacity: 0.92;
  animation: float3DLeft 9s ease-in-out infinite alternate;
}

.plant-3d-mid-right {
  width: 280px;
  height: 360px;
  top: 36%;
  right: -55px;
  opacity: 0.9;
  animation: float3DRight 11s ease-in-out infinite alternate;
}

.plant-3d-bottom-left {
  width: 270px;
  height: 270px;
  bottom: 5%;
  left: -55px;
  opacity: 0.78;
  filter: blur(1.8px);
  animation: float3DLeft 12s ease-in-out infinite alternate-reverse;
}

.plant-3d-bottom-left .bg-3d-plant-img {
  transform: scaleX(-1) rotate(18deg);
}

.leaf-bokeh-far {
  width: 190px;
  height: 230px;
  top: 78%;
  right: 6%;
  opacity: 0.58;
  filter: blur(3.5px);
  animation: float3DRight 10s ease-in-out infinite alternate;
}

.leaf-bokeh-far .bg-3d-plant-img {
  transform: rotate(-22deg) scale(0.92);
}

/* Glows Ambientais Volumétricos no Fundo */
.ambient-glow-3d {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.glow-green-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(123, 192, 67, 0.22) 0%, rgba(45, 122, 62, 0) 70%);
  top: 18%;
  left: -120px;
}

.glow-green-2 {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(45, 122, 62, 0.18) 0%, rgba(15, 31, 19, 0) 70%);
  top: 52%;
  right: -140px;
}

@keyframes float3DLeft {
  0% {
    transform: translate3d(0, 0, 0) rotateX(8deg) rotateY(-12deg) rotateZ(-4deg);
  }
  100% {
    transform: translate3d(14px, -22px, 30px) rotateX(-6deg) rotateY(10deg) rotateZ(6deg);
  }
}

@keyframes float3DRight {
  0% {
    transform: translate3d(0, 0, 0) rotateX(-8deg) rotateY(14deg) rotateZ(5deg);
  }
  100% {
    transform: translate3d(-16px, -24px, 35px) rotateX(10deg) rotateY(-8deg) rotateZ(-5deg);
  }
}

/* ==========================================================================
   Topbar Horizontal Fixa na Tela (Mesmo Modelo do Painel do Produtor)
   ========================================================================== */

.app-topbar {
  height: var(--topbar-height);
  background: transparent;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  color: var(--white);
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 950;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.20), 0 4px 10px rgba(0, 0, 0, 0.12);
  border-radius: 4rem;
}

/* Esquerda: Logo + Tag */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  background: var(--dark);
  padding: 0.4rem 0.9rem 0.4rem 0.65rem;
  border-radius: 4rem 0 0 4rem;
}

.topbar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-brand img {
  height: 38px;
  width: auto;
}

.brand-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(123, 192, 67, 0.18);
  color: var(--accent);
  padding: 0.2rem 0.55rem;
  font-weight: 800;
  border: 1px solid rgba(123, 192, 67, 0.4);
}

/* Centro: Menu de Navegação Contido */
.topbar-nav {
  display: flex;
  align-items: center;
  background: var(--dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem;
  gap: 0.25rem;
  border-radius: 40px;
  padding-left: 2rem;
  padding-right: 2rem;
}

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #94a3b8;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.topbar-nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.topbar-nav-link .nav-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: none;
}

.topbar-nav-link.active {
  color: var(--white);
  background: var(--dark-surface);
  border-color: rgba(123, 192, 67, 0.45);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.topbar-nav-link.active .nav-dot {
  display: inline-block;
}

/* Direita: Ações e Acesso ao Portal */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.menu-toggle-btn {
  display: none;
  background: var(--dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 40px;
  height: 40px;
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.topbar-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  background: var(--dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.topbar-icon-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--accent);
}

.topbar-cta-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.38rem 1rem 0.38rem 0.45rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--white);
  border-radius: 0 4rem 4rem 0;
}

.topbar-cta-btn:hover {
  border-color: var(--accent);
  background: var(--dark-surface);
}

.topbar-cta-btn .avatar-mini {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: var(--white);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
}

.topbar-cta-btn .user-meta {
  text-align: left;
  line-height: 1.2;
}

.topbar-cta-btn .name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--white);
  display: block;
}

.topbar-cta-btn .role {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
}

/* ==========================================================================
   Cabeçalho Executivo (Hero Row + 3 KPIs Horizontais igual ao Produtor)
   ========================================================================== */

.exec-hero-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.exec-hero-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 1rem;
}

.exec-hero-title .eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.exec-hero-title .eyebrow::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 3px;
}

.exec-hero-title h1 {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.exec-hero-title h1 span {
  color: var(--primary);
}

.exec-kpis-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(235px, 1fr));
  gap: 1.15rem;
  flex: 2;
  max-width: 920px;
}

.exec-kpi-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 228, 0.95);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.exec-kpi-card:hover {
  border-color: rgba(45, 122, 62, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.exec-kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(45, 122, 62, 0.24);
}

.exec-kpi-body {
  flex: 1;
  min-width: 0;
}

.exec-kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.exec-kpi-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exec-kpi-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -0.02em;
}

.exec-kpi-trend {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #a7f3d0;
}

/* ==========================================================================
   Botões e Seções Padrão
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(45, 122, 62, 0.24);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 122, 62, 0.34);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--white);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--dark);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(123, 192, 67, 0.3);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-white {
  background: var(--white);
  color: var(--dark);
  font-weight: 700;
}

.btn-white:hover {
  background: var(--gray-100);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 0.85rem 1.8rem;
  font-size: 0.96rem;
}

.section {
  padding: 4.75rem 0;
  position: relative;
  scroll-margin-top: calc(var(--topbar-height) + 1.5rem);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--gray-600);
  font-size: 1.04rem;
}

/* ==========================================================================
   Rodapé Padrão AgroSolo (Idêntico ao index.html e produtor.html)
   ========================================================================== */

.footer .container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.footer {
  background: #09130b;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 3;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-logo {
  height: 40px;
  width: auto;
  display: block;
  margin-bottom: 1rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   Responsividade Global (Tablet & Mobile)
   ========================================================================== */

@media (max-width: 1180px) {
  .exec-kpis-row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 980px) {
  .app-topbar {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }

  .menu-toggle-btn {
    display: inline-flex;
  }

  .topbar-nav {
    display: none;
    position: absolute;
    top: calc(var(--topbar-height) + 8px);
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(123, 192, 67, 0.35);
    border-bottom: 3px solid var(--primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
  }

  .topbar-nav.mobile-open {
    display: flex;
  }

  .exec-kpis-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .plant-3d-top-left,
  .plant-3d-mid-right {
    width: 190px;
    height: 210px;
    opacity: 0.48;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    padding: 0 0.45rem;
    gap: 0.4rem;
  }

  .topbar-brand {
    gap: 0.5rem;
    padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  }

  .topbar-brand img {
    height: 30px;
  }

  .brand-tag {
    display: none;
  }

  .topbar-right {
    gap: 0.4rem;
  }

  .menu-toggle-btn,
  .topbar-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 0.92rem;
  }

  .topbar-cta-btn {
    padding: 0.25rem 0.55rem 0.25rem 0.3rem;
    gap: 0.35rem;
  }

  .topbar-cta-btn .avatar-mini {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .topbar-cta-btn .user-meta {
    display: none;
  }

  .app-content {
    padding: calc(var(--topbar-height) + 1.5rem) 0.9rem 2.25rem;
  }

  .exec-hero-row {
    gap: 1.15rem;
    margin-bottom: 1.25rem;
  }

  .exec-hero-title h1 {
    font-size: 1.75rem;
  }

  .exec-kpi-card {
    padding: 0.9rem 1rem;
  }

  .exec-kpi-icon {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  .exec-kpi-val {
    font-size: 1.5rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .plant-3d-bottom-left {
    display: none;
  }

  .footer {
    padding: 2.5rem 0 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
