/* Modern Login Page Styles */
/* TAFSOL Timesheet - Professional Login UI */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --bg-dark: #0a1628;
    --bg-dark-lighter: #0f2137;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-cyan: #06b6d4;
    --text-white: #ffffff;
    --text-light: #cbd5e1;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-focus: #3b82f6;
    --error-color: #ef4444;
    --success-color: #22c55e;
}

/* ========================================
   Page Layout
   ======================================== */
.login-page-modern {
    min-height: 100vh;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   Animated Background
   ======================================== */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-lighter) 50%, var(--bg-dark) 100%);
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: glowPulse 8s ease-in-out infinite;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    bottom: -150px;
    left: -100px;
    animation-delay: 2s;
}

.bg-glow-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 4s;
    opacity: 0.2;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* ========================================
   Floating Particles
   ======================================== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.particle:nth-child(1) { left: 5%; top: 10%; animation-duration: 18s; animation-delay: 0s; width: 8px; height: 8px; }
.particle:nth-child(2) { left: 15%; top: 80%; animation-duration: 22s; animation-delay: 1s; }
.particle:nth-child(3) { left: 25%; top: 30%; animation-duration: 16s; animation-delay: 2s; width: 10px; height: 10px; }
.particle:nth-child(4) { left: 35%; top: 60%; animation-duration: 20s; animation-delay: 0.5s; }
.particle:nth-child(5) { left: 45%; top: 15%; animation-duration: 19s; animation-delay: 3s; width: 7px; height: 7px; }
.particle:nth-child(6) { left: 55%; top: 85%; animation-duration: 17s; animation-delay: 1.5s; }
.particle:nth-child(7) { left: 65%; top: 40%; animation-duration: 21s; animation-delay: 2.5s; width: 9px; height: 9px; }
.particle:nth-child(8) { left: 75%; top: 70%; animation-duration: 23s; animation-delay: 0.8s; }
.particle:nth-child(9) { left: 85%; top: 20%; animation-duration: 18s; animation-delay: 1.8s; width: 8px; height: 8px; }
.particle:nth-child(10) { left: 92%; top: 55%; animation-duration: 20s; animation-delay: 2.2s; }
.particle:nth-child(11) { left: 8%; top: 45%; animation-duration: 16s; animation-delay: 3.5s; width: 5px; height: 5px; }
.particle:nth-child(12) { left: 30%; top: 90%; animation-duration: 24s; animation-delay: 0.3s; }
.particle:nth-child(13) { left: 50%; top: 5%; animation-duration: 19s; animation-delay: 1.2s; width: 11px; height: 11px; }
.particle:nth-child(14) { left: 70%; top: 95%; animation-duration: 17s; animation-delay: 2.8s; }
.particle:nth-child(15) { left: 88%; top: 35%; animation-duration: 21s; animation-delay: 0.7s; width: 6px; height: 6px; }
.particle:nth-child(16) { left: 3%; top: 50%; animation-duration: 19s; animation-delay: 0.2s; width: 7px; height: 7px; }
.particle:nth-child(17) { left: 12%; top: 25%; animation-duration: 21s; animation-delay: 1.3s; }
.particle:nth-child(18) { left: 20%; top: 70%; animation-duration: 17s; animation-delay: 2.1s; width: 9px; height: 9px; }
.particle:nth-child(19) { left: 40%; top: 40%; animation-duration: 23s; animation-delay: 0.6s; }
.particle:nth-child(20) { left: 60%; top: 20%; animation-duration: 18s; animation-delay: 1.7s; width: 8px; height: 8px; }
.particle:nth-child(21) { left: 78%; top: 50%; animation-duration: 20s; animation-delay: 2.4s; }
.particle:nth-child(22) { left: 95%; top: 75%; animation-duration: 16s; animation-delay: 0.9s; width: 10px; height: 10px; }
.particle:nth-child(23) { left: 82%; top: 88%; animation-duration: 22s; animation-delay: 3.2s; }
.particle:nth-child(24) { left: 48%; top: 92%; animation-duration: 19s; animation-delay: 1.1s; width: 6px; height: 6px; }
.particle:nth-child(25) { left: 22%; top: 8%; animation-duration: 24s; animation-delay: 2.7s; }
.particle:nth-child(26) { left: 58%; top: 65%; animation-duration: 17s; animation-delay: 0.4s; width: 8px; height: 8px; }
.particle:nth-child(27) { left: 72%; top: 12%; animation-duration: 21s; animation-delay: 1.9s; }
.particle:nth-child(28) { left: 38%; top: 78%; animation-duration: 18s; animation-delay: 2.9s; width: 7px; height: 7px; }
.particle:nth-child(29) { left: 7%; top: 65%; animation-duration: 20s; animation-delay: 0.1s; }
.particle:nth-child(30) { left: 90%; top: 42%; animation-duration: 23s; animation-delay: 3.8s; width: 9px; height: 9px; }

