.auth-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: #fff;
    border-bottom: 1px solid #e7f5fc;
    box-shadow: 0 2px 12px rgba(0,175,240,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.auth-top-bar .auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1.5px solid #00AFF0;
    color: #00AFF0;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.auth-top-bar .auth-back-btn:hover {
    background: #00AFF0;
    color: #fff;
    text-decoration: none;
    transform: translateX(-2px);
}

.auth-lang-switcher {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #d7edf8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,175,240,0.08);
}
.auth-lang-btn {
    min-width: 52px;
    height: 38px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}
.auth-lang-btn:hover { background: #f2fbff; }
.auth-lang-btn.active-lang { background: #00AFF0; color: #fff; }
.auth-lang-divider { width: 1px; height: 20px; background: #d8edf7; }

.auth-input-wrap {
    position: relative;
}

.auth-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    z-index: 2;
    color: #00AFF0;
}
.auth-icon.auth-icon-left  { left: 16px; pointer-events: none; }
.auth-icon.auth-icon-right { right: 16px; pointer-events: all; cursor: pointer; }

.auth-input {
    padding-left: 46px !important;
    padding-right: 46px !important;
    border: 2px solid #e2f4fd !important;
    border-radius: 14px !important;
    height: 52px !important;
    font-size: 15px !important;
    background: #f8fcff !important;
    transition: all 0.25s !important;
    width: 100%;
}
.auth-input:focus {
    border-color: #00AFF0 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(0,175,240,0.10) !important;
    outline: none !important;
}

.auth-form-top-btn {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.auth-form-top-btn .btn-register {
    width: auto !important;
    padding: 10px 28px !important;
    margin-top: 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}
.auth-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00AFF0;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.auth-checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
}

.auth-forgot {
    text-align: center;
    margin-top: 18px;
}
.auth-forgot a {
    color: #00AFF0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.auth-forgot a:hover { text-decoration: underline; }

.login-features li,
.features li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    font-size: 15px;
    color: #fff;
}

.login-header {
    margin-bottom: 28px;
}
.login-header h3 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.login-header p {
    color: #6b7280;
    font-size: 14px;
}

.form-header {
    margin-bottom: 28px;
}
.form-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.form-header p {
    color: #6b7280;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 15px !important;
    background: linear-gradient(135deg, #00AFF0, #0090c8) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s !important;
    box-shadow: 0 4px 15px rgba(0,175,240,0.35) !important;
    letter-spacing: 0.3px;
}
.btn-login:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,175,240,0.45) !important;
}

.btn-register {
    background: linear-gradient(135deg, #00AFF0, #0090c8) !important;
    color: #fff !important;
    border: none !important;
    padding: 15px !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s !important;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0,175,240,0.35) !important;
}
.btn-register:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,175,240,0.45) !important;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}
.login-link a {
    color: #00AFF0;
    font-weight: 600;
    text-decoration: none;
}
.login-link a:hover { text-decoration: underline; }

.footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #9ca3af;
    background: #87CEFA;
}

.error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
    display: block;
}

html[dir="rtl"] body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

html[dir="rtl"] .login-container  { flex-direction: row-reverse !important; }
html[dir="rtl"] .register-container { flex-direction: row-reverse !important; }

html[dir="rtl"] .login-left  { order: 2 !important; text-align: right !important; }
html[dir="rtl"] .login-right { order: 1 !important; text-align: right !important; }
html[dir="rtl"] .left-panel  { order: 2 !important; text-align: right !important; }
html[dir="rtl"] .right-panel { order: 1 !important; text-align: right !important; }

html[dir="rtl"] .login-left-content,
html[dir="rtl"] .left-content { text-align: right !important; width: 100%; }

html[dir="rtl"] .login-left h2, html[dir="rtl"] .login-left p,
html[dir="rtl"] .left-panel h2, html[dir="rtl"] .left-panel p {
    text-align: right !important;
}

html[dir="rtl"] .login-header,
html[dir="rtl"] .login-header h3,
html[dir="rtl"] .login-header p,
html[dir="rtl"] .form-header,
html[dir="rtl"] .form-header h3,
html[dir="rtl"] .form-header p { text-align: right !important; }

html[dir="rtl"] .login-features,
html[dir="rtl"] .features { padding: 0 !important; list-style: none !important; }

html[dir="rtl"] .login-features li,
html[dir="rtl"] .features li { justify-content: flex-start !important; }

html[dir="rtl"] .login-features li i,
html[dir="rtl"] .features li i {
    margin-right: 0 !important;
    margin-left: 14px !important;
}

html[dir="rtl"] .login-features li .feat-text,
html[dir="rtl"] .features li .feat-text { text-align: right !important; flex: 1; }

html[dir="rtl"] .auth-icon.auth-icon-left {
    left: auto !important;
    right: 16px !important;
}
html[dir="rtl"] .auth-icon.auth-icon-right {
    right: auto !important;
    left: 16px !important;
}

html[dir="rtl"] .auth-form-top-btn { justify-content: flex-start !important; }

html[dir="rtl"] .auth-checkbox-group {
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
}

html[dir="rtl"] .auth-forgot { text-align: right !important; }
html[dir="rtl"] .login-link  { text-align: center !important; }
html[dir="rtl"] .footer p    { text-align: center !important; }
html[dir="rtl"] .error-message { text-align: right !important; }

html[dir="rtl"] .form-group.double { flex-direction: row-reverse !important; }

html[dir="rtl"] .country-select {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .flag-icon {
    display: none !important;
}

html[dir="rtl"] .custom-country-select {
    /* flex-direction JS سے control ہوتی ہے */
}

html[dir="rtl"] .custom-country-select .selected-flag {
    font-size: 20px !important;
    flex-shrink: 0 !important;
}

html[dir="rtl"] .custom-country-select .selected-text {
    flex: 1 !important;
    text-align: right !important;
}

html[dir="rtl"] .custom-country-select .select-arrow {
    color: #aaa !important;
    font-size: 16px !important;
}

html[dir="rtl"] .auth-input-wrap .country-select {
    width: 100% !important;
}

html[dir="rtl"] .auth-back-btn { flex-direction: row-reverse; }
html[dir="rtl"] .auth-back-btn:hover { transform: translateX(2px); }

@media (max-width: 900px) {
    html[dir="rtl"] .login-container,
    html[dir="rtl"] .register-container { flex-direction: row-reverse !important; }
    html[dir="rtl"] .login-left  { order: 2 !important; }
    html[dir="rtl"] .login-right { order: 1 !important; }
    html[dir="rtl"] .left-panel  { order: 2 !important; }
    html[dir="rtl"] .right-panel { order: 1 !important; }
}

@media (max-width: 600px) {
    html[dir="rtl"] .login-container,
    html[dir="rtl"] .register-container { flex-direction: column !important; }
    html[dir="rtl"] .login-left,
    html[dir="rtl"] .left-panel  { order: 1 !important; }
    html[dir="rtl"] .login-right,
    html[dir="rtl"] .right-panel { order: 2 !important; }
}
