/* ══════════════════════════════════════════════════════════════════
   CheckMaster – Radar Operacional
   login.css – Estilos da Página de Login
   ══════════════════════════════════════════════════════════════════ */

/* ─── Base ───────────────────────────────────────────────────────── */
:root {
  --c-brand:      #6c63ff;
  --c-brand-soft: rgba(108, 99, 255, 0.15);
  --c-accent:     #00e5ff;
  --c-bg:         #0b0b18;
  --c-surface:    #12121f;
  --c-surface-2:  #1a1a2e;
  --c-border:     rgba(255,255,255,0.07);
  --c-border-2:   rgba(255,255,255,0.12);
  --c-text:       #e8e8f0;
  --c-text-muted: #8888aa;
  --c-danger:     #ef4444;
  --r-lg:         16px;
  --r-xl:         22px;
}

.login-body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Fundo animado ──────────────────────────────────────────────── */
.login-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 10s ease-in-out infinite;
}
.bg-orb--1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(108,99,255,.35) 0%, transparent 70%);
  top: -10%; left: -10%;
  animation-delay: 0s;
}
.bg-orb--2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(0,229,255,.2) 0%, transparent 70%);
  bottom: -5%; right: -5%;
  animation-delay: -4s;
}
.bg-orb--3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  top: 50%; left: 55%;
  animation-delay: -7s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(.97); }
}

/* Grid de fundo */
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* ─── Wrapper e Card ─────────────────────────────────────────────── */
.login-wrap {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}

.login-card {
  background: rgba(18, 18, 31, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  box-shadow:
    0 0 0 1px rgba(108,99,255,.08),
    0 24px 64px rgba(0,0,0,.6),
    0 4px 16px rgba(108,99,255,.06);
  animation: cardIn .5s cubic-bezier(.4,0,.2,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}
.login-card.shake { animation: shake .5s ease; }

/* ─── Logo ───────────────────────────────────────────────────────── */
.login-logo {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.logo-icon svg { width: 52px; height: 52px; }
.logo-name {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--c-accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tag {
  font-size: .72rem; font-weight: 500;
  color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-top: 2px;
}

/* ─── Header do card ─────────────────────────────────────────────── */
.login-header { margin-bottom: 1.75rem; }
.login-title { font-size: 1.2rem; font-weight: 700; }
.login-subtitle { font-size: .83rem; color: var(--c-text-muted); margin-top: .3rem; line-height: 1.5; }

/* ─── Alerta de erro ─────────────────────────────────────────────── */
.login-alert {
  display: flex; align-items: center; gap: .65rem;
  padding: .75rem 1rem;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px;
  color: #f87171;
  font-size: .83rem;
  margin-bottom: 1.25rem;
  animation: flashIn .3s ease;
}
.login-alert svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Formulário ─────────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-group { display: flex; flex-direction: column; gap: .45rem; }

.form-label {
  font-size: .78rem; font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.form-label-row {
  display: flex; align-items: center; justify-content: space-between;
}
.form-link {
  font-size: .75rem;
  color: var(--c-brand);
  font-weight: 500;
  transition: color .18s;
}
.form-link:hover { color: var(--c-accent); }

/* Input wrapper */
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: .9rem;
  display: flex; align-items: center;
  color: var(--c-text-muted);
  pointer-events: none;
}
.input-icon svg { width: 17px; height: 17px; }

.form-input {
  width: 100%;
  padding: .75rem .9rem .75rem 2.6rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-border-2);
  border-radius: 10px;
  color: var(--c-text);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-text-fill-color: var(--c-text);
}
.form-input::placeholder { color: var(--c-text-muted); opacity: .6; }
.form-input:focus {
  border-color: var(--c-brand);
  background: rgba(108,99,255,.06);
  box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}

/* Toggle senha */
.input-toggle-pass {
  position: absolute; right: .75rem;
  background: none; border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  display: flex; align-items: center;
  padding: .25rem;
  border-radius: 4px;
  transition: color .18s;
}
.input-toggle-pass:hover { color: var(--c-text); }
.input-toggle-pass svg { width: 18px; height: 18px; }

/* Checkbox */
.form-group--check { flex-direction: row; align-items: center; }
.checkbox-label {
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; user-select: none;
  font-size: .83rem; color: var(--c-text-muted);
}
.checkbox-input { display: none; }
.checkbox-custom {
  width: 17px; height: 17px;
  border: 2px solid var(--c-border-2);
  border-radius: 5px;
  background: transparent;
  flex-shrink: 0;
  transition: background .18s, border-color .18s;
  position: relative;
}
.checkbox-input:checked + .checkbox-custom {
  background: var(--c-brand);
  border-color: var(--c-brand);
}
.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%) rotate(45deg);
  width: 4px; height: 7px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
}

/* ─── Botão de Login ─────────────────────────────────────────────── */
.btn-login {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  width: 100%;
  padding: .85rem 1.5rem;
  margin-top: .25rem;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--c-brand) 0%, #4f46e5 100%);
  color: #fff;
  font-size: .9rem; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  box-shadow: 0 4px 20px rgba(108,99,255,.35);
}
.btn-login::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 100%);
  opacity: 0; transition: opacity .2s;
}
.btn-login:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(108,99,255,.5); }
.btn-login:hover::before { opacity: 1; }
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: .65; cursor: wait; }

.btn-login__icon svg { width: 18px; height: 18px; }

/* Spinner do botão */
.btn-login__spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Rodapé do card ─────────────────────────────────────────────── */
.login-footer-text {
  text-align: center;
  font-size: .72rem;
  color: var(--c-text-muted);
  margin-top: 1.75rem;
  opacity: .6;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-wrap { padding: 1rem; }
  .login-card { padding: 2rem 1.25rem; }
  .login-logo { flex-direction: column; text-align: center; gap: .75rem; }
}
