* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme (Default) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #dc2626;
    --accent-secondary: #b91c1c;
    --accent-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --border-color: rgba(51, 65, 85, 0.5);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --input-bg: rgba(51, 65, 85, 0.5);
    --card-bg: rgba(30, 41, 59, 0.8);
}

/* Light Theme */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-primary: #dc2626;
    --accent-secondary: #b91c1c;
    --accent-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    --input-bg: #f1f5f9;
    --card-bg: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Top Controls */
.top-controls {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 1000;
}

.theme-toggle,
.lang-toggle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover,
.lang-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    border-color: var(--accent-primary);
}

.lang-text {
    font-size: 0.875rem;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0.1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-gradient);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    top: 50%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }
    75% {
        transform: translate(30px, 50px) scale(1.05);
    }
}

/* Auth Container */
.auth-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Brand Section */
.brand-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, 
        rgba(220, 38, 38, 0.1) 0%, 
        rgba(185, 28, 28, 0.05) 100%);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.brand-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(220, 38, 38, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.brand-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    text-align: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.2);
    border-color: var(--accent-primary);
}

.feature-icon {
    font-size: 2rem;
}

.feature-text {
    font-weight: 600;
    color: var(--text-primary);
}

/* Form Section */
.form-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

/* Mobile Logo (hidden by default) */
.mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-brand-logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(220, 38, 38, 0.4));
}

.form-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* Tab Switcher */
.tab-switcher {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--input-bg);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.25rem;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Password Strength */
.password-strength {
    margin-top: 0.75rem;
}

.strength-bar {
    height: 4px;
    background: var(--input-bg);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label.terms {
    margin-bottom: 1.5rem;
}

.forgot-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--accent-secondary);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--card-bg);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.social-btn span:first-child {
    font-size: 1.25rem;
}

/* Back to Home */
.back-home {
    margin-top: 2rem;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent-primary);
    gap: 0.75rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(220, 38, 38, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    min-width: 300px;
    text-align: center;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: #10b981;
    color: #10b981;
}

.toast.error {
    border-color: #ef4444;
    color: #ef4444;
}

.toast.info {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .brand-section {
        display: none;
    }

    .mobile-logo {
        display: block;
    }

    .form-section {
        padding: 2rem 1.5rem;
    }

    .top-controls {
        top: 1rem;
        right: 1rem;
    }

    .brand-logo {
        max-width: 300px;
    }
}

@media (max-width: 640px) {
    .form-container {
        max-width: 100%;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .top-controls {
        gap: 0.5rem;
    }

    .theme-toggle,
    .lang-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .brand-logo {
        max-width: 250px;
    }

    .mobile-brand-logo {
        max-width: 220px;
    }
}

/* Print Styles */
@media print {
    .top-controls,
    .bg-animation,
    .social-login,
    .back-home {
        display: none;
    }
}