/* ─── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.login {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: #f4f5f7;
  color: #1a1f2e;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ─── Institutional top bars ────────────────────────────────────────────────── */
.app-bar {
  height: 6px;
  background: #071D41;
}
.app-bar.yellow {
  height: 4px;
  background: #FFCD07;
}

/* ─── Env banner ────────────────────────────────────────────────────────────── */
.env-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: #fffbe6;
  border-bottom: 1px solid #FFCD07;
  font-size: 12px;
  color: #7a5c00;
}
.env-banner.prod {
  background: #e8f4ed;
  border-bottom-color: #2e7d52;
  color: #1a4d30;
}
.env-tag {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  padding: 2px 6px;
  background: #FFCD07;
  color: #3d2e00;
  border-radius: 3px;
  white-space: nowrap;
}
.env-banner.prod .env-tag {
  background: #2e7d52;
  color: #fff;
}
.env-msg { flex: 1; }
.env-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
  opacity: .7;
}

/* ─── Shell ─────────────────────────────────────────────────────────────────── */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}

/* ─── Left: brand ───────────────────────────────────────────────────────────── */
.login-brand {
  width: 420px;
  flex-shrink: 0;
  background: #071D41;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px 36px;
}

.brand-gov {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-gov img { height: 40px; width: auto; filter: brightness(0) invert(1); }
.gov-sep { width: 1px; height: 32px; background: rgba(255,255,255,.3); }
.gov-text { font-size: 12px; line-height: 1.4; opacity: .9; }
.gov-text b { display: block; }

.brand-title { flex: 1; }
.eyebrow-w {
  display: block;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 10px;
}
.brand-title h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}
.brand-title h1 .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #FFCD07;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}
.lede { font-size: 13px; opacity: .8; line-height: 1.6; }

.brand-facts { display: flex; flex-direction: column; gap: 14px; }
.bf-row { display: flex; gap: 10px; font-size: 12px; opacity: .8; line-height: 1.5; }
.bf-ic { flex-shrink: 0; font-size: 13px; margin-top: 1px; }

.brand-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: .5;
  flex-wrap: wrap;
  gap: 6px;
}
.brand-foot a { color: inherit; }

/* ─── Right: form panel ─────────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  padding: 40px 48px;
  background: #f8f8f8;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.login-applogo {
  width: 300px;
  height: auto;
  display: block;
  margin: 0 auto 28px;
}

/* ─── GOV.BR ──────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0;
}
.auth-divider span {
  flex: 1;
  height: 1px;
  background: #dde0e6;
}
.auth-divider span:first-child + span {
  flex: 0;
  font-size: 11px;
  color: #8a92a8;
  white-space: nowrap;
  background: none;
  height: auto;
}
.auth-divider span:last-child {
  flex: 1;
  height: 1px;
  background: #dde0e6;
}

.br-sign-in {
  border-radius: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #1351b4;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,.02);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  text-decoration: none;
}
.br-sign-in:hover {
  transform: translateY(-1px);
}
.br-sign-in img {
  height: 20px;
  width: auto;
}

.login-logo {
  width: 290px;
  height: auto;
  display: block;
  margin: 32px auto 0;
}

.login-appname {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #071D41;
  margin-bottom: 28px;
  font-variant-numeric: tabular-nums;
}

.lf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.lf-head h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.lf-intro { font-size: 13px; color: #5a6380; }
.lf-help {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #8a92a8;
  padding-top: 4px;
}

/* Alert */
.lf-alert {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 4px;
  background: #fff4f4;
  border: 1px solid #f5c0c0;
  margin-bottom: 20px;
}
.lf-alert.show { display: flex; }
.lf-alert.locked { background: #fff8e6; border-color: #FFCD07; }
.a-ic {
  font-size: 16px;
  font-weight: 700;
  color: #E52207;
  flex-shrink: 0;
  margin-top: 1px;
}
.lf-alert.locked .a-ic { color: #b8860b; }
.a-body { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.a-body b { font-weight: 600; }
.a-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8a92a8;
  margin-top: 2px;
}

/* Form */
.lf-form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field label { font-size: 13px; font-weight: 500; }
.field .hint { font-weight: 400; color: #8a92a8; margin-left: 6px; font-size: 12px; }
.field .err-msg { font-size: 12px; color: #E52207; display: none; }
.field.error .err-msg { display: block; }

.field.has-icon .input { padding-left: 36px; }
.fi-ic {
  position: absolute;
  left: 12px;
  top: 46px;
  transform: translateY(-50%);
  color: #8a92a8;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.fi-ic svg { width: 14px; height: 14px; }
.fi-toggle {
  position: absolute;
  right: 10px;
  top: 46px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #8a92a8;
  padding: 4px;
  display: flex;
  align-items: center;
}
.fi-toggle svg { width: 16px; height: 16px; }
.fi-toggle:hover { color: #1a1f2e; }

.caps-warn {
  display: none;
  font-size: 11px;
  color: #b8860b;
  background: #fff8e6;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 2px;
}
.caps-warn.show { display: block; }

.input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #888888;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: #1351B4;
  box-shadow: 0 0 0 3px rgba(19,81,180,.12);
}
.input.error { border-color: #E52207; }
.input::placeholder { color: #b0b8cc; }

.lf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input[type="checkbox"] { width: 15px; height: 15px; accent-color: #1351B4; cursor: pointer; }
.ghost-link { font-size: 13px; color: #1351B4; text-decoration: none; white-space: nowrap; }
.ghost-link:hover { text-decoration: underline; }

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  background: #1351B4;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  margin-top: 4px;
  width: 100%;
}
.btn-login:hover { background: #0C326F; }
.btn-login.loading { opacity: .7; cursor: not-allowed; }
.btn-login .arr { display: flex; align-items: center; }
.btn-login .arr svg { width: 18px; height: 18px; }

/* Form footer */
.lf-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  font-size: 12px;
  color: #8a92a8;
  flex-wrap: wrap;
  gap: 8px;
}
.lf-foot a { color: #1351B4; text-decoration: none; }
.lf-foot a:hover { text-decoration: underline; }
.lf-foot .build { display: flex; align-items: center; gap: 7px; }
.lf-foot .build .dot {
  width: 7px; height: 7px;
  background: #2e7d52;
  border-radius: 50%;
  display: inline-block;
}

/* ─── Page footer ───────────────────────────────────────────────────────────── */
.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid #e0e4ee;
  background: #fff;
  font-size: 11px;
  color: #8a92a8;
  flex-wrap: wrap;
  gap: 8px;
}
.lf-links { display: flex; gap: 16px; }
.lf-links a { color: #8a92a8; text-decoration: none; }
.lf-links a:hover { color: #1351B4; }
.lf-build { font-family: 'JetBrains Mono', monospace; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form { padding: 32px 24px; }
}
