/* المتغيرات للألوان */
:root {
    /* درجات الأزرق السماوي والهوية */
    --primary-color: #0288D1;
    --primary-dark: #01579B;
    --accent-color: #29B6F6;

    /* ألوان الخلفية والنص */
    --bg-gradient: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    --glass-bg: rgba(255, 255, 255, 0.98);
    --text-color: #37474F;

    /* ألوان الحالة */
    --error-color: #D32F2F;
    --success-color: #43A047;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* حاوية الكارت الرئيسية */
.card {
    background: var(--glass-bg);
    padding: 3rem 2rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(1, 87, 155, 0.15);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* 1. تصميم الهيدر (اللوجو واسم الشركة) */
.header-section {
    margin-bottom: 30px;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 10px;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-name {
    color: var(--primary-dark);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.4;
}

/* 2. منطقة الفورم */
#form-section h1 {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    font-weight: 500;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

input[type="tel"] {
    width: 100%;
    padding: 18px;
    border: 2px solid #E1F5FE;
    background: #F1F8E9; /* لون فاتح جداً */
    background: #FAFAFA;
    border-radius: 18px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    direction: ltr;
    color: var(--text-color);
}

input[type="tel"]:focus {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(41, 182, 246, 0.15);
}

input[type="tel"]::placeholder {
    text-align: right;
    direction: rtl;
    color: #B0BEC5;
    font-size: 1rem;
    font-weight: 400;
}

/* الزر الأساسي */
.main-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(to left, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 1.1rem;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(2, 136, 209, 0.25);
}

.main-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(2, 136, 209, 0.35);
}

.main-btn:active {
    transform: scale(0.98);
}

/* رسالة الخطأ */
.message {
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 20px;
    color: var(--error-color);
    opacity: 0;
    transition: opacity 0.3s;
}

/* 3. منطقة الهدية (مخفية) */
#gift-section {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
}

/* أنيميشن الصندوق */
.gift-box-anim {
    font-size: 5rem;
    margin-bottom: 20px;
    cursor: pointer;
    animation: shake 2s infinite;
}

.congrats-text {
    color: var(--primary-dark);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 25px;
    font-weight: 700;
    opacity: 0; /* يبدأ مخفي للأنيميشن */
    transform: translateY(20px);
    transition: all 0.5s ease;
}

/* زر الحصول على الهدية (النهائي) */
.claim-btn {
    display: inline-block;
    text-decoration: none;
    background: var(--success-color);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(67, 160, 71, 0.3);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease 0.3s; /* تأخير بسيط */
}

.claim-btn:hover {
    background: #2E7D32;
    transform: scale(1.05) !important; /* important للتغلب على التعيين الأولي */
    box-shadow: 0 15px 30px rgba(67, 160, 71, 0.4);
}

/* Animations */
@keyframes shake {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes popOpen {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
        display: none;
    }
}

/* كلاسات للتحكم بالظهور */
.show-final .congrats-text,
.show-final .claim-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.box-opening {
    animation: popOpen 0.8s forwards;
}

/* الفوتر السفلي */
.footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #90A4AE;
}
