/* ═══════════════════════════════════════════════════════════════
   login.css — NexusERP
   Tela de login standalone (não usa nexus-base.css)
═══════════════════════════════════════════════════════════════ */

:root {
  --navy:       #0F1C2E;
  --navy-light: #162032;
  --navy-mid:   #1E2D42;
  --accent:     #3B82F6;
  --accent-h:   #2563EB;
  --emerald:    #10B981;
  --rose:       #F43F5E;
  --border:     #E2E8F0;
  --text-main:  #1E293B;
  --text-muted: #94A3B8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Sora', sans-serif;
  background: var(--navy);
  color: var(--text-main);
  overflow: hidden;
}

/* ── Fundo animado ─────────────────────────────────────────── */
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: var(--navy);
  overflow: hidden;
}

.bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .18;
  animation: blobFloat 12s ease-in-out infinite;
}
.bg-blob-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #3B82F6, transparent 70%);
  top: -140px; left: -120px;
  animation-duration: 14s;
}
.bg-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #10B981, transparent 70%);
  bottom: -100px; right: -80px;
  animation-duration: 18s; animation-delay: -6s;
}
.bg-blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8B5CF6, transparent 70%);
  top: 50%; left: 55%;
  animation-duration: 10s; animation-delay: -3s;
}
@keyframes blobFloat {
  0%,100% { transform: translate(0, 0) scale(1);   }
  33%      { transform: translate(20px,-30px) scale(1.06); }
  66%      { transform: translate(-15px,20px) scale(.95); }
}

/* Grade de pontos */
.login-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Wrapper centralizado ──────────────────────────────────── */
.login-wrapper {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 16px;
}

/* ── Brand / Logo ──────────────────────────────────────────── */
.login-brand {
  text-align: center; margin-bottom: 28px;
  animation: fadeSlideDown .6s cubic-bezier(.34,1.56,.64,1) both;
}
.brand-logo {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.brand-logo-icon {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #6366F1);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(59,130,246,.4);
}
.brand-logo-icon svg { width: 22px; height: 22px; }
.brand-logo-name {
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em;
}
.brand-tagline {
  font-size: 12.5px; color: rgba(255,255,255,.35); letter-spacing: .04em;
}

/* ── Card ──────────────────────────────────────────────────── */
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.97);
  border-radius: 24px;
  padding: 36px 36px 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  animation: fadeSlideUp .65s cubic-bezier(.34,1.56,.64,1) .1s both;
}

.login-card h2 {
  font-size: 20px; font-weight: 800; color: var(--text-main);
  margin-bottom: 4px;
}
.login-card .sub {
  font-size: 13px; color: var(--text-muted); margin-bottom: 28px;
}

/* ── Grupos de formulário ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block; font-size: 12px; font-weight: 700;
  color: #475569; margin-bottom: 6px; letter-spacing: .03em;
  text-transform: uppercase;
}

.input-wrap { position: relative; }

.input-wrap input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-family: 'Sora', sans-serif; font-size: 14px; color: var(--text-main);
  background: #F8FAFC; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #fff;
}
.input-wrap input.has-error {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(244,63,94,.1);
}

.icon-left {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #CBD5E1; font-size: 14px; pointer-events: none;
  transition: color .15s;
}
.input-wrap:focus-within .icon-left { color: var(--accent); }

.toggle-eye {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: #CBD5E1; font-size: 14px; cursor: pointer;
  transition: color .15s;
}
.toggle-eye:hover { color: var(--accent); }

/* ── Linha "Lembrar / Esqueci" ────────────────────────────── */
.form-extras {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.check-lembrar {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.check-lembrar input[type="checkbox"] { display: none; }
.check-box {
  width: 16px; height: 16px; border: 1.5px solid var(--border); border-radius: 5px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.check-lembrar input:checked ~ .check-box {
  background: var(--accent); border-color: var(--accent);
}
.check-box svg { display: none; }
.check-lembrar input:checked ~ .check-box svg { display: block; }
.check-lembrar .lbl { font-size: 12.5px; color: #64748B; }
.link-forgot { font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 600; }
.link-forgot:hover { text-decoration: underline; }

/* ── Mensagem de erro ─────────────────────────────────────── */
.error-msg {
  display: none; align-items: center; gap: 8px;
  background: #FFF1F2; border: 1px solid #FECDD3; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px; color: #BE123C;
  font-size: 13px; font-weight: 600;
  animation: shake .4s cubic-bezier(.36,.07,.19,.97);
}
.error-msg.show { display: flex; }
@keyframes shake {
  0%,100%{ transform:translateX(0);  }
  20%    { transform:translateX(-6px); }
  40%    { transform:translateX(6px); }
  60%    { transform:translateX(-4px); }
  80%    { transform:translateX(4px); }
}

/* ── Botão principal ──────────────────────────────────────── */
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--accent), #6366F1);
  color: #fff; border: none; border-radius: 13px;
  font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 6px 20px rgba(59,130,246,.35);
  transition: opacity .15s, transform .12s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover  { opacity: .92; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(59,130,246,.4); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Ripple */
.btn-login::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.25) 0%, transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.btn-login:active::after { opacity: 1; }

/* Spinner dentro do botão */
.spinner-sm {
  display: none; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner-sm { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divisor ──────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 18px;
}
.divider span {
  font-size: 11.5px; color: #CBD5E1; white-space: nowrap; font-weight: 600;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Badges de credenciais demo ───────────────────────────── */
.demo-creds {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.demo-pill {
  flex: 1; min-width: 0; background: #F1F5F9; border-radius: 10px;
  padding: 8px 10px; cursor: pointer; border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}
.demo-pill:hover { border-color: var(--accent); background: #EFF6FF; }
.demo-pill .dp-role {
  font-size: 10px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px;
}
.demo-pill .dp-user { font-size: 12px; font-weight: 600; color: #334155; }
.demo-pill .dp-pass { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ── Rodapé ───────────────────────────────────────────────── */
.login-footer {
  margin-top: 22px; font-size: 11.5px;
  color: rgba(255,255,255,.2); text-align: center;
  animation: fadeSlideUp .7s ease .25s both;
}

/* ── Animações de entrada ─────────────────────────────────── */
@keyframes fadeSlideDown {
  from { opacity:0; transform:translateY(-20px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
