/* Portal dos sistemas Santa Colomba. Mesma identidade do app e do Gitea:
   verde-petróleo #0F4F47, dourado #B7791F, fotos do campo.
   Temas: html[data-tema="claro"|"escuro"] (tema.js escolhe; "sistema" segue o aparelho). */

:root, html[data-tema="claro"] {
  --petroleo: #0F4F47;
  --apoio: #1F6A60;
  --fundo-escuro: #0B2422;
  --dourado: #B7791F;
  --dourado-claro: #F2B45A;
  --gradiente: linear-gradient(135deg, #1F6A60 0%, #0F4F47 55%, #0B3a34 100%);

  --fundo: #F5F8F6;
  --superficie: #ffffff;
  --superficie-2: #F1F5F2;
  --texto: #10231F;
  --texto-sec: #4A5E59;
  --texto-fraco: #6B7D78;
  --titulo: #0B2422;
  --realce: #0F4F47;
  --realce-fundo: #E8F2EC;
  --borda: rgba(15, 79, 71, 0.12);
  --borda-forte: rgba(15, 79, 71, 0.28);
  --campo: #ffffff;
  --campo-borda: #CBD8D1;
  --foco: #2E8B7A;
  --foco-sombra: rgba(46, 139, 122, 0.18);
  --erro-fundo: #FDECEA;
  --erro-texto: #A4271B;
  --brilho-1: rgba(31, 106, 96, 0.08);
  --brilho-2: rgba(183, 121, 31, 0.06);
  --vidro: rgba(255, 255, 255, 0.78);
  --sombra-1: 0 1px 2px rgba(11, 36, 34, 0.06), 0 1px 3px rgba(11, 36, 34, 0.08);
  --sombra-2: 0 2px 4px rgba(11, 36, 34, 0.06), 0 10px 24px -6px rgba(11, 36, 34, 0.16);
  --sombra-3: 0 4px 8px rgba(11, 36, 34, 0.06), 0 22px 48px -10px rgba(11, 36, 34, 0.28);
  color-scheme: light;
}
html[data-tema="escuro"] {
  --fundo: #0A1816;
  --superficie: #10231F;
  --superficie-2: #142C28;
  --texto: #E3EEEA;
  --texto-sec: #A9BDB6;
  --texto-fraco: #8AA19A;
  --titulo: #F2F8F5;
  --realce: #74D3C2;
  --realce-fundo: rgba(91, 191, 174, 0.14);
  --borda: rgba(122, 201, 186, 0.14);
  --borda-forte: rgba(122, 201, 186, 0.34);
  --campo: #0C1C19;
  --campo-borda: #2E4D46;
  --foco: #5BBFAE;
  --foco-sombra: rgba(91, 191, 174, 0.24);
  --erro-fundo: rgba(239, 83, 80, 0.14);
  --erro-texto: #FF9A90;
  --brilho-1: rgba(46, 139, 122, 0.14);
  --brilho-2: rgba(242, 180, 90, 0.05);
  --vidro: rgba(16, 35, 31, 0.72);
  --sombra-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  --sombra-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 24px -6px rgba(0, 0, 0, 0.55);
  --sombra-3: 0 4px 8px rgba(0, 0, 0, 0.3), 0 22px 48px -10px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* troca de tema suave (tema.js põe a classe por 450 ms) */
html.sca-trocando-tema, html.sca-trocando-tema *, html.sca-trocando-tema *::before, html.sca-trocando-tema *::after {
  transition: background-color 400ms ease, border-color 400ms ease, color 400ms ease, box-shadow 400ms ease !important;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(1100px 520px at 100% -10%, var(--brilho-1), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, var(--brilho-2), transparent 60%),
    var(--fundo);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(46, 139, 122, 0.28); }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: -0.015em; }

/* ====================================================================== botões */
.botao {
  --b-fundo: var(--superficie);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--campo-borda);
  background: var(--b-fundo);
  color: var(--realce);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--sombra-1);
  transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms, border-color 180ms, background 180ms;
}
.botao:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--sombra-2); border-color: var(--borda-forte); }
.botao:active:not(:disabled) { transform: translateY(0) scale(0.98); box-shadow: var(--sombra-1); }
.botao:disabled { opacity: 0.65; cursor: default; }
.botao svg { width: 18px; height: 18px; flex: none; }
.botao-primario {
  background: var(--gradiente);
  color: #fff;
  border-color: #0B3a34;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 4px rgba(11, 36, 34, 0.18), 0 8px 18px -8px rgba(15, 79, 71, 0.7);
}
html[data-tema="escuro"] .botao-primario { border-color: #2A7D71; }
.botao-primario:hover:not(:disabled) {
  border-color: #0B3a34;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 8px rgba(11, 36, 34, 0.2), 0 14px 28px -10px rgba(15, 79, 71, 0.75);
}
/* brilho que atravessa o botão primário ao passar o mouse */
.botao-primario::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  z-index: -1;
}
.botao-primario:hover:not(:disabled)::after { transform: translateX(120%); transition: transform 700ms ease; }
.botao-largo { width: 100%; padding: 13px 18px; font-size: 15px; }
.botao.carregando { color: transparent !important; }
.botao.carregando::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: gira 700ms linear infinite;
}
/* onda no clique (app.js cria o <span class="onda">) */
.onda {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  transform: scale(0);
  animation: onda 600ms ease-out forwards;
  pointer-events: none;
  z-index: -1;
}
.botao-primario .onda { background: #fff; }

/* seletor de tema (claro / escuro / sistema) e de guia */
.segmentos {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  background: var(--superficie-2);
  border: 1px solid var(--borda);
}
.segmentos button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--texto-sec);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 180ms, color 180ms, box-shadow 180ms;
}
.segmentos button svg { width: 16px; height: 16px; }
.segmentos button:hover { color: var(--realce); }
.segmentos button[aria-pressed="true"] { background: var(--superficie); color: var(--realce); box-shadow: var(--sombra-1); }
html[data-tema="escuro"] .segmentos button[aria-pressed="true"] { background: #1A3832; }
.segmentos.no-vidro { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.segmentos.no-vidro button { color: rgba(255, 255, 255, 0.85); }
.segmentos.no-vidro button:hover { color: #fff; }
html .segmentos.no-vidro button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.95); color: var(--petroleo); }
.rotulo-curto { display: inline; }

/* ====================================================================== login */
.tela-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(400px, 1fr);
}
.heroi {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 18px 0 18px 18px;
  border-radius: 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  min-height: 560px;
  box-shadow: var(--sombra-3);
}
.heroi .foto {
  position: absolute;
  inset: -4%;
  background: url("img/pivo.webp") center / cover no-repeat;
  animation: zoom 10s ease-out both;
  z-index: -2;
  will-change: transform;
}
.heroi::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 36, 34, 0.1) 0%, rgba(11, 36, 34, 0.35) 40%, rgba(11, 36, 34, 0.93) 100%),
    linear-gradient(120deg, rgba(15, 79, 71, 0.55), transparent 55%);
  z-index: -1;
}
.marca { display: flex; align-items: center; gap: 14px; }
.marca img.simbolo { width: 52px; height: 52px; animation: gira 60s linear infinite; }
.marca .palavra { font-weight: 500; letter-spacing: 0.22em; line-height: 1.05; text-transform: uppercase; font-size: 15px; }
.heroi .marca { position: absolute; top: 40px; left: 44px; animation: aparece 900ms ease both 150ms; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dourado-claro); margin-bottom: 14px; }
.heroi h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.04; font-weight: 800; margin: 0 0 14px; }
.heroi h2 em { font-style: normal; background: linear-gradient(90deg, #F2B45A, #FFD9A0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.heroi p { color: #D7E6E0; font-size: 16px; max-width: 520px; margin: 0 0 22px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dourado-claro); }
.heroi .sobe { animation: sobe 700ms cubic-bezier(.2, .7, .2, 1) both; }
.heroi .sobe:nth-of-type(2) { animation-delay: 120ms; }

.lado-form { position: relative; display: flex; align-items: center; justify-content: center; padding: 32px; }
.lado-form .canto { position: absolute; top: 22px; right: 22px; }
.cartao-form {
  width: 100%;
  max-width: 420px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 24px;
  box-shadow: var(--sombra-3);
  padding: 34px 32px 30px;
  animation: sobe 600ms cubic-bezier(.2, .7, .2, 1) both 100ms;
}
.cartao-form .logo { display: block; width: 150px; margin: 0 0 22px; }
html[data-tema="escuro"] .cartao-form .logo { filter: brightness(0) invert(1); opacity: 0.92; }
.cartao-form h1 { margin: 0 0 6px; font-size: 26px; font-weight: 750; color: var(--titulo); }
.sub { color: var(--texto-sec); margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--texto-sec); margin: 16px 0 6px; }
input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--campo-borda);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: var(--campo);
  transition: border-color 180ms, box-shadow 180ms;
}
input:focus { outline: none; border-color: var(--foco); box-shadow: 0 0 0 4px var(--foco-sombra); }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 48px; }
.ver-senha { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--texto-fraco); cursor: pointer; display: grid; place-items: center; }
.ver-senha:hover { color: var(--realce); background: var(--realce-fundo); }
.ver-senha svg { width: 18px; height: 18px; }
form .botao-largo { margin-top: 22px; }
.erro { background: var(--erro-fundo); color: var(--erro-texto); padding: 11px 13px; border-radius: 12px; margin: 14px 0 0; font-size: 14px; animation: treme 380ms ease; }
.rodape-form { margin-top: 18px; font-size: 12.5px; color: var(--texto-fraco); text-align: center; }

