/* MB Informática - "Engenharia da Informação": obsidiana + platina + cromo, sinal teal.
   Fontes locais (CSP font-src 'self'); licenças OFL em /fonts/OFL-*.txt. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- tokens: escuro por padrão ---------- */
:root {
  color-scheme: dark;
  --bg: #0a0b0d; --panel: #111418; --panel2: #171b21; --line: #262c35; --line2: #363d48;
  --field-line: #677180; /* >= 3:1 contra o fundo do campo (borda de controle visível) */
  --ink: #f2f4f7; --muted: #9ba3af; --dim: #848c99;
  --sig: #6fd0e2; --sig-text: #6fd0e2; --sig-soft: rgba(111, 208, 226, .11); --sig-line: rgba(111, 208, 226, .38);
  --chrome-l: #f4f7fb; --chrome-m: #c3ccd8; --chrome-d: #8b96a5;
  --bad: #f26d6d; --bad-soft: rgba(242, 109, 109, .12);
  --grid: rgba(242, 244, 247, .035);
  --shadow: 0 18px 50px -28px rgba(0, 0, 0, .9);
  --display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f7fa; --panel: #ffffff; --panel2: #f3f5f9; --line: #d3dae4; --line2: #bcc5d3;
    --field-line: #7b8595;
    --ink: #0d1117; --muted: #4a5462; --dim: #5f6a79;
    --sig: #0c7a91; --sig-text: #0a6479; --sig-soft: rgba(12, 122, 145, .09); --sig-line: rgba(12, 122, 145, .4);
    --chrome-l: #454e5c; --chrome-m: #10151c; --chrome-d: #6b7482;
    --bad: #c42f2f; --bad-soft: rgba(196, 47, 47, .09);
    --grid: rgba(13, 17, 23, .04);
    --shadow: 0 18px 40px -26px rgba(20, 30, 45, .35);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 600px at 12% 10%, var(--sig-soft), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; }
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--sig-text);
}

/* ---------- layout ---------- */
.lwrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 56px;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px;
}
.mono-mark { display: block; width: 64px; height: 66px; margin-bottom: 22px; }
.chrome-l { stop-color: var(--chrome-l); }
.chrome-m { stop-color: var(--chrome-m); }
.chrome-d { stop-color: var(--chrome-d); }
.lbrand h1 {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  margin: 10px 0 0;
}

/* ---------- cartão (canto chanfrado) ---------- */
.lcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: linear-gradient(180deg, var(--panel2), var(--panel) 140px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.lcard h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 4px;
}

/* ---------- abas ---------- */
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel2);
}
.seg [role="tab"] {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.seg [role="tab"] + [role="tab"] { border-left: 1px solid var(--line); }
.seg [role="tab"]:hover { color: var(--ink); }
.seg [role="tab"][aria-selected="true"] {
  background: var(--sig-soft);
  color: var(--sig-text);
  box-shadow: inset 0 -2px 0 var(--sig);
}
.seg [role="tab"]:focus-visible { outline-offset: -3px; }
.lpanel { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
#login { display: flex; flex-direction: column; gap: 14px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line2);
  background: transparent;
  padding: 10px 16px;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--sig); transform: translateY(-1px); }
.btn:active { transform: none; }
/* O chanfro (clip-path) cortaria um contorno externo: o foco fica por dentro. */
.btn:focus-visible { outline: 2px solid var(--sig); outline-offset: -5px; }
.btn.pri {
  background: linear-gradient(135deg, #7fdae8 0%, #45bdd3 55%, #2ba6bd 100%);
  border-color: transparent;
  color: #05141b;
  font-weight: 500;
}
.btn.pri:hover { background: linear-gradient(135deg, #93e3ef 0%, #52c8dd 55%, #33b2c9 100%); }
.btn.pri:focus-visible { outline-color: #05141b; }
.lbig { width: 100%; padding: 13px 16px; }
.btn svg.logo { width: 16px; height: 16px; flex: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.field input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 4px;
  /* Cores SEMPRE explícitas: o campo nunca herda o tema do navegador (escuro sobre branco). */
  background-color: var(--panel2);
  color: var(--ink);
  caret-color: var(--sig);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  outline: none;
  border-color: var(--sig);
  box-shadow: 0 0 0 1px var(--sig), 0 0 0 4px var(--sig-soft);
}
/* Preenchimento automático do Chrome/Edge/Safari: pinta o fundo do tema, nunca o amarelo/escuro do navegador. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--sig);
  -webkit-box-shadow: 0 0 0 1000px var(--panel2) inset;
  box-shadow: 0 0 0 1000px var(--panel2) inset;
  transition: background-color 600000s 0s, color 600000s 0s;
}
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--panel2) inset, 0 0 0 1px var(--sig);
  box-shadow: 0 0 0 1000px var(--panel2) inset, 0 0 0 1px var(--sig);
}
.field input:autofill { background-color: var(--panel2); color: var(--ink); }

.msg { margin: 0; min-height: 1.5em; font-size: 13px; color: var(--bad); }
.msg:empty { min-height: 0; }

/* ---------- telas estreitas ---------- */
@media (max-width: 900px) {
  .lwrap { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 512px; padding: 32px 16px; align-content: center; }
  .lbrand { display: flex; align-items: center; gap: 16px; }
  .mono-mark { width: 48px; height: 50px; margin: 0; flex: none; }
  .lbrand h1 { font-size: 40px; margin-top: 6px; }
}
@media (max-width: 400px) {
  .lcard { padding: 22px 18px; }
  .seg [role="tab"] { padding: 10px 4px; font-size: 10.5px; letter-spacing: .03em; }
}
