* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Amazon Ember", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: #b42f4c;
}

.auth-page {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 100vh;
}

/* ========================================== */
/* الجانب الأيسر: صورة كاملة */
/* ========================================== */

.auth-side {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.auth-side-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================== */
/* الجانب الأيمن: النماذج */
/* ========================================== */

.auth-forms {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 30px;
    position: relative;
    overflow-y: auto;
}

.back-home {
    position: absolute;
    top: 25px;
    inset-inline-end: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.back-home:hover {
    color: #b42f4c;
}

.back-home i {
    font-size: 16px;
}

.form-container {
    width: 100%;
    max-width: 520px;
    display: none;
    animation: fadeInUp 0.5s ease;
}

.form-container.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-header h2 {
    font-size: 30px;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ========================================== */
/* اختيار طريقة الدخول/التسجيل (إيميل أو موبايل) */
/* ========================================== */

.login-method-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 10px;
}

.method-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-btn:hover {
    color: #333;
}

.method-btn.active {
    background: #fff;
    color: #b42f4c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.method-btn i {
    font-size: 16px;
}

/* ========================================== */
/* النماذج */
/* ========================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 7px;
}

.form-group label i {
    color: #b42f4c;
    font-size: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #b42f4c;
    box-shadow: 0 0 0 4px rgba(180, 47, 76, 0.1);
}

.form-group input.error {
    border-color: #dc2626;
}

.form-group input.success {
    border-color: #15803d;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-inline-start: 48px;
}

.toggle-password {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    background: #f5f5f5;
    color: #b42f4c;
}

.error-message {
    font-size: 12px;
    color: #dc2626;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* ========================================== */
/* رقم الهاتف مع كود الدولة - المعدل */
/* ========================================== */

.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-input-group input[type="tel"] {
    flex: 1;
    /* يأخذ المساحة المتبقية */
    min-width: 0;
    /* مهم للـ flex */
}

.phone-input-group .country-code-select {
    width: 95px;
    /* عرض ثابت وأصغر */
    flex-shrink: 0;
    /* ما يتقلصش */
    font-size: 13px;
    font-weight: 600;
    padding: 13px 10px;
}

/* المحافظات */
#registerCity:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    border-color: #b42f4c;
    background: #fff5f7;
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked+.checkbox-custom {
    background: #b42f4c;
    border-color: #b42f4c;
}

.checkbox-item input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 11px;
}

.checkbox-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* قوة كلمة المرور */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -3px;
}

.strength-bar {
    flex: 1;
    height: 5px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: #dc2626;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 33%;
    background: #dc2626;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #15803d;
}

.strength-text {
    font-size: 12px;
    font-weight: 600;
    color: #999;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me input[type="checkbox"]:checked+.checkbox-custom {
    background: #b42f4c;
    border-color: #b42f4c;
}

.remember-me input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 10px;
}

.forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: #b42f4c;
    transition: all 0.3s ease;
    cursor: pointer;
}

.forgot-link:hover {
    text-decoration: underline;
}

.terms-check {
    display: flex;
    align-items: start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.terms-check input[type="checkbox"] {
    display: none;
}

.terms-link {
    color: #b42f4c;
    font-weight: 600;
}

.terms-link:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, #b42f4c 0%, #8d2439 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(180, 47, 76, 0.3);
    margin-top: 5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(180, 47, 76, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    font-size: 14px;
}

.form-footer {
    text-align: center;
    margin-top: 15px;
}

.form-footer p {
    font-size: 13px;
    color: #666;
}

.switch-form {
    font-weight: 700;
    color: #b42f4c;
    transition: all 0.3s ease;
    cursor: pointer;
}

.switch-form:hover {
    text-decoration: underline;
}

.success-message {
    padding: 18px;
    background: #f0fdf4;
    border: 2px solid #15803d;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #15803d;
}

.success-message i {
    font-size: 22px;
}

.success-message p {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

/* ========================================== */
/* OTP Input */
/* ========================================== */

.otp-input-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.otp-input {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.otp-input:focus {
    outline: none;
    border-color: #b42f4c;
    box-shadow: 0 0 0 4px rgba(180, 47, 76, 0.1);
}

.otp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.otp-timer i {
    color: #b42f4c;
}

.otp-timer strong {
    color: #b42f4c;
    font-weight: 700;
}

.resend-code {
    text-align: center;
    margin-top: 15px;
}

.resend-code p {
    font-size: 13px;
    color: #666;
}

.resend-code a {
    font-weight: 700;
    color: #b42f4c;
    cursor: pointer;
}

.resend-code a:hover {
    text-decoration: underline;
}

/* ========================================== */
/* Responsive */
/* ========================================== */

@media (max-width: 1200px) {
    .auth-page {
        grid-template-columns: 40% 60%;
    }
}

@media (max-width: 992px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-side {
        display: none;
    }

    .auth-forms {
        padding: 40px 20px;
    }

    .back-home {
        top: 20px;
        inset-inline-end: 20px;
    }
}

@media (max-width: 768px) {
    .auth-forms {
        padding: 30px 15px;
    }

    .form-header h2 {
        font-size: 26px;
    }

    .form-header p {
        font-size: 13px;
    }

    .submit-btn {
        padding: 13px 20px;
        font-size: 14px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .phone-input-group .country-code-select {
        width: 85px;
        /* أصغر في الموبايل */
    }

    .login-method-switch {
        grid-template-columns: 1fr;
    }

    .method-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .back-home {
        font-size: 12px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 13px;
    }

    .submit-btn {
        font-size: 13px;
    }

    .otp-input {
        font-size: 20px;
    }

    .phone-input-group .country-code-select {
        width: 80px;
        /* أصغر في الشاشات الصغيرة جداً */
        padding: 12px 8px;
        font-size: 12px;
    }
}