/* Elefante: sistema visual. Escuro (padrão, estilo HUD) e claro. Títulos serifados, texto de leitura fácil. */
@font-face { font-family: 'Fraunces'; src: url(/fontes/fraunces.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fontes/fraunces-italico.woff2) format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fontes/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Mono'; src: url(/fontes/mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Mono'; src: url(/fontes/mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --fundo: #080F1D; --fundo-2: #0B1526; --painel: rgba(17, 30, 48, .72); --painel-solido: #111E30; --painel-2: #162740;
  --linha: rgba(34, 211, 238, .12); --linha-forte: rgba(34, 211, 238, .30);
  --texto: #F1F5F9; --texto-2: #94A3B8; --texto-3: #6B7E96;
  --ciano: #22D3EE; --ciano-2: #06B6D4; --ciano-fundo: rgba(34, 211, 238, .09); --brilho: 0 0 0 1px rgba(34,211,238,.25), 0 0 24px rgba(34,211,238,.18); --azul: #2563EB;
  --ambar: #F59E0B; --verde: #5effb1; --rosa: #ff7ab6; --violeta: #a98bff; --vermelho: #ff6b7a;
  --raio: 14px; --raio-p: 10px; --sombra: 0 20px 60px rgba(0, 0, 0, .45);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: 'Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}
[data-tema="claro"] {
  --fundo: #F1F5F9; --fundo-2: #E6ECF3; --painel: rgba(255, 255, 255, .86); --painel-solido: #FFFFFF; --painel-2: #F6F8FB;
  --linha: rgba(8, 15, 29, .10); --linha-forte: rgba(14, 116, 144, .32);
  --texto: #080F1D; --texto-2: #3A4A60; --texto-3: #5F6F84;
  --ciano: #0E7490; --ciano-2: #155E75; --ciano-fundo: rgba(14, 116, 144, .08); --brilho: 0 0 0 1px rgba(14,116,144,.25), 0 6px 20px rgba(14,116,144,.12); --azul: #2563EB;
  --ambar: #B45309; --verde: #0f8a55; --rosa: #c02a6f; --violeta: #5b3fd1; --vermelho: #c62839;
  --sombra: 0 14px 40px rgba(13, 27, 42, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--ciano); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(34, 211, 238, .28); }
:focus-visible { outline: 2px solid var(--ciano); outline-offset: 2px; border-radius: 6px; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fundo tecnológico: grade fina + brilhos */
.fundo-hud { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fundo-hud::before { content: ''; position: absolute; inset: -1px; background-image: linear-gradient(var(--linha) 1px, transparent 1px), linear-gradient(90deg, var(--linha) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); opacity: .55; }
.fundo-hud::after { content: ''; position: absolute; width: 1100px; height: 1100px; left: 50%; top: -620px; transform: translateX(-50%); background: radial-gradient(circle, rgba(34, 211, 238, .16), transparent 60%); }
[data-tema="claro"] .fundo-hud::after { background: radial-gradient(circle, rgba(14, 116, 144, .10), transparent 60%); }

/* Tipografia */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; line-height: 1.12; margin: 0; font-optical-sizing: auto; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 400; }
h3 { font-size: 1.3rem; }
em.destaque, .destaque { font-style: italic; color: var(--ciano); }
.rotulo { font: 500 .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .16em; color: var(--ciano); }
.rotulo.apagado { color: var(--texto-3); }
.sub { color: var(--texto-2); font-size: 1.08rem; }
.mono { font-family: var(--mono); }
.pequeno { font-size: .86rem; color: var(--texto-2); }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: 10px; font: 500 .95rem/1 var(--mono); letter-spacing: .28em; color: var(--texto); }
.logo { display: block; width: 34px; height: 34px; flex: none; object-fit: contain; }
[data-tema="claro"] .logo { background: #080F1D; border-radius: 22%; padding: 2px; box-shadow: 0 2px 8px rgba(8, 15, 29, .18); }
.marca:hover { text-decoration: none; }
.marca-mini { font: 500 .75rem var(--mono); letter-spacing: .3em; color: var(--ciano); display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.marca-ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--ciano); box-shadow: 0 0 12px var(--ciano); }
.assinatura { font-family: var(--serif); color: var(--texto-2); }
.assinatura b { font-weight: 500; color: var(--texto); }
.assinatura .e { color: var(--ciano); font-style: italic; }

/* Botões */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; font-size: 1rem; letter-spacing: .005em;
  background: linear-gradient(135deg, #67E8F9, var(--ciano) 45%, var(--ciano-2)); color: #04111C; box-shadow: 0 0 0 1px rgba(34,211,238,.5), 0 10px 30px rgba(6,182,212,.28); transition: transform .15s, box-shadow .2s, filter .2s; text-decoration: none !important; }
.botao:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 0 0 1px rgba(34,211,238,.7), 0 14px 40px rgba(6,182,212,.38); }
.botao:active { transform: translateY(0); }
.botao[disabled] { opacity: .55; cursor: wait; transform: none; }
[data-tema="claro"] .botao { color: #fff; background: linear-gradient(135deg, #0891B2, var(--ciano) 50%, var(--ciano-2)); }
/* Acento âmbar do branding: pontual, para chamar a ação */
.botao.quente { background: linear-gradient(135deg, #FCD34D, #F59E0B 50%, #D97706); color: #1C1100; box-shadow: 0 0 0 1px rgba(245,158,11,.55), 0 10px 30px rgba(245,158,11,.26); }
.botao.quente:hover { box-shadow: 0 0 0 1px rgba(245,158,11,.85), 0 14px 40px rgba(245,158,11,.38); }
[data-tema="claro"] .botao.quente { color: #1C1100; background: linear-gradient(135deg, #FBBF24, #F59E0B 55%, #D97706); }
.quente-txt { color: var(--ambar); }
.botao.grande { padding: 18px 32px; font-size: 1.08rem; }
.botao.fantasma { background: transparent; color: var(--texto); box-shadow: inset 0 0 0 1px var(--linha-forte); }
.botao.fantasma:hover { background: var(--ciano-fundo); box-shadow: inset 0 0 0 1px var(--ciano); }
.botao.pequeno { padding: 9px 16px; font-size: .9rem; }
.botao.perigo { background: transparent; color: var(--vermelho); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vermelho) 50%, transparent); }
.botao.perigo:hover { background: color-mix(in srgb, var(--vermelho) 12%, transparent); }
.botao.cheio { width: 100%; }
.icone-botao { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--linha); background: var(--painel); cursor: pointer; color: var(--texto-2); transition: .15s; }
.icone-botao:hover { color: var(--ciano); border-color: var(--linha-forte); }
.icone-botao svg { width: 18px; height: 18px; }

/* Cartões com cantos de HUD */
.cartao { position: relative; background: var(--painel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cartao.hud::before, .cartao.hud::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--ciano); opacity: .8; pointer-events: none; }
.cartao.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--raio); }
.cartao.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--raio); }

