/* ABE Platform — telas de autenticação. Preto e cinza, sem dependências externas. */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --panel: #111214;
  --panel-text: #e8e9eb;
  --panel-muted: #8b8e94;
  --text: #16171a;
  --muted: #62656b;
  --border: #d9dbdf;
  --input: #ffffff;
  --focus: #3a3d42;
  --primary: #111214;
  --primary-text: #ffffff;
  --primary-hover: #2b2d31;
  --danger-bg: #fbeaea;
  --danger: #8f1d1d;
  --ok-bg: #e9f3ec;
  --ok: #1f5a33;
  --radius: 10px;
  --logo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0d;
    --surface: #17181b;
    --panel: #000000;
    --text: #eceef1;
    --muted: #9a9da3;
    --border: #2c2e33;
    --input: #101113;
    --focus: #c9ccd1;
    --primary: #eceef1;
    --primary-text: #111214;
    --primary-hover: #ffffff;
    --danger-bg: #3a1618;
    --danger: #f3b4b4;
    --ok-bg: #16301f;
    --ok: #b6e2c3;
    --logo-filter: invert(1);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell { display: grid; grid-template-columns: minmax(280px, 40%) 1fr; min-height: 100%; }

.brand {
  background: var(--panel);
  color: var(--panel-text);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px;
}
.brand img { width: 96px; height: 96px; object-fit: contain; filter: var(--brand-logo-filter, invert(1)); }
.brand h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 32px 0 8px; }
.brand p { color: var(--panel-muted); margin: 0; max-width: 32ch; }
.brand footer { color: var(--panel-muted); font-size: 13px; }

.content { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}
.card-logo { display: none; width: 56px; height: 56px; object-fit: contain; margin-bottom: 16px; filter: var(--brand-logo-filter, var(--logo-filter)); }
.card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.card .subtitle { margin: 0 0 24px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px;
  background: var(--input); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font: inherit;
}
.field input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.field input.code { letter-spacing: .4em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 16px; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 11px 16px;
  background: var(--primary); color: var(--primary-text);
  border: 0; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }

a { color: var(--text); }
.muted { color: var(--muted); }
.footer-link { text-align: center; margin: 20px 0 0; font-size: 14px; color: var(--muted); }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .brand { display: none; }
  .card-logo { display: block; }
  .card { padding: 24px; border: 0; box-shadow: none; background: transparent; }
  .content { align-items: flex-start; padding-top: 48px; }
}

.content-inner { width: 100%; max-width: 400px; }
.languages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 20px; font-size: 13px; }
.languages a { color: var(--muted); text-decoration: none; }
.languages a:hover { color: var(--text); text-decoration: underline; }
.languages a.active { color: var(--text); font-weight: 600; }

/* Perfil, foto e consentimento */
.card h3 { font-size: 15px; font-weight: 600; margin: 28px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); }
.card h3:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.optional { color: var(--muted); font-weight: 400; }
.picture-field { display: flex; align-items: center; gap: 12px; }
.picture-field input[type=file] { font: inherit; font-size: 13px; color: var(--muted); min-width: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg); border: 1px solid var(--border); flex: none; }
.picture-form { margin-bottom: 8px; }
.picture-form .btn { margin-top: 12px; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.consent-deny { margin-top: 8px; }
.scopes { list-style: none; margin: 0 0 24px; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.scopes li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; }
.scopes li + li { border-top: 1px solid var(--border); }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); white-space: nowrap; }
.apps { list-style: none; margin: 0; padding: 0; }
.apps li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.apps li span { display: block; font-size: 13px; }
.logout { margin-top: 28px; }
input[type=date] { min-height: 42px; }