/* ====================================================================== app (sistemas) */
.topo {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--vidro);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--borda);
}
.topo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #0F4F47, #1F6A60 40%, #B7791F 75%, #0F4F47); background-size: 200% 100%; animation: filete 12s linear infinite; }
.topo-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 24px; }
.topo .logo { width: 118px; display: block; }
html[data-tema="escuro"] .topo .logo { filter: brightness(0) invert(1); opacity: 0.92; }
.topo .espaco { flex: 1; }
.quem { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--gradiente); box-shadow: var(--sombra-1); }
.quem .nome { font-size: 14px; font-weight: 600; color: var(--titulo); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.botao-sair { padding: 8px 12px; font-size: 13.5px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 24px 56px; }
.faixa {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 26px;
  min-height: 210px;
  padding: 34px 38px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--sombra-3);
  animation: sobe 600ms cubic-bezier(.2, .7, .2, 1) both;
}
.faixa .foto { position: absolute; inset: -10% 0; background: url("img/lavoura.webp") center 55% / cover no-repeat; z-index: -2; will-change: transform; }
.faixa::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11, 36, 34, 0.92) 0%, rgba(11, 36, 34, 0.7) 45%, rgba(15, 79, 71, 0.25) 100%); }
.faixa::after { content: ""; position: absolute; right: -70px; top: 50%; width: 280px; height: 280px; transform: translateY(-50%); background: url("img/marca-branca.svg") center / contain no-repeat; opacity: 0.12; animation: gira 90s linear infinite; z-index: -1; }
.faixa h1 { margin: 6px 0 6px; font-size: clamp(26px, 3vw, 36px); font-weight: 800; color: #fff; }
.faixa p { margin: 0; color: #D7E6E0; font-size: 15px; max-width: 560px; }
.preferencia { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; position: relative; z-index: 1; }
.preferencia small { color: #D7E6E0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 2px 16px; flex-wrap: wrap; }
.secao-titulo h2 { margin: 0; font-size: 20px; font-weight: 750; color: var(--titulo); }
.secao-titulo span { color: var(--texto-fraco); font-size: 13.5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--sombra-1);
  transition: transform 260ms cubic-bezier(.2, .7, .2, 1), box-shadow 260ms, border-color 260ms;
  animation: sobe 520ms cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.card::after { /* luz que segue o mouse (app.js define --mx/--my) */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(91, 191, 174, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 260ms;
  z-index: 1;
  pointer-events: none;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--sombra-3); border-color: var(--borda-forte); }
.card:hover::after { opacity: 1; }
.card:active { transform: translateY(-2px) scale(0.99); }
.card .capa { position: relative; height: 112px; overflow: hidden; }
.card .capa img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform 600ms cubic-bezier(.2, .7, .2, 1); }
.card:hover .capa img { transform: scale(1.09); }
.card .capa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 36, 34, 0) 30%, rgba(11, 36, 34, 0.55)); }
.card .icone {
  position: absolute;
  left: 18px;
  top: 89px; /* metade sobre a foto (capa de 112px) */
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--gradiente);
  color: #fff;
  border: 3px solid var(--superficie);
  box-shadow: var(--sombra-2);
  transition: transform 260ms cubic-bezier(.2, .7, .2, 1);
}
.card .icone svg { width: 22px; height: 22px; }
.card:hover .icone { transform: rotate(-6deg) scale(1.06); }
.card .corpo { position: relative; z-index: 2; padding: 30px 20px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card strong { font-size: 17.5px; font-weight: 750; color: var(--titulo); }
.card .desc { font-size: 14px; color: var(--texto-sec); line-height: 1.5; flex: 1; }
.card .abrir { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--realce); }
.card .abrir svg { width: 16px; height: 16px; transition: transform 220ms; }
.card:hover .abrir svg { transform: translateX(4px); }
.card .outra-guia {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(11, 36, 34, 0.35);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms, transform 200ms, background 200ms;
}
.card:hover .outra-guia, .card:focus-within .outra-guia { opacity: 1; transform: none; }
.card .outra-guia:hover { background: rgba(11, 36, 34, 0.6); }
.card .outra-guia svg { width: 16px; height: 16px; }
@media (hover: none) { .card .outra-guia { opacity: 1; transform: none; } }

