/* الأساسيات */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Beiruti", sans-serif;
    background-color: #f9f9f9;
    color: #333;
}

/* تحسين تصميم النموذج */
.subscribe-section {
    width: 90%;
    max-width: 600px;
    margin: 2em auto;
    padding: 1.5em;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center; /* لتوسيط النصوص داخل القسم */
    direction: rtl; /* المحافظة على اتجاه النصوص من اليمين لليسار */
    border: 1px solid #ddd;
}

.subscribe-section h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 1em;
    font-family: 'Beiruti', sans-serif;
    font-weight: bold;
}

.subscribe-section p {
    color: #555;
    font-size: 1em;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

/* تحسين تنسيق الحقول */
.input-container {
    margin-top: 1.5em;
    display: flex;
    flex-direction: column;
    align-items: center; /* لتوسيط الحقول داخل الحاوية */
}

.input {
    position: relative;
    margin: 1em 0;
    width: 100%;
    max-width: 500px; /* أقصى عرض للحقل */
}

.input input,
.input textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center; /* لتوسيط النصوص داخل الحقل */
}

.input input:focus,
.input textarea:focus {
    border-color: #767151;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    outline: none;
}

.input label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #888;
    transition: all 0.3s ease;
    pointer-events: none;
    background-color: #ffffff; /* خلفية بيضاء لجعل التسمية أكثر وضوحًا */
    padding: 0 5px; /* حشوة صغيرة لزيادة وضوح التسمية */
}

/* تغيير وضع التسمية عند التركيز */
.input input:focus ~ label,
.input input:valid ~ label,
.input textarea:focus ~ label,
.input textarea:valid ~ label {
    top: -15px;
    font-size: 12px;
    color: #767151;
}

/* تحسين تصميم زر الإرسال */
/* تصميم الزر */
.subscribe-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px; /* تصميم مستدير */
    background: linear-gradient(45deg, #767151, #6c5b4f); /* تدرج لوني جميل */
    color: #ffffff;
    font-size: 16px; /* حجم خط أكبر */
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s; /* تأثيرات الانتقال */
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase; /* تكبير الحروف */
}

.subscribe-btn:hover {
    background: linear-gradient(45deg, #6c5b4f, #767151); /* تغيير التدرج عند التمرير */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* إضافة ظل */
    transform: translateY(-3px); /* رفع الزر قليلاً عند التمرير */
}

.subscribe-btn:active {
    background: linear-gradient(45deg, #5b4a39, #6c5b4f); /* تغيير التدرج عند الضغط */
    transform: translateY(1px); /* العودة إلى الموضع الطبيعي عند الضغط */
}

/* تحسين تصميم الرسائل */
.success-message,
.error-message {
    max-width: 90%;
    margin: 1em auto;
    padding: 1em;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    border: 1px solid;
}

.success-message {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
    color: #0a3622;
}

.error-message {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #58151c;
}

/* تحسين استجابة التصميم للهواتف المحمولة */
@media (max-width: 768px) {
    .subscribe-section {
        padding: 1.2em;
    }

    .subscribe-section h1 {
        font-size: 1.8em;
    }

    .subscribe-section p {
        font-size: 0.9em;
    }

    .input-container {
        margin-top: 1em;
    }

    .input input,
    .input textarea {
        font-size: 13px;
        padding: 12px;
    }

    .subscribe-section button {
        font-size: 13px;
        padding: 10px 20px;
    }
}

@media (max-width: 425px) {
    .subscribe-section {
        padding: 1em;
    }

    .subscribe-section h1 {
        font-size: 1.5em;
    }

    .subscribe-section p {
        font-size: 0.85em;
    }

    .input-container {
        margin-top: 0.5em;
    }

    .input input,
    .input textarea {
        font-size: 12px;
        padding: 10px;
    }

    .subscribe-section button {
        font-size: 12px;
        padding: 8px 15px;
    }
}
