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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-medium: 0 15px 35px rgba(31, 38, 135, 0.2);
    --shadow-heavy: 0 25px 50px rgba(31, 38, 135, 0.25);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    left: 80%;
    animation-delay: 5s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 10s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 70%;
    animation-delay: 15s;
}

.shape-5 {
    width: 140px;
    height: 140px;
    top: 10%;
    left: 50%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

/* Left Panel */
.left-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    z-index: -1;
}

.brand-section {
    max-width: 500px;
    text-align: center;
}

.logo-container {
    margin-bottom: 40px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.brand-logo {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.brand-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 50px;
    line-height: 1.6;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateX(-10px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow-light);
}

.feature-text h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.feature-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    position: relative;
}

.right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(247, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    z-index: -1;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 25px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 10px;
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Form Container */
.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.login-section,
.forgot-section {
    animation: slideInRight 0.6s ease-out;
}

.forgot-section.hidden,
.login-section.hidden {
    display: none;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.back-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateX(5px);
}

.form-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Modern Form */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    position: relative;
}

.input-container {
    position: relative;
    background: rgba(247, 250, 252, 0.9);
    border-radius: 12px;
    border: 2px solid rgba(226, 232, 240, 0.6);
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-container:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.input-container input {
    width: 100%;
    padding: 18px 60px 18px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    font-weight: 500;
}

.input-container label {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    background: white;
    padding: 0 8px;
    font-weight: 500;
}

.input-container input:focus + label,
.input-container input:valid + label {
    top: 0;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    background: white;
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
    transition: var(--transition);
}

.input-container:focus-within .input-icon {
    color: #667eea;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    padding-right: 30px;
}

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

.checkmark {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background: rgba(226, 232, 240, 0.5);
    border-radius: 5px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    background: rgba(102, 126, 234, 0.1);
}

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

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    right: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

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

.forgot-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 16px 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-height: 50px;
}

.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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-icon {
    transition: var(--transition);
}

.submit-btn:hover .btn-icon {
    transform: translateX(-5px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(226, 232, 240, 0.5);
}

.divider span {
    padding: 0 20px;
    background: white;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 15px;
}

.social-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid rgba(226, 232, 240, 0.5);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 500;
}

.social-btn.google {
    color: #db4437;
}

.social-btn.apple {
    color: #000;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    border-color: currentColor;
}

/* Support and Register Request Links */
.signup-link, .register-request-link {
    text-align: center;
    margin-top: 15px;
}

.signup-link p, .register-request-link p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.support-link, .request-account-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.support-link::after, .request-account-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.support-link:hover::after, .request-account-link:hover::after {
    width: 100%;
}

.support-link:hover, .request-account-link:hover {
    color: #764ba2;
    text-decoration: none;
}

.register-request-link {
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 20px;
}

.register-request-link:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(102, 126, 234, 0.2);
}

/* Instructions Panel */
.instructions-panel {
    margin-top: 30px;
    padding: 25px;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.instructions-panel h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.instructions-panel h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.instruction-card {
    padding: 18px;
    background: white;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.instruction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.card-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.instruction-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.instruction-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(-100%);
    transition: var(--transition);
}

.toast-container.show {
    opacity: 1;
    transform: translateX(0);
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.toast-icon {
    width: 40px;
    height: 40px;
    background: var(--success-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.toast-close:hover {
    background: rgba(226, 232, 240, 0.5);
    color: var(--text-primary);
}

/* Loading State */
.submit-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.submit-btn.loading .btn-text {
    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); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .left-panel {
        padding: 40px;
        min-height: 40vh;
    }
    
    .brand-title {
        font-size: 2.5rem;
    }
    
    .features-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-item {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .right-panel {
        padding: 30px 20px;
    }
    
    .left-panel {
        padding: 30px 20px;
        text-align: center;
    }
    
    .brand-title {
        font-size: 2rem;
    }
    
    .brand-subtitle {
        font-size: 1rem;
    }
    
    .features-list {
        flex-direction: column;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .form-header h2 {
        font-size: 2rem;
    }
    
    .input-container input {
        padding: 18px 50px 18px 15px;
    }
    
    .submit-btn {
        padding: 16px 25px;
    }
    
    .toast {
        min-width: 280px;
        margin: 0 10px;
    }
}

