/* Modern Login Page Styles */
/* Author: Custom Styling for TAFSOL Technology Quiz Platform */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #a78bfa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100%;
}

.modern-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    font-family: 'Inter', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated Mesh Background */
.modern-login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(131, 58, 180, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(253, 29, 29, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 60% 60%, rgba(252, 176, 69, 0.15) 0%, transparent 40%);
    pointer-events: none;
    animation: meshMove 20s ease-in-out infinite alternate;
}

@keyframes meshMove {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* Floating Orbs */
.login-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.login-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

.login-shapes .shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    background: linear-gradient(135deg, rgba(131, 58, 180, 0.4) 0%, rgba(253, 29, 29, 0.2) 100%);
    animation: orbFloat1 8s ease-in-out infinite;
}

.login-shapes .shape:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: 5%;
    background: linear-gradient(135deg, rgba(252, 176, 69, 0.3) 0%, rgba(131, 58, 180, 0.2) 100%);
    animation: orbFloat2 10s ease-in-out infinite;
}

.login-shapes .shape:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 20%;
    right: 10%;
    background: linear-gradient(135deg, rgba(29, 253, 172, 0.25) 0%, rgba(69, 176, 252, 0.2) 100%);
    animation: orbFloat3 12s ease-in-out infinite;
}

.login-shapes .shape:nth-child(4) {
    width: 250px;
    height: 250px;
    bottom: -50px;
    right: -50px;
    background: linear-gradient(135deg, rgba(252, 69, 142, 0.3) 0%, rgba(131, 58, 180, 0.2) 100%);
    animation: orbFloat4 9s ease-in-out infinite;
}

.login-shapes .shape:nth-child(5) {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 30%;
    background: linear-gradient(135deg, rgba(69, 252, 220, 0.3) 0%, rgba(131, 180, 58, 0.2) 100%);
    animation: orbFloat5 7s ease-in-out infinite;
}

/* Particle effect overlay */
.login-shapes::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.3), transparent);
    background-size: 200px 200px;
    animation: sparkle 4s linear infinite;
}

@keyframes sparkle {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, 50px) scale(1.05); }
    50% { transform: translate(60px, 20px) scale(1); }
    75% { transform: translate(20px, 60px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(40px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 40px) rotate(240deg); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-40px, 30px) scale(1.1); opacity: 0.8; }
}

@keyframes orbFloat4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-20px, -30px); }
    50% { transform: translate(-40px, 10px); }
    75% { transform: translate(-10px, -20px); }
}

@keyframes orbFloat5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.2); }
}

/* Header/Navbar Styles */
.modern-login-header {
    padding: 1rem 0;
    position: relative;
    z-index: 10;
}

.modern-login-header .navbar {
    background: transparent !important;
    padding: 0.5rem 1rem;
}

.modern-login-header .logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modern-login-header .logo-wrapper img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Main Login Container */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

/* Login Card */
.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* Card Header */
.login-card-header {
    padding: 2.5rem 2.5rem 1.5rem;
    text-align: center;
}

.login-card-header .login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.4);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(118, 75, 162, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(118, 75, 162, 0.5); }
}

.login-card-header .login-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-card-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.login-card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Card Body */
.login-card-body {
    padding: 1rem 2.5rem 2.5rem;
}

/* Form Styles */
.modern-form-group {
    margin-bottom: 1.5rem;
}

.modern-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modern-input-wrapper {
    position: relative;
}

.modern-input-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: color 0.3s ease;
}

.modern-input-wrapper .input-icon svg {
    width: 20px;
    height: 20px;
}

.modern-form-control {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    outline: none;
}

.modern-form-control:focus {
    background: var(--bg-primary);
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.15);
}

.modern-form-control:focus + .input-icon,
.modern-form-control:not(:placeholder-shown) + .input-icon {
    color: #764ba2;
}

.modern-form-control::placeholder {
    color: var(--text-light);
}

.modern-form-control.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #764ba2;
}

/* Remember Me Checkbox */
.modern-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modern-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.modern-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #764ba2;
    cursor: pointer;
}

.modern-checkbox span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forgot-password-link {
    font-size: 0.9rem;
    color: #764ba2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #5a3d7a;
    text-decoration: underline;
}

/* Submit Button */
.modern-btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: buttonGradient 3s ease infinite;
}

@keyframes buttonGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.modern-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(118, 75, 162, 0.4);
}

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

.modern-btn-primary:active {
    transform: translateY(-1px);
}

/* Error Messages */
.invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.5rem;
}

/* Footer */
.login-card-footer {
    padding: 1.5rem 2.5rem;
    background: var(--bg-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.login-card-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-card-footer a {
    color: #764ba2;
    font-weight: 600;
    text-decoration: none;
}

.login-card-footer a:hover {
    text-decoration: underline;
    color: #5a3d7a;
}

/* Page Footer */
.modern-login-footer {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.modern-login-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Responsive Styles */
@media (max-width: 576px) {
    .login-card {
        margin: 1rem;
        border-radius: var(--radius-lg);
    }

    .login-card-header {
        padding: 2rem 1.5rem 1rem;
    }

    .login-card-header h1 {
        font-size: 1.5rem;
    }

    .login-card-body {
        padding: 1rem 1.5rem 2rem;
    }

    .login-card-footer {
        padding: 1.25rem 1.5rem;
    }

    .modern-login-header .logo-wrapper img {
        height: 40px;
    }

    .login-shapes .shape {
        display: none;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .login-card {
        max-width: 400px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .login-card {
        max-width: 420px;
    }
}

/* Loading State */
.modern-btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.modern-btn-primary.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
}

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

/* Focus visible for accessibility */
.modern-form-control:focus-visible,
.modern-btn-primary:focus-visible,
.modern-checkbox input:focus-visible {
    outline: 2px solid #764ba2;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .modern-login-page.dark-mode-enabled {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --border-color: #374151;
    }
}

