:root {
    --primary-blue: #005F8F;
    /* Approximate blue from image */
    --primary-gold: #C69C6D;
    /* Approximate gold from image */
    --light-bg: #F8F9FA;
    --text-dark: #333;
    --border-color: #ddd;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    /* Similar to the font in the image */
    background-color: var(--light-bg);
    color: var(--text-dark);
    direction: rtl;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 480px;
    /* Mobile-first constraint similar to the screenshot */
    margin: 0 auto;
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

/* Right Side (Honor) */
.logo-right .honor-logo {
    height: 35px;
}

/* Left Side (Nahj) */
.logo-left .nahj-logo {
    height: 40px;
    max-width: 120px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
    position: relative;
    padding-bottom: 20px;
    overflow: hidden;
    /* In a real scenario, this would have a background image */
}

.hero-visuals {
    width: 100%;
    height: 250px;
    background-color: #2F5C8F;
    /* Fallback/Placeholder blue */
    /* غير صورة الخلفية من هنا */
    /* Change Background Image Here */
    /* ⬇️ 2. لتغيير خلفية القسم العلوي: استبدل الرابط أدناه */
    /* ⬇️ 2. To change Hero Background: Replace the url below */
    background-image: url('https://img.freepik.com/free-vector/gradient-golden-luxury-background_23-2149022631.jpg');
    /* Placeholder luxury bg */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Simulating the banner content with standard elements for now */
.hero-visuals::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 47, 90, 0.6));
}

.devices-placeholder {
    width: 80%;
    height: 80%;
    /* غير صورة الهواتف/الفوانيس من هنا */
    /* Change Devices Image Here */
    /* ⬇️ 3. لتغيير صورة الهواتف: استبدل الرابط أدناه */
    /* ⬇️ 3. To change Devices Image: Replace the url below */
    background-image: url('https://raw.githubusercontent.com/GSMArena/phone-finders/master/honor-magic-v2.png');
    /* Placeholder phone */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    z-index: 1;
}

.hero-text {
    position: absolute;
    top: 50px;
    right: 20px;
    z-index: 2;
    color: white;
    text-align: right;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Form Section */
.form-section {
    position: relative;
    margin-top: -40px;
    /* Overlap with hero */
    z-index: 10;
    padding-bottom: 50px;
}

.form-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0C090;
    /* Gold border */
    text-align: center;
}

.form-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
    text-align: right;
}

input,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    text-align: right;
    /* Force right alignment */
    box-sizing: border-box;
    /* Force consistent internal width */
    height: 45px;
    /* Fixed height for consistency */
    background: #fff;
    display: block;
}

input:focus,
select:focus {
    border-color: var(--primary-blue);
}

.imei-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.half-width {
    width: 48%;
    display: flex;
    flex-direction: column;
}

.imei-label {
    text-align: right;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #2F5C8F 0%, #C69C6D 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Footer links */
.terms-link {
    text-align: center;
    margin-top: 20px;
}

.terms-link a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    transition: transform 0.2s;
}

.social-icon:hover {
    transform: translateY(-3px);
}

.social-icon.facebook {
    background: #1877F2;
}

.social-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-icon.whatsapp {
    background: #25D366;
}

/* Background Decoration */
.bg-decoration-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(200, 200, 200, 0.1), transparent);
    z-index: -1;
    pointer-events: none;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Terms Section */
.terms-section {
    padding-bottom: 40px;
}

.terms-card h3 {
    color: var(--primary-blue);
}

.terms-card h3 i {
    margin-left: 8px;
}

.terms-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    text-align: right;
}

.terms-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 5px;
    border-bottom: 1px solid #f0e8dd;
    font-size: 13px;
    line-height: 1.9;
    word-break: break-word;
}

.terms-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.term-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-gold));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-top: 2px;
}

.terms-list li>span:last-child {
    flex: 1;
    min-width: 0;
}

.terms-list a {
    color: var(--primary-blue);
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-blue);
}

.terms-list a:hover {
    color: var(--primary-gold);
    border-color: var(--primary-gold);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .terms-list li {
        gap: 8px;
        padding: 12px 2px;
        font-size: 13px;
        line-height: 1.8;
    }

    .term-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 11px;
        margin-top: 2px;
    }

    .terms-card {
        padding: 15px 12px;
    }

    .terms-card h3 {
        font-size: 15px;
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-gold));
    color: white;
    font-family: 'Inter', 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 95, 143, 0.3);
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 95, 143, 0.4);
}

.lang-btn:active {
    transform: translateY(0);
}

.lang-btn i {
    font-size: 14px;
}

/* LTR Mode (English) */
body.ltr {
    direction: ltr;
    font-family: 'Inter', 'Tajawal', sans-serif;
}

body.ltr .header-container {
    direction: rtl;
}

body.ltr .form-card {
    text-align: center;
}

body.ltr .terms-list {
    text-align: left;
}

body.ltr .terms-card h3 i {
    margin-left: 0;
    margin-right: 8px;
}

/* Custom Modal */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal-overlay.active {
    display: flex;
}

.custom-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px 25px 20px;
    max-width: 340px;
    width: 85%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

.custom-modal-body p {
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.8;
    margin: 0 0 20px 0;
}

.custom-modal-btn {
    background: linear-gradient(90deg, #2F5C8F 0%, #C69C6D 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 40px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s;
}

.custom-modal-btn:hover {
    opacity: 0.9;
}

/* IMEI Help Button */
.label-with-help {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.label-with-help label {
    margin-bottom: 0;
}

.help-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.help-btn:hover {
    color: var(--primary-gold);
    transform: scale(1.15);
}

/* IMEI Help Image Modal */
.imei-help-modal {
    padding: 10px;
    max-width: 420px;
    width: 90%;
    position: relative;
}

.imei-help-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.2s;
}

.imei-help-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.imei-help-img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}