:root {
    /* Premium Modern Theme - Light Mode */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.08);
    --primary-lighter: rgba(59, 130, 246, 0.05);
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-input-focus: #f0f4f8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --error-bg: #fee2e2;
    --error-border: #fca5a5;
    --error-text: #991b1b;
}

/* Dark Theme */
body.light-theme {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.08);
    --primary-lighter: rgba(59, 130, 246, 0.05);
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-input-focus: #f0f4f8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --error-bg: #fee2e2;
    --error-border: #fca5a5;
    --error-text: #991b1b;
}

/* Dark Mode Activated */
body:not(.light-theme) {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-input-focus: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-border: rgba(239, 68, 68, 0.3);
    --error-text: #fca5a5;
}

/* Light Theme Variables */
body.light-theme {
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-input-focus: #f0f4f8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --error-bg: #fee2e2;
    --error-border: #fca5a5;
    --error-text: #991b1b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e0e7ff 50%, #f0f4f8 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    background: linear-gradient(135deg, #f0f4f8 0%, #e0e7ff 50%, #f0f4f8 100%);
}

body:not(.light-theme) {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 30;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-lighter);
    transform: rotate(12deg);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 1100px;
    gap: 0;
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08),
                0 10px 30px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-visual {
    flex: 0.9;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.login-visual::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-visual::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    top: 10%;
    right: -50px;
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.login-main {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: var(--bg-main);
    position: relative;
    overflow-y: auto;
    min-height: 500px;
}

.login-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.card-logo-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    display: none;
}

.visual-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    animation: logoSlide 0.8s ease-out backwards;
}

@keyframes logoSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visual-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: #ffffff;
    line-height: 1.3;
    animation: titleFade 0.8s ease-out 0.1s both;
}

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

.visual-content p {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    animation: subtitleFade 0.8s ease-out 0.2s both;
}

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

.visual-clock-hand {
    position: absolute;
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
    animation: rotateOrbit 30s linear infinite;
    pointer-events: none;
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.visual-content {
    max-width: 300px;
    text-align: center;
    z-index: 10;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

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

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.card-subtitle {
    display: none;
}

/* Rest of container padding */
.login-header,
.error-message {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.login-header {
    padding-top: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: headerFade 0.8s ease-out 0.3s both;
}

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

.login-header h2 {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Tabs */
.auth-tabs {
    display: flex;
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 2rem;
    border: none;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    animation: tabsFade 0.8s ease-out 0.35s both;
}

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

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.875rem;
    border-radius: 0;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.tab-btn.active {
    background: transparent;
    color: var(--primary);
    border-bottom-color: var(--primary);
    box-shadow: none;
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
}

/* Forms Container */
.forms-container {
    position: relative;
}

.auth-form {
    display: none;
    animation: fadeScale 0.4s ease-out;
}

.auth-form.active {
    display: block;
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

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

.form-group:not(.half) {
    margin-left: 2.5rem;
    margin-right: 2.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.input-group i:not(.toggle-password) {
    position: absolute;
    left: 1rem;
    color: var(--primary);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.input-group input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: 10px;
    padding: 0.9375rem 1.125rem 0.9375rem 3.25rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.input-group input::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

.input-group.focused i:not(.toggle-password) {
    color: var(--primary);
    transform: scale(1.1);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px var(--primary-lighter),
                0 4px 12px rgba(59, 130, 246, 0.15);
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
}

.toggle-password:hover {
    color: var(--primary);
    transform: scale(1.15);
}

/* Form Row (Two columns) */
.form-row {
    display: flex;
    gap: 1rem;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    margin-bottom: 0;
}

.form-group.half {
    flex: 1;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 1rem;
}

/* Form Options (Remember me / Forgot password) */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.remember-me:hover {
    color: var(--primary);
}

.remember-me input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 4px;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Buttons */
.btn {
    width: calc(100% - 5rem);
    padding: 1rem;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-decoration: none;
    font-size: 1rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    margin-bottom: 2rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3),
                0 2px 8px rgba(59, 130, 246, 0.2);
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4),
                0 4px 12px rgba(59, 130, 246, 0.25);
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #fff;
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Divider */
.divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: #09090b;
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

/* Error Message */
.error-message {
    background: var(--error-bg);
    border: 1.5px solid var(--error-border);
    color: var(--error-text);
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Loader */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 1024px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 100%;
        border-radius: 20px;
    }

    .login-visual {
        min-height: 300px;
        padding: 2rem;
    }

    .login-main {
        min-height: auto;
        padding: 2rem 1.5rem;
    }

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

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-group.half {
        width: 100%;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }

    .visual-content h1 {
        font-size: 1.875rem;
    }

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

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .login-wrapper {
        border-radius: 16px;
    }

    .login-visual,
    .login-main {
        padding: 1.5rem;
    }

    .visual-content h1 {
        font-size: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.25rem;
    }

    .auth-tabs {
        margin-bottom: 1.5rem;
    }

    .tab-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

/* Premium animations */
@keyframes glideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulseBorder {
    0%, 100% {
        border-color: var(--border-light);
    }
    50% {
        border-color: var(--border-color);
    }
}

/* Apply animations to form elements */
.login-container {
    animation: glideInUp 0.6s ease-out;
}

.login-header {
    animation: glideInUp 0.8s ease-out 0.1s both;
}

.form-group {
    animation: glideInUp 0.8s ease-out forwards;
}

.form-group:nth-child(1) { animation-delay: 0.3s; }
.form-group:nth-child(2) { animation-delay: 0.4s; }
.form-group:nth-child(3) { animation-delay: 0.5s; }

.btn-primary {
    animation: glideInUp 0.8s ease-out 0.6s both;
}

/* Smooth scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.4);
}

/* Light theme scrollbar */
body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.15);
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Input group enhancement */
.input-group i:not(.toggle-password) {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Link styling for better accessibility */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Selection styling */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-main);
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

