/* ========================================
   TRADO - Authentication Pages Styles
   ======================================== */

/* Mobile Header for Auth Pages */
.auth-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-mobile-header .logo-text {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.auth-mobile-header .logo-dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

.auth-mobile-header .lang-switcher {
    position: static;
    box-shadow: none;
    background: var(--gray-100);
}

/* Desktop only lang-switcher */
.lang-switcher.desktop-only {
    display: flex;
}

.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Left Side - Branding */
.auth-left {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-left-content {
    position: relative;
    z-index: 1;
}

.auth-left .logo {
    margin-bottom: 60px;
}

.auth-left .logo-text {
    color: var(--white);
}

.auth-info h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
}

.auth-info p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 400px;
}

.auth-features {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-feature .feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-feature .feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
}

.auth-feature span {
    font-size: 16px;
    font-weight: 500;
    color: var(--white);
}

.auth-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.auth-bg-shapes .shape-1 {
    width: 400px;
    height: 400px;
    background: var(--gold);
    top: -100px;
    right: -100px;
}

.auth-bg-shapes .shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    bottom: -50px;
    left: -50px;
}

/* Right Side - Form */
.auth-right {
    background: var(--white);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h2 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.auth-form-header p {
    font-size: 16px;
    color: var(--gray-500);
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--gray-900);
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(36, 54, 191, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-300);
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: color 0.3s ease;
}

.toggle-password:hover svg {
    color: var(--gray-600);
}

/* Password Strength */
.password-strength {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.weak { width: 33%; background: #ef4444; }
.strength-bar.medium { width: 66%; background: #f59e0b; }
.strength-bar.strong { width: 100%; background: #10b981; }

.password-hint {
    font-size: 12px;
    color: var(--gray-400);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-600);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.checkbox-label input:checked + .checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.terms-checkbox a {
    color: var(--primary);
    font-weight: 500;
}

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

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

.forgot-link {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-divider span {
    font-size: 14px;
    color: var(--gray-400);
}

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

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 15px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    margin-left: 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Error States */
.form-group.error input {
    border-color: #ef4444;
}

.form-group .error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

/* Loading State */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading span {
    visibility: hidden;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-left {
        display: none !important;
    }
    
    .auth-right {
        padding: 40px 24px;
    }
    
    .lang-switcher.desktop-only {
        display: flex;
        position: fixed;
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    /* Show mobile header */
    .auth-mobile-header {
        display: flex;
    }
    
    /* Hide desktop lang-switcher */
    .lang-switcher.desktop-only {
        display: none !important;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-left {
        display: none !important;
        width: 0 !important;
        visibility: hidden !important;
    }
    
    .auth-right {
        padding: 80px 20px 40px;
        width: 100%;
    }
    
    .auth-mobile-header .lang-switcher {
        display: flex !important;
        flex-direction: row !important;
        width: auto !important;
        height: auto !important;
        padding: 4px;
        gap: 4px;
    }
    
    .auth-mobile-header .lang-btn {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .auth-form-header h2 {
        font-size: 26px;
    }
    
    .auth-form-header p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* RTL Support */
body[dir="rtl"] .auth-left {
    text-align: right;
}

body[dir="rtl"] .auth-feature {
    flex-direction: row-reverse;
}

body[dir="rtl"] .password-input input {
    padding-right: 16px;
    padding-left: 48px;
}

body[dir="rtl"] .toggle-password {
    right: auto;
    left: 14px;
}

body[dir="rtl"] .checkbox-label {
    flex-direction: row-reverse;
}

body[dir="rtl"] .auth-footer a {
    margin-left: 0;
    margin-right: 4px;
}
