:root {
  --blue-dark: #071d41;
  --blue-brand: #1351b4;
  --gov-blue: #2563eb;
  --gov-yellow: #ffbe00;
  --gov-green: #009c3b;
  --blue-button: #2670e8;
  --blue-button-hover: #1e5bc6;
  --yellow-brand: var(--gov-yellow);
  --green-badge: #168821;
  --gray-border: #ccc;
  --gray-muted: #555;
  --gray-shell: #ededed;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 4px;
  --bp-desktop: 900px;
  /* Layout gov.br (ref. ~1766×832) */
  --header-h: 70px;
  --layout-max: 1300px;
  --layout-gap: 82px;
  --promo-max-w: 845px;
  --promo-max-h: 611px;
  --form-max-w: 375px;
  --form-max-h: 700px;
  --page-bg: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--blue-dark);
  background: var(--page-bg);
}

body.high-contrast {
  --gray-shell: #000;
  --blue-dark: #fff;
  background: #000;
  color: #fff;
}

body.high-contrast .card,
body.high-contrast .site-header {
  background: #000;
  border-color: #fff;
  color: #fff;
}

/* —— Header —— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.site-header__logo .gov-brand__img {
  height: 1.75rem;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue-brand);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.header-link:hover {
  text-decoration: underline;
}

.header-link__icon {
  display: flex;
  color: var(--blue-brand);
}

/* —— Shell / grid —— */
.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
}

.login-layout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100dvh - var(--header-h));
  padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 4vw, 2rem);
  background: var(--page-bg);
}

.login-layout__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  gap: 1.25rem;
}

/* Mobile: sem banner */
.promo--desktop {
  display: none;
}

.login-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
}

.card {
  width: 100%;
  max-width: var(--form-max-w);
  padding: 1.35rem 1.15rem 1.15rem;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

@media (max-width: 991px) {
  .header-link__label {
    display: none;
  }

  .header-link {
    padding: 0.35rem;
  }

  .login-layout {
    align-items: flex-start;
    background: var(--gray-shell);
  }

  .login-panel {
    padding: 0.75rem 0.65rem 1.5rem;
  }

  .field__input::placeholder {
    font-style: italic;
  }

  .form__actions {
    justify-content: stretch;
  }

  .btn-primary {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 1rem;
  }

  .card-footer {
    display: block;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .promo--desktop {
    display: flex;
    justify-content: center;
  }

  .promo__banner {
    width: 100%;
    max-width: min(100%, var(--promo-max-w));
    max-height: min(50vh, var(--promo-max-h));
    object-fit: contain;
  }
}

@media (min-width: 992px) {
  .login-layout__inner {
    display: grid;
    grid-template-columns: minmax(0, 845fr) minmax(0, 375fr);
    column-gap: min(var(--layout-gap), 6.3vw);
    align-items: start;
  }

  .promo--desktop {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: var(--promo-max-w);
    max-height: var(--promo-max-h);
    overflow: hidden;
  }

  .promo__banner {
    display: block;
    width: 100%;
    height: auto;
    max-width: var(--promo-max-w);
    max-height: var(--promo-max-h);
    object-fit: contain;
    object-position: top center;
  }

  .login-panel--cpf {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: var(--form-max-w);
  }

  .card--cpf {
    width: 100%;
    max-width: var(--form-max-w);
    max-height: var(--form-max-h);
    overflow: auto;
    padding: 1.75rem 1.35rem 1.35rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  .card--cpf .field__input::placeholder {
    font-style: italic;
  }

  .app-footer--login {
    display: none;
  }

  .form__actions {
    justify-content: flex-end;
  }

  .btn-primary {
    width: auto;
    min-width: 8.5rem;
  }
}

.card__title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--blue-dark);
}

.method {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: var(--blue-brand);
  font-weight: 600;
  font-size: 1rem;
}

.method__icon {
  display: flex;
  color: var(--blue-brand);
}

.card__hint {
  margin: 0 0 1.15rem;
  font-size: 0.9375rem;
  color: var(--blue-dark);
}

.card__hint strong {
  font-weight: 700;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
}

.field__input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field__input::placeholder {
  color: #888;
}

.field__input:focus {
  border-color: var(--blue-brand);
  box-shadow: 0 0 0 2px rgba(19, 81, 180, 0.12);
}

.field__input--error {
  border-color: #e52207;
}

.field__error {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #e52207;
}

.form__actions {
  display: flex;
  margin-top: 0.35rem;
}

.btn-primary {
  min-width: 8.5rem;
  padding: 0.55rem 1.75rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--blue-button);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-button-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.divider {
  margin: 1.5rem 0 1rem;
  border: none;
  border-top: 1px solid #e0e0e0;
}

.alt-options__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blue-dark);
}

.alt-options__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alt-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-brand);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.alt-option:hover {
  text-decoration: underline;
}

.alt-option__icon {
  display: flex;
  flex-shrink: 0;
  color: var(--blue-brand);
}

.alt-option__icon--green {
  color: var(--green-badge);
}

.alt-option--bank .alt-option__text {
  color: var(--green-badge);
}

.alt-option__text {
  flex: 1;
}

.card-footer {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.card-footer__help {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-brand);
  text-decoration: none;
}

.card-footer__help:hover {
  text-decoration: underline;
}

.card-footer__help-icon {
  display: flex;
  color: var(--blue-brand);
}

.card-footer__legal {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-brand);
  text-decoration: none;
  text-align: center;
}

.card-footer__legal:hover {
  text-decoration: underline;
}

.badge {
  flex-shrink: 0;
  padding: 0.15rem 0.4rem;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--green-badge);
  border-radius: 2px;
  line-height: 1.25;
  max-width: 46%;
  text-align: center;
}

@media (max-width: 380px) {
  .header-link {
    font-size: 0.75rem;
  }

  .site-header__nav {
    gap: 0.35rem;
  }

  .badge {
    max-width: 50%;
  }
}
