/* =============================================================================
   css/comum.css — ESTILOS COMUNS A TODAS AS TELAS DO GeoMap One
   =============================================================================
   Cores e medidas ficam aqui em :root (a cor primária e a da marca também vêm do
   js/config.js). Estilo de uma tela só vai em css/<tela>.css.
   ============================================================================= */

:root {
    /* Superfícies — "noite cartográfica" */
    --fundo: #0D1522;
    --fundo-2: #111B2B;
    --superficie: #152238;
    --superficie-2: #1B2B45;
    --linha: #26385A;
    --linha-suave: rgba(148, 170, 205, 0.14);

    /* Texto */
    --texto: #E6EDF6;
    --texto-2: #B4C2D6;
    --texto-fraco: #8193AD;

    /* Ação e marca */
    --cor-primaria: #3D8BFD;
    --cor-marca: #F2A541;

    /* Significado dos clientes no mapa (iguais à v13) */
    --ativo: #3B82F6;
    --inativo: #EF4444;
    --potencial: #F59E0B;
    --ok: #34D399;
    --alerta: #FBBF24;
    --erro: #F87171;

    --raio: 10px;
    --raio-grande: 16px;
    --sombra: 0 18px 50px rgba(2, 6, 15, 0.55);
    --fonte: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--fonte); }
html { -webkit-text-size-adjust: 100%; }
body { background-color: var(--fundo); color: var(--texto); position: relative; overflow-x: hidden; line-height: 1.45; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cor-primaria); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Botões ---------- */
button { border: none; cursor: pointer; font-family: inherit; color: inherit; background: none; }
.btn {
    border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px;
    transition: filter .15s, background-color .15s, border-color .15s, transform .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary   { background: var(--cor-primaria); color: #fff; }
.btn-success   { background: #10B981; color: #04140E; }
.btn-danger    { background: #DC2626; color: #fff; }
.btn-warning   { background: var(--cor-marca); color: #1A1104; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--texto); border-color: var(--linha); }
.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }
.btn-ghost     { background: transparent; color: var(--texto-2); }
.btn-ghost:hover:not(:disabled) { color: var(--texto); background: rgba(255,255,255,.05); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-bloco { width: 100%; }

/* ---------- Campos ---------- */
/* Rótulo em cima do campo: só nas telas/janelas novas (o painel do mapa tem rótulos próprios) */
:where(.gm-modal, .login-form, .adm, fieldset, .painel) label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--texto-2); }
.campo, select.campo, textarea.campo {
    width: 100%; min-height: 40px; background: var(--fundo-2); border: 1px solid var(--linha); color: var(--texto);
    border-radius: 9px; padding: 8px 12px; font-size: 14px; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
textarea.campo { min-height: 80px; resize: vertical; }
.campo::placeholder { color: var(--texto-fraco); }
.campo:focus { outline: none; border-color: var(--cor-primaria); box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.22); }
.campo:disabled { opacity: .6; }
.check { display: flex; flex-direction: row; align-items: center; gap: 9px; font-weight: 600; color: var(--texto); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--cor-primaria); }
.dica { font-size: 12px; color: var(--texto-fraco); font-weight: 500; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grade-inteira { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--texto-2); }

/* ---------- Avisos dentro das telas ---------- */
.aviso { border-radius: var(--raio); padding: 10px 12px; font-size: 13px; font-weight: 600; border: 1px solid; }
.aviso-alerta { background: rgba(242, 165, 65, 0.1); border-color: rgba(242, 165, 65, 0.4); color: #FCD9A6; }
.aviso-erro   { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.4); color: #FECACA; }
.aviso-ok     { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.4); color: #BBF7D0; }

/* ---------- Selos ---------- */
.selo { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.selo-ok     { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.selo-alerta { color: var(--alerta); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.selo-erro   { color: var(--erro); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.selo-info   { color: #93C5FD; border-color: rgba(147,197,253,.35); background: rgba(147,197,253,.08); }
.selo-neutro { color: var(--texto-2); border-color: var(--linha); background: rgba(255,255,255,.03); }

/* ---------- Janelas (modais) ---------- */
.gm-modal {
    position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(5, 9, 17, 0.72); backdrop-filter: blur(6px);
}
.gm-modal-caixa {
    background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio-grande); box-shadow: var(--sombra);
    width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px;
    animation: gmAbrir .16s ease-out;
}
.gm-modal-pequeno { max-width: 420px; }
.gm-modal-grande { max-width: 860px; }
.gm-modal-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gm-modal-titulo { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.gm-modal-sub { font-size: 13px; color: var(--texto-fraco); margin-top: 2px; }
.gm-modal-texto { font-size: 14px; color: var(--texto-2); white-space: pre-line; }
.gm-modal-acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.gm-fechar { width: 32px; height: 32px; border-radius: 8px; color: var(--texto-fraco); font-size: 15px; flex-shrink: 0; }
.gm-fechar:hover { background: rgba(255,255,255,.06); color: var(--texto); }
@keyframes gmAbrir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 200000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    background: rgba(21, 34, 56, 0.97); border: 1px solid var(--linha); border-left: 4px solid var(--cor-primaria); color: var(--texto);
    padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: var(--sombra);
    animation: slideInToast .25s ease-out forwards; max-width: 380px; line-height: 1.45; pointer-events: auto; white-space: pre-line;
}
.toast.success { border-left-color: #10B981; }
.toast.error   { border-left-color: #EF4444; }
.toast.warning { border-left-color: var(--cor-marca); }
.toast.fade-out { animation: fadeOutToast .3s ease forwards; }
@keyframes slideInToast { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes fadeOutToast { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Rodapé ---------- */
.site-footer { font-size: 12px; color: var(--texto-fraco); letter-spacing: .02em; }

/* ---------- Bloco de senha da "Minha conta" ---------- */
.bloco-senha .grade-2 { margin-top: 2px; }

@media (max-width: 640px) {
    .grade-2 { grid-template-columns: 1fr; }
    .toast-container { left: 12px; right: 12px; bottom: 12px; }
    .toast { max-width: 100%; }
    .gm-modal-caixa { padding: 18px; }
}

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