/* ═══════════════════════════════════════════════════════════════
   Login — Gestão à Vista
   Identidade visual herdada do Portal Unificado Rede Damas
   (frontend/src/app/login). Escopo isolado em .login-page.
   ═══════════════════════════════════════════════════════════════ */
.login-page {
  --brand:        #0c77ad;
  --brand-dark:   #00517d;
  --brand-darker: #003f61;

  --bd:      #e5eaf0;
  --bd-soft: #f1f5f9;
  --ink:     #0f172a;
  --ink-2:   #334155;
  --ink-3:   #64748b;
  --ink-4:   #94a3b8;
  --ink-5:   #cbd5e1;

  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: var(--ink);
}
.login-page *, .login-page *::before, .login-page *::after { box-sizing: border-box; }

/* ── Topbar (só em mobile) ────────────────────────────────────── */
.login-topbar {
  display: none;
  align-items: center; gap: 10px;
  padding: 14px 20px;
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .15);
}
.login-topbar-logo { height: 30px; width: auto; }
.login-topbar-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }

/* ── Grid principal ───────────────────────────────────────────── */
.login-grid {
  flex: 1; min-height: 0;
  display: grid;
  /* ~54% marca / ~46% formulario: mais presenca da identidade, form mais compacto. */
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

/* ── BRAND SIDE (desktop) ─────────────────────────────────────── */
.brand {
  position: relative;
  color: #fff;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  /* Grafite AZULADO (DNA Rede Damas) + brilho azul de acento — sem virar "tela preta". */
  background:
    radial-gradient(90% 60% at 18% 10%, rgba(12, 119, 173, .20), transparent 60%),
    linear-gradient(165deg, #0f1b2d 0%, #10243a 55%, #143152 100%);
}
.brand-inner {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  padding: 48px 56px;
  gap: 40px;
}
@media (max-width: 1200px) { .brand-inner { padding: 40px 42px; gap: 28px; } }

.brand-top {
  display: flex; align-items: center; gap: 14px;
  animation: fadeUp .5s cubic-bezier(.2, .8, .2, 1) both;
}
.brand-logo { height: 48px; width: auto; }
.brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-name {
  font-size: 26px; font-weight: 800; letter-spacing: -.02em;
  line-height: 1.1; color: #fff;
}
.brand-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

.brand-heading {
  margin-top: auto;
  animation: fadeUp .5s cubic-bezier(.2, .8, .2, 1) .06s both;
}
.brand-heading h1 {
  margin: 0 0 18px;
  font-size: clamp(24px, 2.4vw, 32px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.15;
}
.brand-heading p {
  margin: 0; max-width: 44ch;
  font-size: 14.5px; line-height: 1.6; color: rgba(255, 255, 255, .72);
}

.brand-highlights {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 24px;
}
.brand-highlights li {
  display: flex; align-items: center; gap: 12px;
  animation: fadeUp .5s cubic-bezier(.2, .8, .2, 1) both;
}
.brand-highlights li:nth-child(1) { animation-delay: .12s; }
.brand-highlights li:nth-child(2) { animation-delay: .18s; }
.brand-highlights li:nth-child(3) { animation-delay: .24s; }
.brand-highlights .hl-ic {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .5);
}
.brand-highlights .hl-ic svg { width: 18px; height: 18px; }
.brand-highlights .hl-label {
  font-size: 13px; font-weight: 500; letter-spacing: 0;
  color: rgba(255, 255, 255, .68);
}

/* ── FORM SIDE ────────────────────────────────────────────────── */
.form-side {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px;
  background: #ffffff;
}
.login-card {
  width: 100%; max-width: 384px;
  background: #fff;
  border: none;
  border-radius: 20px;
  padding: 36px 34px 34px;
  /* Sombra etérea (borda pouco definida) — o form parece pousado, não encaixotado. */
  box-shadow: 0 18px 50px -28px rgba(15, 23, 42, .18);
  animation: cardIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

.login-card-hd {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; margin-bottom: 30px;
}
.card-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 6px;
}
.login-avatar {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 81, 125, .28);
  margin-bottom: 16px;
}
.login-avatar svg { width: 28px; height: 28px; }
.login-avatar-logo { height: 32px; width: auto; display: block; }
.login-card-hd h1 {
  margin: 0 0 7px;
  font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
}
.login-card-hd p { margin: 0; font-size: 13px; color: var(--ink-3); font-weight: 500; }

/* ── Mensagem de erro ─────────────────────────────────────────── */
.login-msg {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600; line-height: 1.4;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
  background: #fef2f2; color: #991b1b;
  animation: fadeUp .2s ease;
}
.login-msg svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Campos ───────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field label {
  display: block; margin-bottom: 9px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3);
}
.input-wrap { position: relative; }
.field input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #e9edf2;
  border-radius: 11px;
  background: #f4f6f9;
  font-size: 14px; color: var(--ink); font-family: inherit;
  outline: none;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.field input::placeholder { color: var(--ink-4); font-weight: 400; }
.field input:hover:not(:disabled) { background: #eef1f6; border-color: #dbe1ea; }
.field input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 119, 173, .10);
}
.input-wrap:has(.input-toggle) input { padding-right: 44px; }
.field input[aria-invalid="true"] {
  border-color: #dc2626;
  background: #fff;
}
.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px; font-weight: 600; line-height: 1.35;
  color: #b91c1c;
}
.field-error:empty { display: none; }
.input-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4);
  transition: color .15s, background .15s;
}
.input-toggle:hover { color: var(--ink-2); background: var(--bd-soft); }
.input-toggle svg { width: 18px; height: 18px; }

/* ── Botão Entrar ─────────────────────────────────────────────── */
.login-btn {
  margin-top: 14px;
  width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 81, 125, .15);
  transition: background .18s, box-shadow .18s, transform .06s;
}
.login-btn svg { width: 18px; height: 18px; }
.login-btn:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-darker) 100%);
  box-shadow: 0 5px 14px rgba(0, 81, 125, .18);
}
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .8; cursor: default; box-shadow: none; }
.login-spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: login-spin .6s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-spinner { animation: none; } }

/* ── Rodapé ───────────────────────────────────────────────────── */
.login-footer {
  margin-top: 20px;
  font-size: 11.5px; color: var(--ink-4); font-weight: 500; text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Responsividade
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .login-topbar { display: flex; }
  .login-grid { grid-template-columns: 1fr; }
  .brand { display: none; }
  .form-side { background: #f8fafc; }
}
@media (max-width: 480px) {
  .form-side { padding: 24px 16px; }
  .login-card { padding: 34px 24px 30px; border-radius: 18px; box-shadow: 0 16px 40px -18px rgba(15, 23, 42, .16); }
}

/* ── Animações ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .login-page * { animation: none !important; }
}
