/* Tela de login do auth-core: cartão central dividido (vermelho institucional + formulário). */

:root {
  --brand: #a8191f;
  --brand-hover: #8c1419;

  --bg: #f4f4f5;
  --surface: #ffffff;
  --text: #18181b;
  --text-muted: #52525b;
  --border: #e4e4e7;
  --border-strong: #a1a1aa;
  --field-bg: #ffffff;
  --link: #a8191f;
  --focus: #2563eb;
  --alert-bg: #fef2f2;
  --alert-border: #fecaca;
  --alert-text: #991b1b;

  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #18181b;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --border: #2e2e33;
    --border-strong: #71717a;
    --field-bg: #232327;
    --link: #fca5a5;
    --focus: #60a5fa;
    --alert-bg: #3b0d0d;
    --alert-border: #7f1d1d;
    --alert-text: #fecaca;
  }
}

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

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 720px;
}

/* Aviso da DITIC abaixo do cartão (ex.: como pedir cadastro em um sistema) */
.notice {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9375rem;
}

.notice-title {
  margin: 0 0 2px;
  font-weight: 600;
}

.notice-body {
  color: var(--text-muted);
}

.notice-body a {
  color: var(--link);
  text-underline-offset: 3px;
}

.notice-body > * {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 5fr 6fr;
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

/* Lado institucional: vermelho chapado */
.brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 28px;
  background: var(--brand);
  color: #ffffff;
}

.brand-seal {
  display: block;
  width: 56px;
  height: 56px;
}

.brand-name {
  margin: 16px 0 6px;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
}

.brand-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.brand-footer {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Formulário */
.panel {
  padding: 32px 32px 28px;
}

h1 {
  margin: 0 0 2px;
  font-size: 1.375rem;
  line-height: 1.25;
}

.lede {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--alert-border);
  border-radius: var(--radius);
  background: var(--alert-bg);
  color: var(--alert-text);
  font-size: 0.9375rem;
}

.alert-icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: currentColor;
}

.field {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}

input::placeholder {
  color: var(--text-muted);
}

select:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hint {
  margin: 6px 0 0;
  min-height: 1.25em;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.password {
  position: relative;
}

.password input {
  padding-right: 88px;
}

.reveal {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.reveal:hover {
  background: var(--alert-bg);
}

.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.submit:hover {
  background: var(--brand-hover);
}

.submit[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: 0.9375rem;
}

.links a {
  color: var(--link);
  text-underline-offset: 3px;
}

.links a.muted {
  color: var(--text-muted);
}

/* Celular: cartão em coluna, faixa vermelha no topo */
@media (max-width: 767px) {
  body {
    align-items: flex-start;
    padding: 16px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .brand {
    padding: 20px;
  }

  .brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .brand-seal {
    width: 48px;
    height: 48px;
  }

  .brand-name {
    margin: 0 0 2px;
    font-size: 1.0625rem;
  }

  .brand-tagline {
    font-size: 0.875rem;
  }

  .brand-footer {
    display: none;
  }

  .panel {
    padding: 24px 20px 28px;
  }
}
