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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-lighter: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Bar - Removed for login page */

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.6s ease-out;
    margin-top: 0;
}

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

.login-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 48px 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease;
}

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

.welcome-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 40px;
    font-weight: 500;
}

/* Error and Success Messages */
.error-message,
.success-message {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.error-message.show {
    display: block;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.success-message.show {
    display: block;
}

.login-form {
    position: relative;
}

.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-white);
    outline: none;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:hover {
    border-color: var(--primary-light);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-white);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-32px) scale(0.85);
    color: var(--primary-color);
    font-weight: 600;
    background: var(--bg-white);
    padding: 0 8px;
}

.input-group label {
    position: absolute;
    left: 20px;
    top: 16px;
    color: var(--text-secondary);
    font-size: 15px;
    pointer-events: none;
    background: var(--bg-white);
    padding: 0 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s;
    z-index: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

.input-group input:focus ~ .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.toggle-password {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.eye-icon,
.eye-off-icon {
    transition: opacity 0.3s;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    user-select: none;
}

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

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

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.forgot-password:hover::after {
    width: 100%;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.login-button {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bg-white);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    z-index: 1;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.login-button:hover::before {
    width: 300px;
    height: 300px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

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

.login-button.loading {
    pointer-events: none;
    cursor: not-allowed;
}

.login-button.loading span {
    opacity: 0;
}

.button-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--bg-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.login-button.loading .button-loader {
    display: block;
}

.divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.social-login {
    margin-bottom: 28px;
}

.social-button {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.5s;
}

.social-button:hover::before {
    left: 100%;
}

.social-button:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.social-button:active {
    transform: translateY(0);
}

.social-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.social-button svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.social-button:hover svg {
    transform: scale(1.1);
}

.signup-link {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    position: relative;
}

.signup-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s;
}

.signup-link a:hover::after {
    width: 100%;
}

.signup-link a:hover {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin-top: 0;
    }
}

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

    .login-container {
        margin-top: 0;
    }

    .login-card {
        padding: 36px 28px;
        border-radius: 20px;
    }
    
    .welcome-text {
        font-size: 28px;
    }
    
    .logo {
        max-width: 140px;
    }

    .input-group input {
        padding: 14px 46px 14px 18px;
        font-size: 14px;
    }

    .input-group label {
        font-size: 14px;
    }

    .login-button {
        padding: 14px;
        font-size: 15px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Focus visible for accessibility */
.login-button:focus-visible,
.social-button:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading state animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.login-button.loading {
    animation: pulse 2s ease-in-out infinite;
}
