/* ============================================================
   ESTILOS DE AUTENTICACIÓN — Página de Login
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Fondo animado */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

/* Wrapper de la tarjeta de login */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Logo / marca arriba */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-brand-icon {
    width: 56px; height: 56px;
    background: #f59e0b;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}
.auth-brand-icon svg { width: 28px; height: 28px; }
.auth-brand-name {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
}
.auth-brand-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* Tarjeta principal */
.auth-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255,255,255,0.02);
}

.auth-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.3rem;
}
.auth-card p {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.75rem;
}

/* Formulario */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    width: 18px; height: 18px;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.85rem 0.7rem 2.5rem;
    background: #0f172a;
    border: 1.5px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.form-control::placeholder { color: #475569; }

/* Toggle password visibility */
.input-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #475569;
    padding: 0;
    transition: color 0.2s;
}
.input-toggle:hover { color: #94a3b8; }

/* Botón principal */
.btn-auth {
    width: 100%;
    padding: 0.8rem;
    background: #f59e0b;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.btn-auth:hover:not(:disabled) { background: #d97706; }
.btn-auth:active:not(:disabled) { transform: scale(0.99); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }

/* Estado de carga */
.btn-auth .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn-auth.loading .btn-label { display: none; }
.btn-auth.loading .spinner  { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alertas dentro del formulario */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-alert-error   { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.auth-alert-warning { background: #431407; color: #fde68a; border: 1px solid #78350f; }
.auth-alert-success { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.auth-alert-icon    { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* Footer del formulario */
.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.78rem;
    color: #475569;
}

/* Info de seguridad */
.auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    font-size: 0.72rem;
    color: #475569;
}
.auth-security svg { width: 12px; height: 12px; }

/* Responsive */
@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; border-radius: 12px; }
}
