/*
 * Páginas de interação do broker — ADR-04.
 *
 * Derivado do mockup `docs/design-system/Login.html`, com três desvios que a
 * CSP do TDD §8 (`default-src 'none'; style-src 'self'; img-src 'self'`) impõe,
 * e que estão registrados aqui porque a comparação com o mockup vai acontecer:
 *
 * 1. **Sem Poppins.** O mockup carrega a fonte de `fonts.googleapis.com`, que a
 *    CSP bloqueia — e `font-src` não está liberada. A pilha abaixo usa a fonte
 *    de sistema. Trazer Poppins exige hospedar o arquivo aqui e liberar
 *    `font-src 'self'`; é decisão de design, não de infraestrutura.
 * 2. **Sem `<style>` inline e sem JavaScript.** `style-src 'self'` recusa estilo
 *    embutido, e a ADR-04 escolheu server-rendered justamente para não ter JS no
 *    fluxo de login. As transições entre passos do mockup (animações, painel de
 *    tweaks, olho de senha) dependiam de React e saíram.
 * 3. **Imagem de fundo em JPEG redimensionado.** O PNG do mockup tem 2,3 MB —
 *    numa tela de login, isso é o primeiro byte que a pessoa espera. O JPEG de
 *    1600 px tem 296 KB.
 *
 * O que NÃO mudou: os tokens e os componentes (`ds-button`, `ds-input`,
 * `ds-field`, `ds-alert`) vêm dos arquivos do design system, vendorizados em
 * `public/ds/`.
 */

:root {
  --login-font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--login-font-sans);
  background: var(--ds-color-bg-base);
  color: var(--ds-color-text-primary);
  -webkit-font-smoothing: antialiased;
}

.login-page {
  display: flex;
  min-height: 100vh;
}

/* ── Painel de marca ── */

.brand-panel {
  flex: 1;
  background: var(--p-green-900);
  display: flex;
  flex-direction: column;
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.brand-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("/assets/img/brand-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Gradiente escuro por cima da foto: é ele que sustenta o contraste do texto. */
.brand-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    oklch(16% 0.045 150 / 0.78) 0%,
    oklch(18% 0.05 150 / 0.55) 35%,
    oklch(16% 0.045 150 / 0.7) 75%,
    oklch(14% 0.04 150 / 0.88) 100%
  );
}

.brand-panel__logo {
  height: 26px;
  object-fit: contain;
  object-position: left center;
  position: relative;
  z-index: 1;
}

.brand-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.brand-panel__tagline {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 600;
  color: var(--p-neutral-0);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 460px;
}

.brand-panel__desc {
  font-size: 0.9375rem;
  color: oklch(78% 0.055 150);
  line-height: 1.65;
  max-width: 460px;
  margin: 0;
}

.brand-panel__footer {
  font-size: 0.75rem;
  color: oklch(70% 0.03 150);
  position: relative;
  z-index: 1;
}

/*
 * O link do rodapé herda a cor do rodapé em vez de cair no azul default do
 * navegador, que brigaria com a paleta do painel. O sublinhado fica, porque é
 * o que sinaliza "isto é clicável" numa página sem JavaScript.
 */
.brand-panel__footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.brand-panel__footer-link:hover,
.brand-panel__footer-link:focus-visible {
  color: oklch(88% 0.04 150);
}

/* ── Painel do formulário ── */

.form-panel {
  width: 460px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ds-color-surface);
  padding: 40px 44px;
  box-shadow: -1px 0 0 0 var(--ds-color-border-subtle);
  overflow-y: auto;
}

.form-panel__inner {
  width: 100%;
  max-width: 340px;
}

.form-panel__mobile-header {
  display: none;
  margin-bottom: 36px;
}

.form-panel__mobile-header img {
  height: 22px;
}

@media (max-width: 768px) {
  .brand-panel {
    display: none;
  }

  .form-panel {
    width: 100%;
    padding: 32px 24px 40px;
    justify-content: flex-start;
    min-height: 100vh;
  }

  .form-panel__mobile-header {
    display: flex;
  }
}

.form-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ds-color-brand-subtle);
  color: var(--ds-color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}

.form-hero-icon--aviso {
  background: var(--ds-color-warning-subtle, var(--ds-color-brand-subtle));
  color: var(--ds-color-warning, var(--ds-color-brand));
}

.form-hero-icon--erro {
  background: var(--ds-color-danger-subtle, var(--ds-color-brand-subtle));
  color: var(--ds-color-danger, var(--ds-color-brand));
}

.form-heading {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ds-color-text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.014em;
  line-height: 1.3;
}

.form-sub {
  font-size: 0.875rem;
  color: var(--ds-color-text-secondary);
  margin: 0 0 28px;
  line-height: 1.55;
}

.form-cta {
  margin-top: 22px;
}

.w-full {
  width: 100%;
}

/* Recapitulação do identificador digitado, nas telas de retorno. */
.id-recap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ds-color-bg-subtle, var(--ds-color-surface-sunken));
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-md);
  padding: 9px 12px;
  margin-bottom: 20px;
}

.id-recap__value {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ds-color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Correlation id: o número que a pessoa passa para o suporte. */
.correlacao {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--ds-color-border-subtle);
  font-size: 0.75rem;
  color: var(--ds-color-text-secondary);
}

.correlacao__valor {
  display: block;
  margin-top: 4px;
  font-family: var(--ds-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem;
  color: var(--ds-color-text-primary);
  word-break: break-all;
}

.form-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--ds-color-border-subtle);
  font-size: 0.75rem;
  color: var(--ds-color-text-secondary);
  text-align: center;
}
