/* ============================================================
   LOGIN.CSS — Login Page Styling
   Aplikasi Absensi SMKN 1 Arahan
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    padding: var(--space-lg);
}

/* === ANIMATED GRADIENT BACKGROUND === */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-bg__gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 20% 80%, hsla(217, 91%, 60%, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, hsla(265, 83%, 65%, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, hsla(152, 68%, 52%, 0.05) 0%, transparent 60%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Floating Particles */
.login-bg__particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: hsla(217, 91%, 60%, 0.3);
    animation: floatParticle 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 1s; animation-duration: 5s; width: 3px; height: 3px; }
.particle:nth-child(3) { left: 40%; top: 30%; animation-delay: 2s; animation-duration: 8s; background: hsla(265, 83%, 65%, 0.3); }
.particle:nth-child(4) { left: 60%; top: 70%; animation-delay: 0.5s; animation-duration: 6s; width: 5px; height: 5px; }
.particle:nth-child(5) { left: 75%; top: 40%; animation-delay: 1.5s; animation-duration: 9s; background: hsla(152, 68%, 52%, 0.3); }
.particle:nth-child(6) { left: 85%; top: 15%; animation-delay: 3s; animation-duration: 7s; width: 3px; height: 3px; }
.particle:nth-child(7) { left: 30%; top: 80%; animation-delay: 2.5s; animation-duration: 6s; background: hsla(265, 83%, 65%, 0.2); }
.particle:nth-child(8) { left: 55%; top: 10%; animation-delay: 4s; animation-duration: 8s; }
.particle:nth-child(9) { left: 90%; top: 55%; animation-delay: 1s; animation-duration: 7s; background: hsla(152, 68%, 52%, 0.25); width: 4px; height: 4px; }
.particle:nth-child(10) { left: 15%; top: 45%; animation-delay: 3.5s; animation-duration: 5s; }

/* Grid lines decorative */
.login-bg__grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(hsla(0, 0%, 100%, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, hsla(0, 0%, 100%, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* === LOGIN CARD === */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    animation: fadeInUp 0.6s ease-out;
}

.login-card.shake {
    animation: shake 0.5s ease;
}

/* Logo & Header */
.login-card__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-card__logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    object-fit: contain;
    filter: drop-shadow(0 4px 12px hsla(0, 0%, 0%, 0.3));
}

.login-card__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.login-card__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.login-form .form-group {
    gap: var(--space-sm);
}

.login-form .form-input {
    padding: 0.9rem 1rem 0.9rem 2.8rem;
}

/* Submit Button */
.login-btn {
    margin-top: var(--space-sm);
    padding: 0.9rem;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    background: var(--gradient-hero);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow-blue);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid hsla(0, 0%, 100%, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.login-btn.loading .spinner {
    display: block;
}

.login-btn.loading .login-btn__text {
    display: none;
}

/* Error Message */
.login-error {
    display: none;
    padding: var(--space-md);
    background: var(--accent-red-soft);
    border: 1px solid hsla(0, 84%, 60%, 0.2);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-size: var(--font-size-sm);
    text-align: center;
    animation: fadeIn var(--transition-base);
}

.login-error.show {
    display: block;
}

/* Footer */
.login-card__footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--bg-glass-border);
}

.login-card__footer p {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* === MOBILE ADJUSTMENTS === */
@media (max-width: 479px) {
    .login-card {
        padding: var(--space-xl);
        border-radius: var(--radius-lg);
    }

    .login-card__logo {
        width: 64px;
        height: 64px;
    }

    .login-card__title {
        font-size: var(--font-size-lg);
    }
}
