/* Identidade visual Grupo Join: ver identidade-grupo-join-prompt.md e grupo-join-formularios.md */

@font-face { font-family: "Albert Sans"; src: url("fonts/albert-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("fonts/albert-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("fonts/albert-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("fonts/albert-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --font-sans: "Albert Sans", sans-serif;
  --color-primary: #003367;
  --color-primary-hover: oklch(26% .09 254);
  --color-brand-red: #dd1015;
  --color-paper: #ffffff;
  --color-canvas: #f1f5fa;
  --color-surface-alt: #e3eaf3;
  --color-line: oklch(89% .016 254);
  --color-ink: #12243a;
  --color-muted: #3b4f67;
  --color-faint: #718092; /* decorativo apenas */
  --color-field: oklch(70% .025 255);
  --color-field-hover: oklch(50% .04 255);
  --color-danger-bg: oklch(96% .015 25);
  --color-danger-line: oklch(76% .09 25);
  --color-danger-ink: oklch(38% .13 25);
  --brand-ink: oklch(96% .015 255);
  --brand-soft: oklch(82% .05 255);
  --focus-ring: oklch(55% .16 255);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, ::before, ::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; background: var(--color-canvas); color: var(--color-ink);
  font-family: var(--font-sans); font-size: .9375rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
input, button { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

/* Layout */
.login-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 100vh; }

/* §5.2 Painel de marca */
.brand-panel {
  color: var(--brand-ink); background-color: var(--color-primary);
  background-image: linear-gradient(to bottom, transparent 35%, var(--color-primary) 70%),
    repeating-linear-gradient(to bottom, transparent 0 2.4375rem, oklch(100% 0 0 / .06) 2.4375rem 2.5rem);
}
.login-brand { display: flex; flex-direction: column; padding: 3rem clamp(1.5rem, 4vw, 4rem); }
.login-logo { height: 4.5rem; width: auto; margin-left: -1rem; }
.login-brand-body { margin-top: auto; }
.login-purpose {
  font-weight: 700; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; letter-spacing: -.025em;
  max-width: 14ch; text-wrap: balance;
}
.login-purpose-sub { margin-top: 1rem; max-width: 38ch; color: var(--brand-soft); }
/* §5.3 Régua vermelha */
.login-ledger {
  list-style: none; padding: 1rem 0 0; margin-top: 2.5rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
  border-top: 2px solid var(--color-brand-red); font-size: .8125rem;
}
.login-ledger li { display: flex; flex-direction: column; gap: .25rem; }
.login-ledger span { font-size: .6875rem; letter-spacing: .12em; color: var(--brand-soft); font-variant-numeric: tabular-nums; }

/* Painel do formulário */
.login-panel { display: grid; grid-template-rows: 1fr auto; padding: 3rem clamp(1.5rem, 6vw, 6rem) 2rem; }
.login-card { width: 100%; max-width: 24rem; align-self: center; justify-self: center; }

/* §5.1 Nome do sistema com barra inclinada */
.app-name { display: flex; align-items: center; gap: .75rem; color: var(--color-primary); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 2.5rem; }
.app-name::before { content: ""; width: .375rem; height: 1.1em; background: var(--color-brand-red); transform: skewX(-14deg); flex-shrink: 0; }

.eyebrow { color: var(--color-primary); font-weight: 600; font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: .5rem; }
h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin-bottom: .75rem; }
.login-lede { color: var(--color-muted); margin-bottom: 1.75rem; }

/* Botão Microsoft (segue as diretrizes visuais da Microsoft: fundo claro, borda cinza, logo de 4 quadrados) */
.ms-button {
  display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; min-height: 2.875rem; padding: .625rem 1rem;
  background: #fff; border: 1px solid #8c8c8c; border-radius: .375rem; color: #5e5e5e; text-decoration: none;
  font-family: "Segoe UI", var(--font-sans); font-weight: 600; font-size: .9375rem;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.ms-button:hover { background: oklch(96.5% .003 255); border-color: #5e5e5e; color: #3b3b3b; }
.ms-button:active { background: oklch(93% .004 255); }
.ms-button[aria-disabled="true"] { pointer-events: none; opacity: .7; }

.login-divider { display: flex; align-items: center; gap: .75rem; margin: 1.75rem 0; font-size: .8125rem; color: var(--color-muted); }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--color-line); }

/* Campos — base: "Google like input field", Samuel Dawson (TailwindFlex, MIT) */
.login-form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .375rem; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.field label { font-size: .8125rem; font-weight: 500; color: var(--color-muted); }
.field input {
  min-height: 2.75rem; width: 100%; padding: 0 .75rem; border-radius: .375rem;
  border: 1px solid var(--color-field); background: var(--color-paper); font-size: 1rem; color: var(--color-ink);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.field input::placeholder { color: var(--color-faint); }
.field input:hover { border-color: var(--color-field-hover); }
.field input[aria-invalid="true"] { border-color: var(--color-danger-line); background: var(--color-danger-bg); }
.field-error { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 500; color: var(--color-danger-ink); }
.field-error::before {
  content: ""; width: 1rem; height: 1rem; flex-shrink: 0; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}

.field-password { position: relative; }
.field-password input { padding-right: 5.5rem; }
.password-toggle {
  position: absolute; top: 0; right: 0; height: 100%; min-width: 2.75rem; padding: 0 .875rem;
  background: none; border: 0; border-radius: .375rem; cursor: pointer;
  font-size: .8125rem; font-weight: 600; color: var(--color-primary);
}
.password-toggle:hover { text-decoration: underline; text-underline-offset: .2em; }

.link { color: var(--color-primary); font-size: .8125rem; font-weight: 600; text-decoration: none; text-underline-offset: .2em; }
.link:hover { text-decoration: underline; }

/* Checkbox */
.checkbox { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; cursor: pointer; color: var(--color-ink); }
.checkbox-box { position: relative; display: grid; place-items: center; width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.checkbox-box input {
  position: absolute; inset: 0; width: 1.25rem; height: 1.25rem; margin: 0; cursor: pointer; appearance: none;
  border: 1px solid var(--color-field); border-radius: .25rem; background: var(--color-paper);
  transition: background-color 140ms ease, border-color 140ms ease;
}
.checkbox-box input:not(:checked):hover { border-color: var(--color-field-hover); }
.checkbox-box input:checked { background: var(--color-primary); border-color: var(--color-primary); }
.checkbox-box svg { position: relative; width: .875rem; height: .875rem; color: #fff; opacity: 0; pointer-events: none; }
.checkbox-box input:checked + svg { opacity: 1; }

/* Botão primário */
.button-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 2.75rem; padding: 0 1.25rem;
  background: var(--color-primary); color: #fff; border: 0; border-radius: .375rem; cursor: pointer;
  font-size: .875rem; font-weight: 600; transition: background-color 140ms ease;
}
.button-primary:hover, .button-primary:active { background: var(--color-primary-hover); }
.button-primary:disabled { cursor: not-allowed; opacity: .6; }

.login-hint { margin-top: 1.75rem; font-size: .8125rem; color: var(--color-muted); max-width: 44ch; }
.login-footnote { margin-top: 3rem; font-size: .75rem; color: var(--color-muted); text-align: center; }

/* §7 Movimento */
@media (prefers-reduced-motion: no-preference) {
  .login-brand-body > *, .login-card > * { animation: login-rise 520ms var(--ease-out) both; }
  .login-purpose-sub { animation-delay: 60ms; }
  .login-ledger { animation-delay: 140ms; }
  .login-card > :nth-child(2) { animation-delay: 60ms; }
  .login-card > :nth-child(3) { animation-delay: 120ms; }
  .login-card > :nth-child(4) { animation-delay: 180ms; }
  .login-card > :nth-child(n+5) { animation-delay: 240ms; }
}
@keyframes login-rise { from { opacity: 0; transform: translateY(.5rem); } }
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { transition-duration: 0ms !important; animation: none !important; }
}

/* Celular */
@media (max-width: 52rem) {
  .login-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { padding: 1.5rem 1.25rem 1.75rem; gap: 1.5rem; }
  .login-logo { height: 3.5rem; margin-left: -.75rem; }
  .login-purpose { font-size: 1.625rem; max-width: 18ch; }
  .login-purpose-sub { display: none; }
  .login-ledger { margin-top: 1rem; font-size: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
  .login-ledger li { flex-direction: row; align-items: baseline; gap: .5rem; }
  .login-panel { padding: 2.5rem 1.25rem 1.5rem; }
  .login-card { align-self: start; }
  .app-name { margin-bottom: 1.75rem; }
  h1 { font-size: 2rem; }
}
