* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f6f5 0%, #e0e4e8 100%);
    color: #1a1a1a;
    line-height: 1.8;
    padding: 40px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 60px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 48, 135, 0.1);
}

.header {
    text-align: center;
    padding: 25px;
    border-bottom: 3px solid #003087;
    background: linear-gradient(to right, #003087, #1a1a1a);
    color: #fff;
    border-radius: 10px 10px 0 0;
    margin-bottom: 40px;
}

.header h1 {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1.40rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
    text-transform: capitalize;
}

.header h1.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 2.0em;
    text-transform: none;
}

.header p {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 0.80em;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 15px;
}

.header p.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 1.0em;
}

/* Left-align the English title and paragraph */
.content.english .header h1,
.content.english .header p {
    text-align: left;
}

/* Ensure the Arabic title and paragraph remain right-aligned */
.content.arabic .header h1,
.content.arabic .header p {
    text-align: right;
}

.section {
    margin: 40px 0;
}

.section h2 {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1.25rem;
    font-weight: 700;
    color: #003087;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    letter-spacing: 1px;
    text-transform: capitalize;
}

.section h2.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 1.10rem;
    text-transform: none;
}

.section h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, #003087, #d4af37);
    bottom: 0;
    left: 0;
}

.section h2.arabic::after {
    left: unset;
    right: 0;
}

.section p {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1.1em;
    font-weight: 300;
    color: #333;
    margin-bottom: 20px;
}

.section p.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 1.2em;
}

.section ul {
    margin-left: 20px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1.1em;
    font-weight: 300;
    color: #333;
}

.section ul.arabic {
    margin-left: 0;
    margin-right: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.2em;
}

.section ul li {
    margin-bottom: 15px;
}

.footer {
    text-align: center;
    padding-top: 30px;
    border-top: 3px solid #003087;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1em;
    font-weight: 300;
    color: #666;
    margin-top: 40px;
}

.footer.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1em;
}

.btn-contact, .btn-submit {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #003087, #0041c2);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1.1em;
    font-weight: 700;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 48, 135, 0.3);
    text-transform: uppercase;
    border: none;
    cursor: pointer;
}

.btn-contact.arabic, .btn-submit.arabic {
    font-family: 'Cairo', sans-serif;
    text-transform: none;
}

