/* ==========================================================================
   HRM Enterprise Modern Login & Splash Screen Stylesheet
   ========================================================================== */

:root {
    --login-bg-dark: #070d19;
    --login-bg-card: rgba(255, 255, 255, 0.96);
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --primary-gradient: linear-gradient(135deg, #1f4fd8 0%, #06b6d4 100%);
    --accent-glow: rgba(37, 99, 235, 0.35);
    --text-heading: #0f172a;
    --text-body: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-card: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

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

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--login-bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* --------------------------------------------------------------------------
   1. Animated Splash Screen Preloader (With Fail-Safe CSS Timer)
   -------------------------------------------------------------------------- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #080f23;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* CSS Failsafe: Automatically fades out after 1.2s if JS is delayed */
    animation: forceDismissSplash 0.5s forwards ease-in-out;
    animation-delay: 1.2s;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash-screen.fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

@keyframes forceDismissSplash {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; display: none; }
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.splash-logo-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.splash-logo-wrap img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    z-index: 2;
}

.splash-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: var(--primary-gradient);
    opacity: 0.4;
    filter: blur(14px);
    animation: ringGlow 1.8s infinite alternate ease-in-out;
}

.splash-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.splash-subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 24px;
}

.splash-progress-bar {
    width: 160px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.splash-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 999px;
    animation: fillProgress 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes ringGlow {
    0% { transform: scale(0.88); opacity: 0.3; }
    100% { transform: scale(1.15); opacity: 0.6; }
}

@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* --------------------------------------------------------------------------
   2. Main Container & Ambient Backgrounds
   -------------------------------------------------------------------------- */
.login-page-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.ambient-blob-1 {
    width: 500px;
    height: 500px;
    top: -100px;
    left: -100px;
    background: #1d4ed8;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.ambient-blob-2 {
    width: 450px;
    height: 450px;
    bottom: -100px;
    right: -100px;
    background: #0ea5e9;
    animation: floatBlob 10s infinite alternate-reverse ease-in-out;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* --------------------------------------------------------------------------
   3. Split-Screen Layout Component
   -------------------------------------------------------------------------- */
.login-main-card {
    width: 100%;
    max-width: 1080px;
    min-height: 640px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-main-card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Left Brand Hero Section */
.hero-brand-panel {
    flex: 1.1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.85) 100%),
                url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=1200&q=80') center/cover;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-brand-name {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.hero-brand-subtitle {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-body-content {
    margin: 40px 0;
}

.hero-body-content h1 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-body-content p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
    max-width: 420px;
}

.hero-feature-pills {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 30px;
}

.feature-pill-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-pill-item:hover {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.12);
}

.feature-pill-item i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.hero-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.hero-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    animation: blink 1.6s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Right Form Section */
.form-login-panel {
    flex: 0.9;
    background: var(--login-bg-card);
    padding: 50px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.form-header-title h2 {
    color: var(--text-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.form-header-title p {
    color: var(--text-body);
    font-size: 14px;
}

/* Form Controls & Inputs */
.custom-input-group {
    position: relative;
    margin-bottom: 22px;
}

.custom-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i.input-lead-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 18px;
    transition: color 0.2s ease;
    pointer-events: none;
}

.custom-input-control {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 48px;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-heading);
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-input-control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.custom-input-control:focus + i.input-lead-icon {
    color: var(--primary-blue);
}

/* Toggle Password Icon */
.btn-toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
}

.btn-toggle-password:hover {
    color: var(--text-heading);
}

/* Alert Shake Animation */
.alert-animated {
    animation: alertShake 0.4s ease-in-out;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Submit Button & Loader */
.btn-submit-login {
    width: 100%;
    height: 52px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.btn-submit-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -4px rgba(37, 99, 235, 0.5);
}

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

.btn-submit-login.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer-credits {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.login-footer-credits strong {
    color: var(--text-body);
}

/* --------------------------------------------------------------------------
   4. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .login-main-card {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .hero-brand-panel {
        padding: 36px 28px;
    }

    .hero-body-content {
        margin: 20px 0;
    }

    .hero-body-content h1 {
        font-size: 24px;
    }

    .hero-feature-pills {
        display: none;
    }

    .form-login-panel {
        padding: 36px 28px;
    }
}