.esqueleto { min-height: 230px; border-radius: 20px; border: 1px solid var(--borda); background: linear-gradient(100deg, var(--superficie) 30%, var(--superficie-2) 50%, var(--superficie) 70%); background-size: 300% 100%; animation: brilho 1.4s ease infinite; }
.vazio { background: var(--superficie); border: 1px dashed var(--borda-forte); border-radius: 18px; padding: 28px; color: var(--texto-sec); text-align: center; }

/* ====================================================================== animações */
@keyframes sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom { from { transform: scale(1.18); } to { transform: scale(1.06); } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes filete { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@keyframes onda { to { transform: scale(4); opacity: 0; } }
@keyframes brilho { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes treme { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

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

/* ====================================================================== celular */
@media (max-width: 900px) {
  .tela-login { display: block; }
  .heroi { margin: 12px; min-height: 250px; padding: 26px; border-radius: 22px; }
  .heroi .marca { top: 22px; left: 24px; }
  .heroi p, .heroi .chips { display: none; }
  .lado-form { padding: 8px 16px 32px; }
  .lado-form .canto { position: static; display: flex; justify-content: flex-end; margin-bottom: 12px; }
  .lado-form { flex-direction: column; }
}
@media (max-width: 640px) {
  .topo-in { padding: 10px 14px; gap: 10px; }
  .quem .nome { display: none; }
  .topo .segmentos button span, .botao-sair span { display: none; }
  .topo .logo { width: 96px; }
  main { padding: 14px 14px 40px; }
  .faixa { padding: 24px; border-radius: 20px; }
  .preferencia { align-items: flex-start; }
}
