/* Custom CSS Variables & Design System */
:root {
    --bg-dark: #090a0f;
    --card-bg: rgba(17, 19, 31, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --primary-color: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --error-color: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.25);
    --success-color: #10b981;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Glow Effects */
.bg-glow {
    position: absolute;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    mix-blend-mode: screen;
}

.bg-glow-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(0,0,0,0) 70%);
    top: -10%;
    left: -10%;
    animation: float-slow 20s infinite alternate ease-in-out;
}

.bg-glow-2 {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(0,0,0,0) 70%);
    bottom: -10%;
    right: -10%;
    animation: float-slow 25s infinite alternate-reverse ease-in-out;
}

@keyframes float-slow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 80px) scale(1.1);
    }
    100% {
        transform: translate(-30px, -50px) scale(0.9);
    }
}

/* Main Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

/* Glassmorphism Login Card */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.login-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Header Styling */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.1);
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(99, 102, 241, 0.1), 0 0 0 0px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2), 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--text-primary), #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

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

/* Error Banner styling */
.error-banner {
    display: none;
    align-items: center;
    gap: 10px;
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-out;
}

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

.error-icon {
    flex-shrink: 0;
}

/* Input group layouts */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

/* Actual input field styling */
.input-wrapper input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.input-wrapper input:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.05);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Active focus color for label & icons */
.input-group:focus-within label {
    color: var(--primary-color);
}

.input-group:focus-within .input-icon {
    color: var(--primary-color);
}

/* Password eye button styling */
.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
}

/* Label row for password */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.forgot-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Custom Checkbox Design */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 0.875rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.05);
}

.checkbox-container input:checked ~ .checkmark {
    background-image: var(--primary-gradient);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.checkbox-container:hover .checkbox-label {
    color: var(--text-primary);
}

/* Submit Button */
.submit-btn {
    position: relative;
    background-image: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: all var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

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

.submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-glow), 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Spinner for Loading State */
.btn-text {
    transition: opacity var(--transition-fast);
}

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

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

/* Button Loading State Styles */
.submit-btn.loading {
    pointer-events: none;
    cursor: not-allowed;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

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

/* Shaking Error Animation for Card */
.shake {
    animation: shake-animation 0.5s ease-in-out;
}

@keyframes shake-animation {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Footer Styling */
.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.signup-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.signup-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Toast Notification Styles */
.notification-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.toast {
    background-color: #1f2937;
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-info {
    border-left-color: var(--primary-color);
}
