/* M&A Digital | Digital Twin: identidade herdada do Latitude (escritório e ATIO) e do site Guilherme Prusch. */
:root {
  --bg: #080b12; --bg2: #0c1017; --bg3: #111621; --card: #12171f; --card2: #161c28;
  --border: #1a2132; --border2: #232d42;
  --accent: #4ade80; --accent2: #22c55e; --accent-dim: rgba(74,222,128,.08); --accent-glow: rgba(74,222,128,.12);
  --orange: #f97316; --orange2: #fb923c; --orange-dim: rgba(249,115,22,.08);
  --blue: #60a5fa; --blue-dim: rgba(96,165,250,.08);
  --cyan: #22d3ee; --cyan-dim: rgba(34,211,238,.08);
  --red: #f87171; --red-dim: rgba(248,113,113,.08);
  --dev: #c084fc; --dev-dim: rgba(192,132,252,.12);
  --amber: #fbbf24; --pink: #f472b6;
  --text: #eef2f7; --text2: #a7b3c4; --text3: #8592a6;
  --ok: #4ade80; --aviso: #fbbf24; --erro: #f87171;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --vidro: rgba(14, 19, 29, .74);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: rgba(74,222,128,.25); }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bg-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(74,222,128,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(74,222,128,.03) 1px, transparent 1px); background-size: 60px 60px; }
.bg-glow { position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(120px); }
.glow-green { width: 600px; height: 600px; left: -200px; top: 20%; background: rgba(74,222,128,.06); }
.glow-orange { width: 500px; height: 500px; right: -150px; top: 10%; background: rgba(249,115,22,.05); }
.glow-blue { width: 700px; height: 400px; left: 35%; top: 60%; background: rgba(96,165,250,.04); }
#app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2d3a55; }

.mono { font-family: var(--mono); }
.ic { flex-shrink: 0; vertical-align: middle; }
.texto-suave { color: var(--text2); line-height: 1.55; }
.texto-fraco { color: var(--text3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- campos ---------- */
input, select, textarea { font-family: inherit; font-size: 13px; background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; outline: none; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px var(--accent-dim); }
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238592a6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent2); flex: none; }
input[type=date] { color-scheme: dark; }
label.field-label, .field-label { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin: 0 0 6px; }

/* ---------- botões e etiquetas ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 1px solid var(--border); background: var(--bg3); color: var(--text); padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; transition: all .2s; white-space: nowrap; }
.btn:hover { border-color: var(--border2); background: var(--card2); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent2), #16a34a); border-color: transparent; color: #04150a; box-shadow: 0 4px 20px rgba(34,197,94,.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(34,197,94,.3); background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.btn-danger { color: var(--red); border-color: rgba(248,113,113,.25); background: var(--red-dim); }
.btn-danger:hover { background: rgba(248,113,113,.15); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); transform: none; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-icone { padding: 8px; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; padding: 3px 9px; border-radius: 6px; letter-spacing: .03em; white-space: nowrap; }
.tag-green { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(74,222,128,.18); }
.tag-orange { background: var(--orange-dim); color: var(--orange2); border: 1px solid rgba(249,115,22,.18); }
.tag-blue { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96,165,250,.18); }
.tag-cyan { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(34,211,238,.18); }
.tag-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.tag-amber { background: rgba(251,191,36,.08); color: var(--amber); border: 1px solid rgba(251,191,36,.2); }
.tag-dev { background: var(--dev-dim); color: var(--dev); border: 1px solid rgba(192,132,252,.2); }
.tag-gray { background: rgba(139,152,171,.08); color: var(--text2); border: 1px solid var(--border); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: border-color .25s; }
.card:hover { border-color: rgba(74,222,128,.22); }
.card-titulo { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.card-sub { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); }

.vazio { text-align: center; color: var(--text3); padding: 34px 18px; font-size: 13px; line-height: 1.6; }
.vazio .ic { opacity: .5; margin-bottom: 8px; }
.vazio strong { display: block; color: var(--text2); margin-bottom: 4px; font-size: 14px; }

/* ---------- login ---------- */
.login-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.login-fundo { position: absolute; inset: 0; opacity: .55; filter: saturate(.8); pointer-events: none; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%); }
.login-box { position: relative; width: 410px; max-width: calc(100vw - 32px); background: rgba(18,23,31,.92); backdrop-filter: blur(14px); border: 1px solid var(--border2); border-radius: 18px; padding: 38px 34px; box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: subir .45s ease; }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; background: linear-gradient(135deg, var(--accent2), #15803d); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(34,197,94,.25); color: #eafff2; --marca-linha: #0a3d1d; }
.logo-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.logo-name span { color: var(--accent); }
.logo-sub { font-family: var(--mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .24em; color: var(--text2); margin-top: 3px; white-space: nowrap; }
.login-box h1 { font-size: 22px; letter-spacing: -.02em; margin: 26px 0 4px; }
.login-box p { color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.login-box .campo { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 12px; margin-top: 6px; }
.erro-linha { color: var(--red); font-size: 12.5px; margin-top: 12px; min-height: 18px; }

/* ---------- janelas, formulários, avisos ---------- */
.modal-fundo { position: fixed; inset: 0; z-index: 90; background: rgba(4,7,12,.66); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal-fundo.in { opacity: 1; }
.modal { width: 100%; max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--border2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(10px) scale(.985); transition: transform .22s; }
.modal-fundo.in .modal { transform: none; }
.modal-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-topo h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.modal-corpo { padding: 16px 20px 20px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; grid-column: 1 / -1; }
.form-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grade .campo, .form-grade .campo-check { grid-column: 1 / -1; }
.form-grade .campo.col-2 { grid-column: span 1; }
.form-erro { grid-column: 1 / -1; color: var(--red); font-size: 12.5px; background: var(--red-dim); border: 1px solid rgba(248,113,113,.22); padding: 9px 12px; border-radius: 10px; }
.campo-ajuda { display: block; color: var(--text3); font-size: 11.5px; margin-top: 5px; line-height: 1.45; }
.campo-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text2); flex-wrap: wrap; }
.campo-check small { flex-basis: 100%; color: var(--text3); font-size: 11.5px; padding-left: 25px; }
.chips-sel { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-sel { cursor: pointer; }
.chip-sel input { position: absolute; opacity: 0; pointer-events: none; }
.chip-sel span { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--bg3); color: var(--text2); transition: all .2s; }
.chip-sel input:checked + span { color: var(--accent); background: var(--accent-dim); border-color: rgba(74,222,128,.3); }
.chip-sel input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--border2); border-left: 3px solid var(--accent); padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 380px; opacity: 0; transform: translateY(8px); transition: all .25s; }
.toast.in { opacity: 1; transform: none; }
.toast-erro { border-left-color: var(--red); }
.toast-erro .toast-ic { color: var(--red); }
.toast-ic { color: var(--accent); display: flex; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: gira .7s linear infinite; display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }
.carregando { display: flex; align-items: center; gap: 10px; color: var(--text3); padding: 30px; justify-content: center; font-size: 13px; }

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