/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #374151;
    overflow-x: hidden;
}

/* Container and Background */
.container {
    min-height: 100vh;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 50%, #f3e8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
}

/* Animated Background Elements */
.background-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-element {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse 6s ease-in-out infinite;
}

.bg-element-1 {
    top: -160px;
    right: -160px;
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
}

.bg-element-2 {
    bottom: -160px;
    left: -160px;
    width: 320px;
    height: 320px;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    animation-delay: 2s;
}

.bg-element-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 384px;
    height: 384px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    animation-delay: 4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Login Wrapper */
.login-wrapper {
    width: 100%;
    max-width: 448px;
    position: relative;
    z-index: 10;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 32px;
    color: white;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #1f2937, #6b7280);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.header p {
    color: #6b7280;
    font-size: 16px;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.social-btn::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;
}

.social-btn:hover::before {
    left: 100%;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.social-btn:active {
    transform: translateY(0);
}

.github-btn {
    background: #1f2937;
    color: white;
}

.github-btn:hover {
    background: #111827;
}

.google-btn {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.google-btn:hover {
    background: #f9fafb;
}

.social-btn i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.social-btn:hover i {
    transform: scale(1.1);
}

/* Divider */
.divider {
    position: relative;
    margin-bottom: 24px;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.divider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 0 16px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 20px;
    transition: color 0.2s ease;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    font-size: 16px;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:hover {
    border-color: #d1d5db;
}

.input-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: #3b82f6;
}

.input-wrapper.error input {
    border-color: #ef4444;
}

.input-wrapper.error .input-icon {
    color: #ef4444;
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: #6b7280;
}

.error-message,.error_message_div {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.error-message.show,.error_message_div.show {
    opacity: 1;
    transform: translateY(0);
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 14px;
    color: #6b7280;
}

.forgot-password {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.forgot-password:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.submit-btn::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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    transition: transform 0.2s ease;
}

.submit-btn:hover i {
    transform: translateX(2px);
}

/* Sign Up Link */
.signup-link {
    margin-top: 32px;
    text-align: center;
}

.signup-link p {
    color: #6b7280;
    font-size: 16px;
}

.signup-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.signup-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 24px;
}

.footer p {
    color: #9ca3af;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-card {
        padding: 24px;
        margin: 8px;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .social-login {
        gap: 8px;
    }
    
    .social-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .bg-element-1,
    .bg-element-2 {
        width: 240px;
        height: 240px;
    }
    
    .bg-element-3 {
        width: 280px;
        height: 280px;
    }
}

/* Loading Animation */
.submit-btn.loading {
    pointer-events: none;
}

.submit-btn.loading span {
    opacity: 0;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-in {
    animation: slideInFromLeft 0.3s ease-out;
}