/* Formulários */
.campo { display: grid; gap: 8px; margin-bottom: 16px; }
.campo label { font-size: .9rem; color: var(--texto-2); }
.entrada, textarea.entrada, select.entrada { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--linha-forte); background: color-mix(in srgb, var(--fundo) 70%, transparent); color: var(--texto); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.entrada:focus { outline: none; border-color: var(--ciano); box-shadow: 0 0 0 4px var(--ciano-fundo); }
.entrada::placeholder { color: var(--texto-3); }
textarea.entrada { resize: vertical; min-height: 120px; line-height: 1.6; }
.codigo-caixas { display: flex; gap: 10px; justify-content: center; margin: 8px 0 18px; }
.codigo-caixas input { width: 52px; height: 64px; text-align: center; font: 500 1.7rem var(--mono); border-radius: 12px; border: 1px solid var(--linha-forte); background: color-mix(in srgb, var(--fundo) 70%, transparent); color: var(--texto); caret-color: var(--ciano); }
.codigo-caixas input:focus { outline: none; border-color: var(--ciano); box-shadow: var(--brilho); }
.erro { color: var(--vermelho); font-size: .92rem; margin-top: 10px; min-height: 1.2em; }
.aviso { padding: 12px 16px; border-radius: 12px; background: var(--ciano-fundo); border: 1px solid var(--linha-forte); color: var(--texto-2); font-size: .93rem; }

/* Chips e etiquetas */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font: 500 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--linha-forte); color: var(--texto-2); background: var(--ciano-fundo); white-space: nowrap; }
.chip .ponto, .ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--ciano); box-shadow: 0 0 10px var(--ciano); display: inline-block; }
.chip.ok { color: var(--verde); border-color: color-mix(in srgb, var(--verde) 40%, transparent); background: color-mix(in srgb, var(--verde) 9%, transparent); }
.chip.ok .ponto { background: var(--verde); box-shadow: 0 0 10px var(--verde); }
.chip.alerta { color: var(--ambar); border-color: color-mix(in srgb, var(--ambar) 40%, transparent); background: color-mix(in srgb, var(--ambar) 9%, transparent); }
.chip.alerta .ponto { background: var(--ambar); box-shadow: 0 0 10px var(--ambar); }
.pulso { animation: pulso 2.2s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Telas simples (entrar, conectar, erro) */
.tela-simples { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.cartao-simples { width: 100%; max-width: 440px; background: var(--painel); border: 1px solid var(--linha); border-radius: 20px; padding: 34px 30px; box-shadow: var(--sombra); backdrop-filter: blur(16px); position: relative; }
.cartao-simples h1 { font-size: 2rem; margin-bottom: 10px; }
.cartao-simples p { color: var(--texto-2); margin: 0 0 22px; }
.cartao-simples .botao { margin-top: 4px; }
.passo { animation: entra .35s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rodape-simples { text-align: center; margin-top: 22px; font-size: .85rem; color: var(--texto-3); }
.rodape-simples a { color: var(--texto-2); }

/* Notificação */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--painel-solido); border: 1px solid var(--linha-forte); color: var(--texto); padding: 12px 18px; border-radius: 12px; box-shadow: var(--sombra); z-index: 100; transition: .25s; font-size: .95rem; max-width: calc(100vw - 32px); }
.toast.mostrar { opacity: 1; transform: translateX(-50%); }
.toast.ruim { border-color: var(--vermelho); }

/* Markdown */
.md { line-height: 1.72; color: var(--texto); overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.6em 0 .55em; }
.md h1 { font-size: 2rem; } .md h2 { font-size: 1.45rem; } .md h3 { font-size: 1.15rem; } .md h4 { font: 600 1rem var(--sans); }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 1em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--ciano); }
.md code { font: .88em var(--mono); background: var(--ciano-fundo); padding: .12em .4em; border-radius: 6px; }
.md pre { background: var(--fundo-2); border: 1px solid var(--linha); padding: 14px 16px; border-radius: 10px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 1em; padding: .4em 1em; border-left: 3px solid var(--ciano); color: var(--texto-2); background: var(--ciano-fundo); border-radius: 0 8px 8px 0; }
.md hr { border: 0; border-top: 1px solid var(--linha); margin: 2em 0; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--linha); padding: 8px 10px; text-align: left; }
.md th { background: var(--ciano-fundo); font-weight: 600; }
.md .vazio-md { color: var(--texto-3); font-style: italic; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
