:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gray-dark: #334155;
    
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -250px;
    left: -250px;
    border-radius: 50%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -200px;
    right: -200px;
    border-radius: 50%;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 50%;
    left: 20%;
    border-radius: 50%;
    animation-delay: -10s;
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    bottom: 30%;
    right: 10%;
    border-radius: 50%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-50px) rotate(120deg);
    }
    66% {
        transform: translateY(50px) rotate(240deg);
    }
}

/* Main Container */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 90%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    margin: 2rem;
}

/* Brand Side */
.brand-side {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    padding: 3rem;
    display: flex;
    align-items: center;
    color: white;
}

.brand-content {
    max-width: 400px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.brand-logo i {
    font-size: 2rem;
}

.brand-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.brand-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.feature-item i {
    color: #10b981;
    font-size: 1.1rem;
}

.testimonial {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatars {
    display: flex;
    align-items: center;
}

.testimonial-avatars img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -10px;
}

.testimonial-avatars img:first-child {
    margin-left: 0;
}

.testimonial p {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Auth Side */
.auth-side {
    background: white;
    padding: 3rem;
    display: flex;
    align-items: center;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Tab Toggle */
.tab-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--gray-light);
    padding: 0.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.tab-toggle button {
    padding: 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray);
}

.tab-toggle button i {
    font-size: 1rem;
}

.tab-toggle button.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    background: white;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--dark);
}

.social-btn:hover {
    background: var(--gray-light);
    transform: translateY(-2px);
}

.social-btn.google i {
    color: #ea4335;
}

.social-btn.github i {
    color: #333;
}

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

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 100px);
    height: 1px;
    background: var(--gray-light);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Forms */
.form {
    display: none;
    animation: slideIn 0.3s ease;
}

.form.active {
    display: block;
}

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

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group label i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group input.error {
    border-color: var(--danger);
}

.input-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: var(--danger);
}

/* Password Box */
.password-box {
    position: relative;
}

.password-box input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

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

/* Password Strength */
.password-strength {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--gray-light);
    border-radius: 2px;
    transition: var(--transition);
}

.strength-bar.active:nth-child(1) { background: var(--danger); }
.strength-bar.active:nth-child(2) { background: var(--warning); }
.strength-bar.active:nth-child(3) { background: var(--primary); }
.strength-bar.active:nth-child(4) { background: var(--secondary); }

.strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: var(--gray);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray);
    position: relative;
}

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

.checkmark {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    transition: var(--transition);
}

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

.checkbox-container input:checked ~ .checkmark::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.auth-btn.loading .spinner {
    display: inline-block;
}

.auth-btn.loading i,
.auth-btn.loading span {
    opacity: 0;
}

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

/* Terms */
.terms {
    margin-bottom: 1.5rem;
}

.terms a {
    color: var(--primary);
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: var(--transition);
    z-index: 1000;
    border-left: 4px solid var(--secondary);
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    color: var(--secondary);
    font-size: 1.25rem;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

/* Responsive Design */
@media (max-width: 968px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .brand-side {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-side {
        padding: 2rem 1.5rem;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .tab-toggle button span {
        display: none;
    }
    
    .tab-toggle button i {
        font-size: 1.2rem;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        transform: translateY(400px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Social Login Enhancements */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    background: white;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--dark);
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.social-btn:hover::before {
    width: 300px;
    height: 300px;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-btn.google {
    color: #ea4335;
    border-color: #ea4335;
}

.social-btn.google:hover {
    background: #ea4335;
    color: white;
}

.social-btn.github {
    color: #333;
    border-color: #333;
}

.social-btn.github:hover {
    background: #333;
    color: white;
}

.social-btn i {
    font-size: 1.1rem;
    transition: var(--transition);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: var(--transition);
    z-index: 1000;
    border-left: 4px solid var(--secondary);
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    color: var(--secondary);
    font-size: 1.25rem;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

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

.toast.info i {
    color: var(--info);
}

/* Responsive for social buttons */
@media (max-width: 480px) {
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .social-btn {
        padding: 0.6rem;
    }
}