/* ═══════════════════════════════════════════════════════
   LOGIN — Página de acceso independiente (index.html)
   Financial Control · The Protein Group
   ═══════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 45%, #312e81 100%);
  min-height: 100vh;
}

.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.98);
  border-radius: 24px;
  box-shadow:
    0 32px 80px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.1),
    inset 0 1px 0 rgba(255,255,255,.8);
  padding: 44px 44px 36px;
  width: 100%; max-width: 440px;
  animation: login-card-in .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes login-card-in {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Marca superior */
.login-brand {
  display: flex; align-items: center; gap: 14px; margin-bottom: 32px;
}
.login-logo {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(124,58,237,.4);
}
.login-brand-text { display: flex; flex-direction: column; }
.login-brand-title { font-size: 17px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.login-brand-sub { font-size: 12px; color: #64748b; margin-top: 1px; }

/* Título y descripción */
.login-title {
  font-size: 26px; font-weight: 800; color: #0f172a;
  margin: 0 0 6px; letter-spacing: -.02em;
}
.login-desc {
  font-size: 14px; color: #64748b; margin: 0 0 28px; line-height: 1.5;
}

/* Campos */
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.login-field label {
  font-size: 12px; font-weight: 700; color: #374151;
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 6px;
}
.login-field label i { color: #7c3aed; font-size: 11px; }
.login-field input {
  width: 100%; padding: 12px 15px; border: 1.5px solid #e2e8f0;
  border-radius: 11px; font-size: 14.5px; color: #0f172a;
  background: #f8fafc; transition: all .2s; font-family: inherit;
}
.login-field input:focus {
  outline: none; border-color: #7c3aed; background: #fff;
  box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}
.login-field input::placeholder { color: #94a3b8; }

/* Wrap contraseña + botón ojo */
.login-pw-wrap { position: relative; }
.login-pw-wrap input { padding-right: 46px; }
.login-pw-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 15px; padding: 4px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.login-pw-eye:hover { color: #7c3aed; }

/* Mensajes error / éxito */
.login-err {
  display: flex; align-items: center; gap: 8px;
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
}
.login-err::before {
  content: '\f06a'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 13px; flex-shrink: 0;
}
.login-ok {
  display: flex; align-items: center; gap: 8px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
}
.login-ok::before {
  content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 13px; flex-shrink: 0;
}

/* Botón principal */
.login-btn {
  width: 100%; padding: 14px 20px; margin-top: 4px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 4px 16px rgba(124,58,237,.4);
  transition: all .2s; font-family: inherit;
}
.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,.5);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }

/* Link secundario (olvidé mi contraseña / volver) */
.login-link-btn {
  width: 100%; background: none; border: none; cursor: pointer;
  color: #7c3aed; font-size: 13px; font-weight: 600;
  margin-top: 16px; padding: 4px; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.login-link-btn:hover { text-decoration: underline; }

/* Footer legal */
.login-footer {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; color: #94a3b8; margin-top: 24px;
  padding-top: 18px; border-top: 1px solid #f1f5f9;
}
.login-footer i { color: #10b981; }

/* Shake animation (error) */
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(8px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(3px); }
}
.login-shake { animation: login-shake .45s ease; }

/* Verificando sesión */
.login-checking {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px 0; color: #64748b; font-size: 14px;
}
.login-checking i { font-size: 28px; color: #7c3aed; }

@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; }
  .login-title { font-size: 22px; }
}