.btn-contact:hover, .btn-submit:hover {
    background: linear-gradient(45deg, #0041c2, #003087);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 48, 135, 0.5);
}

.lang-toggle {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(45deg, #003087, #0041c2);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 48, 135, 0.3);
    animation: fadeInScale 0.5s ease-in-out;
    margin: 0 5px;
}

.lang-toggle:hover {
    background: linear-gradient(45deg, #0041c2, #003087);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 48, 135, 0.5);
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.content {
    display: none;
}

.content.active {
    display: block;
}

.arabic {
    direction: rtl;
    text-align: right;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 0.875rem;
    font-weight: 400;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.form-group label.arabic {
    font-family: 'Cairo', sans-serif;
    font-size: 0.90em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
}

.form-group input[type="date"] {
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    padding: 5px;
    cursor: pointer;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23003087" viewBox="0 0 16 16"><path d="M3 14V3h10v11H3zm1-1h8V6H4v7zm1-9h6V3H5v1z"/><rect x="5" y="7" width="1" height="1"/><rect x="7" y="7" width="1" height="1"/><rect x="9" y="7" width="1" height="1"/></svg>') no-repeat center;
    background-size: 16px;
}

.form-group input[type="date"]:focus {
    border-color: #003087;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 48, 135, 0.3);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    background-color: #fff;
}

.form-group select.arabic {
    font-family: 'Cairo', sans-serif;
}

.form-group small {
    font-size: 0.75rem;
    color: #444746;
    display: block;
    margin-top: 5px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
}

.form-group small.arabic {
    font-family: 'Cairo', sans-serif;
}

.form-group small a {
    color: #003087;
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

.form-group input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #003087;
    border-radius: 50%;
    background-color: #fff;
    margin-right: 10px;
    margin-left: 10px;
    margin-bottom: 0;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
}

.form-group input[type="radio"]:checked::before {
    content: '';
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #003087, #0041c2);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.form-group input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #003087;
    background-color: #fff;
    margin-right: 10px;
    margin-left: 10px;
    margin-bottom: 0;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
}

.form-group input[type="checkbox"]:checked::before {
    content: '';
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #003087, #0041c2);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.form-group .radio-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

.form-group .radio-group .radio-option {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.form-group .radio-group label {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1em;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    margin: 0;
}

.content.english .form-group .radio-group label {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 0.875rem;
}

.form-group .checkbox-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

.form-group .checkbox-group .checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.form-group .checkbox-group label {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1em;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    margin: 0;
}

.content.english .form-group .checkbox-group label {
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 0.875rem;
}

.form-group .radio-group br,
.form-group .checkbox-group br {
    display: none;
}

.form-group .conditional-field {
    display: none;
    margin-top: 10px;
}

.form-group .conditional-field#bothFieldArabic input,
.form-group .conditional-field#bothFieldEnglish input {
    margin-bottom: 15px;
}

.add-field-link {
    color: #003087;
    font-size: 0.9em;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: underline;
}

.add-field-link.arabic {
    font-family: 'Cairo', sans-serif;
}

.add-field-link:hover {
    color: #0041c2;
}

.email-field-container {
    margin-bottom: 10px;
    position: relative;
}

.email-field-container input {
    width: 100%;
    padding: 10px 10px 10px 30px;
}

.remove-field-btn {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    background: #666;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-field-btn:hover {
    background: #444;
}

.file-upload-container {
    position: relative;
    display: inline-block;
}

.file-upload-container input[type="file"] {
    display: none;
}

.file-upload-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #e0e4e8;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif, 'Noto Color Emoji';
    font-size: 0.8em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 120px;
    min-width: 120px;
}

.file-upload-btn.arabic {
    font-family: 'Cairo', sans-serif;
}

.file-upload-btn:hover {
    background: #d0d4d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.file-list {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-family: 'Google Sans Text', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 0.9em;
    color: #333;
}

.file-item.arabic {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.remove-file-btn {
    background: #666;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background: #444;
}

.file-item.arabic .remove-file-btn {
    margin-right: 0;
    margin-left: 10px;
}

form#agreementEnglish .form-group p,
form#agreementEnglish .form-group label {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    body { padding: 20px; }
    .container { padding: 30px; max-width: 100%; }
    .header { padding: 20px; }
    .header h1 { font-size: 1.40rem; letter-spacing: 1px; }
    .header h1.arabic { font-size: 1.4em; }
    .header p, .header p.arabic { font-size: 0.80em; margin-bottom: 10px; }
    .section { margin: 30px 0; }
    .section h2 { font-size: 1.25rem; }
    .section h2.arabic { font-size: 1.10rem; }
    .section h2::after, .section h2.arabic::after { width: 40px; }
    .section p, .section p.arabic, .section ul, .section ul.arabic { font-size: 1em; }
    .btn-contact, .btn-contact.arabic, .btn-submit, .btn-submit.arabic { font-size: 1em; padding: 10px 25px; }
    .footer, .footer.arabic { font-size: 0.9em; }
    .lang-toggle { padding: 6px 15px; font-size: 0.9em; }
    .form-group small { font-size: 0.75rem; }
    form#agreementEnglish .form-group p, form#agreementEnglish .form-group label { font-size: 0.875rem; }
    .form-group label.arabic { font-size: 0.90em; }
}

/* تحسين مظهر حقل إدخال التاريخ */
.form-group input[type="date"]:required:invalid::-webkit-datetime-edit {
    color: #757575;
}

.form-group input[type="date"] {
    position: relative;
    height: 42px;
    font-size: 1em;
    color: #333;
    padding-left: 15px;
    padding-right: 30px;
}

/* تعديل حقل التاريخ للغة العربية */
.content.arabic input[type="date"] {
    direction: rtl;
    text-align: right;
    padding-right: 15px;
    padding-left: 30px;
}

.form-group input[type="date"]::before {
    content: attr(placeholder);
    position: absolute;
    color: #888;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 0.95em;
    pointer-events: none;
}

/* تعديل محاذاة النص داخل حقل التاريخ للغة العربية */
.content.arabic .form-group input[type="date"]::before {
    text-align: right;
    justify-content: flex-end;
    padding-right: 15px;
}

.form-group input[type="date"]:valid::before,
.form-group input[type="date"]:focus::before {
    display: none;
}

/* تحسين موضع أيقونة التقويم */
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

/* للنص العربي (من اليمين إلى اليسار)، نعكس موضع الأيقونة */
.content.arabic .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    right: auto;
    left: 10px;
}

/* تعديل لدعم مختلف المتصفحات للغة العربية */
@-moz-document url-prefix() {
    .content.arabic input[type="date"] {
        text-align: right;
        padding-right: 15px;
        padding-left: 30px;
    }
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
    .content.arabic input[type="date"] {
        text-align: right;
        padding-right: 15px;
        padding-left: 30px;
    }
}

/* تحسين عرض المحتوى في الهيدر */
.header h1, .header p {
    text-align: center !important;
}

/* تصميم دائرة التحميل مع تناسق الألوان مع النموذج */
.loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.arabic .loading-spinner {
    margin-right: 0;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* تصميم زر الإرسال في حالة التحميل */
.btn-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-submit.loading {
    padding-left: 40px;
    padding-right: 40px;
    background: linear-gradient(45deg, #124aa7, #0041c2);
    cursor: not-allowed;
    opacity: 0.9;
}

.btn-submit.loading .loading-spinner {
    display: inline-block;
}

.btn-submit.loading .btn-text {
    margin-left: 5px;
    margin-right: 5px;
}

.btn-submit.arabic.loading {
    flex-direction: row-reverse;
}

/* تحريك النص أثناء التحميل ليبدو أفضل */
.btn-text {
    transition: all 0.3s ease;
}

/* تصميم رسالة النجاح */
.submit-success-message {
    display: none;
    color: #4BB543;
    background-color: rgba(75, 181, 67, 0.1);
    border: 1px solid #4BB543;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}