/* Different colors for some particles */
.particle:nth-child(3),
.particle:nth-child(7),
.particle:nth-child(13),
.particle:nth-child(18),
.particle:nth-child(22),
.particle:nth-child(27) {
    background: rgba(6, 182, 212, 0.6);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.particle:nth-child(5),
.particle:nth-child(11),
.particle:nth-child(16),
.particle:nth-child(24),
.particle:nth-child(29) {
    background: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* ========================================
   Mouse-Following Particles
   ======================================== */
.mouse-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.mouse-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mouse-particle.active {
    opacity: 1;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-30px) translateX(15px) scale(1.2);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) translateX(-10px) scale(0.9);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-40px) translateX(20px) scale(1.1);
        opacity: 0.9;
    }
}

/* ========================================
   Floating Rings
   ======================================== */
.floating-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.ring {
    position: absolute;
    border: 2px solid rgba(59, 130, 246, 0.15);
    border-radius: 50%;
    animation: ringFloat 20s infinite ease-in-out;
}

.ring-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 5%;
    animation-delay: 0s;
}

.ring-2 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    left: 8%;
    border-color: rgba(6, 182, 212, 0.12);
    animation-delay: 3s;
    animation-duration: 25s;
}

.ring-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    right: 15%;
    border-color: rgba(139, 92, 246, 0.1);
    animation-delay: 6s;
    animation-duration: 18s;
}

@keyframes ringFloat {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: rotate(90deg) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(0.95);
        opacity: 0.6;
    }
    75% {
        transform: rotate(270deg) scale(1.05);
        opacity: 0.7;
    }
}

/* ========================================
   Main Wrapper
   ======================================== */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Brand Section (Logo Outside Card)
   ======================================== */
.brand-section {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(59, 130, 246, 0.3));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo:hover {
    transform: scale(1.05);
}

.brand-tagline {
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 400;
    margin-top: 16px;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* ========================================
   Login Card
   ======================================== */
.login-card-modern {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Header */
.card-header {
    text-align: center;
    margin-bottom: 36px;
}

.card-title {
    color: #1e293b;
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

/* ========================================
   Form Styles
   ======================================== */
.login-form-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: #374151;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    color: var(--accent-blue);
    font-size: 1.15rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--accent-blue-hover);
    text-decoration: none;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 20px;
    transition: color 0.3s ease;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 18px 18px 18px 54px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    color: #1e293b;
    font-size: 1.15rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    font-size: 1.1rem;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    background: #ffffff;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.input-wrapper.focused .input-icon {
    color: var(--accent-blue);
}

/* Password Toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--accent-blue);
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: errorShake 0.4s ease;
}

/* Success Messages */
.success-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
    font-size: 1rem;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease;
}

.success-message i {
    font-size: 1.2rem;
}

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

.form-input.has-error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* ========================================
   Submit Button
   ======================================== */
.btn-submit {
    width: 100%;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    margin-top: 16px;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-submit:hover::before {
    left: 100%;
}

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

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-submit:hover .btn-arrow {
    transform: translateX(4px);
}

/* Button Loading State */
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
}

.btn-submit.loading .btn-text,
.btn-submit.loading .btn-arrow {
    display: none;
}

.btn-submit.loading .btn-loader {
    display: block;
}

.btn-submit.loading {
    pointer-events: none;
}

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

/* ========================================
   Help Section
   ======================================== */
.help-section {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--input-border);
}

.help-text {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.help-link {
    color: var(--accent-blue);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
    transition: color 0.2s ease;
}

.help-link:hover {
    color: var(--accent-blue-hover);
    text-decoration: none;
}

/* ========================================
   Page Footer
   ======================================== */
.page-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.page-footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin: 0;
}

.page-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.page-footer a:hover {
    color: #ffffff;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 576px) {
    .login-page-modern {
        padding: 20px 16px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .brand-logo {
        max-width: 160px;
    }

    .brand-tagline {
        font-size: 0.85rem;
    }

    .login-card-modern {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .form-input {
        padding: 12px 12px 12px 42px;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .bg-glow-1,
    .bg-glow-2 {
        width: 250px;
        height: 250px;
    }

    .bg-glow-3 {
        display: none;
    }
}

@media (max-width: 380px) {
    .login-card-modern {
        padding: 28px 20px;
    }

    .brand-logo {
        max-width: 140px;
    }
}

/* ========================================
   Focus Accessibility
   ======================================== */
.form-input:focus-visible,
.btn-submit:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ========================================
   Animations Fine-tuning
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

