/*
 * Form fields of the website: text fields, text areas, check boxes, the dropdowns (Tom Select) and
 * phone fields (intl-tel-input) set up by assets/js/forms.js. Loaded after style.css / style_ar.css.
 */
:root {
    --field-height: 48px;
    --field-radius: 10px;
    --field-border: #d6dbe8;
    --field-border-hover: #b4bdd3;
    --field-bg: #ffffff;
    --field-text: #071B47;
    --field-muted: #8a91a6;
    --field-focus: #1c3bd9;
    --field-ring: 0 0 0 3px rgba(28, 59, 217, .14);
    --field-error: #de3831;
    --field-error-ring: 0 0 0 3px rgba(222, 56, 49, .14);
    --field-option-hover: #eef2ff;
}

/* ---- Text fields and text areas ------------------------------------------------------------- */
.global-form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=range]):not(.dropdown-input):not(.iti__search-input):not(.ts-control input),
.global-form textarea,
.form-control,
.ts-wrapper .ts-control,
.iti--site input.iti__tel-input {
    width: 100%;
    min-height: var(--field-height);
    padding: 11px 16px;
    border: 1px solid var(--field-border);
    border-radius: var(--field-radius);
    background-color: var(--field-bg);
    color: var(--field-text);
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: none;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.global-form textarea, textarea.form-control { min-height: 140px; resize: vertical; }
.global-form input::placeholder, .global-form textarea::placeholder, .form-control::placeholder, .iti--site input::placeholder { color: var(--field-muted); opacity: 1; }
.global-form input:not([type=checkbox]):not([type=radio]):hover, .global-form textarea:hover, .form-control:hover { border-color: var(--field-border-hover); }
.global-form input:not([type=checkbox]):not([type=radio]):focus, .global-form textarea:focus, .form-control:focus {
    border-color: var(--field-focus); background-color: var(--field-bg); box-shadow: var(--field-ring); outline: none;
}
.global-form input:disabled, .global-form textarea:disabled, .form-control:disabled, .form-control[readonly] { background-color: #f5f6fa; color: #6b7286; cursor: not-allowed; }
.global-form input[type=file], input[type=file].form-control {
    width: 100%; min-height: var(--field-height); padding: 6px !important; border: 1px dashed #b4bdd3; border-radius: var(--field-radius);
    background: #fff; color: var(--field-muted); font-size: 14px; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.global-form input[type=file]:hover, input[type=file].form-control:hover { border-color: var(--field-focus); background: #f7f9ff; }
.global-form input[type=file]:focus-visible { border-color: var(--field-focus); box-shadow: var(--field-ring); outline: none; }
.global-form input[type=file]::file-selector-button, input[type=file].form-control::file-selector-button {
    margin: 0; margin-inline-end: 12px; padding: 8px 16px; border: 0; border-radius: 7px;
    background: var(--suad-primary-blue, #002376); color: #fff; font: 600 14px "Montserrat", sans-serif; cursor: pointer; transition: background-color .15s;
}
.global-form input[type=file]::file-selector-button:hover, .global-form input[type=file]:hover::file-selector-button,
input[type=file].form-control:hover::file-selector-button { background: var(--suad-primary-blue-3, #1c3bd9); color: #fff; }
.global-form label, .form-label { color: var(--field-text); font-weight: 500; }

/* Errors: the page scripts mark fields with .form-error / .is-invalid. */
.global-form .form-error, .form-control.is-invalid, input.is-invalid, textarea.is-invalid,
.ts-wrapper.is-invalid .ts-control, .ts-wrapper.form-error .ts-control {
    border-color: var(--field-error) !important; box-shadow: var(--field-error-ring) !important;
}
.field-error { display: block; margin-top: 6px; color: var(--field-error); font-size: 13px; }

/* ---- Check boxes and radio buttons ---------------------------------------------------------- */
.global-form input[type=checkbox], .global-form input[type=radio], .form-check-input {
    -webkit-appearance: none; appearance: none; flex: 0 0 20px;
    width: 20px !important; height: 20px; min-height: 0; padding: 0 !important; margin: 0; margin-inline-end: 8px; vertical-align: -4px;
    border: 1.5px solid #b4bdd3; border-radius: 6px; background: #fff center / 12px no-repeat; cursor: pointer;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.global-form input[type=radio], .form-check-input[type=radio] { border-radius: 50%; }
.global-form input[type=checkbox]:hover, .global-form input[type=radio]:hover { border-color: var(--field-focus); }
.global-form input[type=checkbox]:focus-visible, .global-form input[type=radio]:focus-visible, .form-check-input:focus { box-shadow: var(--field-ring); outline: none; }
.global-form input[type=checkbox]:checked, .form-check-input[type=checkbox]:checked {
    border-color: var(--suad-primary-blue, #002376); background-color: var(--suad-primary-blue, #002376);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.global-form input[type=radio]:checked, .form-check-input[type=radio]:checked {
    border-color: var(--suad-primary-blue, #002376);
    background-image: radial-gradient(circle, var(--suad-primary-blue, #002376) 0 5px, transparent 5.5px);
}

/* ---- Dropdowns (Tom Select) ----------------------------------------------------------------- */
.ts-wrapper { width: 100%; }
/* Tom Select copies the select's classes (form-select, suad-select…) to its wrapper: only the control is the field. */
.ts-wrapper.form-select, .ts-wrapper.form-control, .ts-wrapper.suad-select, .ts-wrapper.rs-date-input, .global-form .ts-wrapper {
    height: auto; min-height: 0; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
}
.ts-wrapper.single .ts-control, .ts-wrapper.multi .ts-control {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding-inline-end: 42px; cursor: pointer; background-image: none;
}
.ts-wrapper.single .ts-control::after, .ts-wrapper.multi .ts-control::after {
    content: ""; position: absolute; top: 50%; inset-inline-end: 16px; width: 12px; height: 8px; margin-top: -4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23071B47' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .2s; pointer-events: none;
}
.ts-wrapper.dropdown-active .ts-control::after { transform: rotate(180deg); }
.ts-wrapper .ts-control:hover { border-color: var(--field-border-hover); }
.ts-wrapper.focus .ts-control, .ts-wrapper.dropdown-active .ts-control { border-color: var(--field-focus); box-shadow: var(--field-ring); }
.ts-wrapper.disabled .ts-control { background: #f5f6fa; opacity: 1; cursor: not-allowed; }
.ts-wrapper .ts-control > input { flex: 1 1 60px; min-width: 60px; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--field-text); font-size: 15px; }
.ts-wrapper .ts-control > input::placeholder { color: var(--field-muted); }
.ts-wrapper .ts-control:has(> .items-placeholder)::before { content: none !important; }
.ts-wrapper .ts-control > input.items-placeholder { flex: 1 1 auto; width: 100% !important; color: var(--field-text); pointer-events: none; }
html[lang^=ar] .ts-wrapper .ts-control > input.items-placeholder { text-align: right; direction: rtl; font-family: "aktiv-grotesk-arabic", "Montserrat", sans-serif; }
.ts-wrapper.single:not(.has-items) .ts-control[data-placeholder]::before { content: attr(data-placeholder); color: var(--field-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-wrapper.single .ts-control > .item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--field-text); }
.ts-wrapper.single.input-active .ts-control { background: var(--field-bg); }
.ts-wrapper.multi.has-items .ts-control { padding-top: 7px; padding-bottom: 7px; }
.ts-wrapper.multi .ts-control > .item {
    display: inline-flex; align-items: center; gap: 2px; margin: 0; padding: 3px 4px 3px 10px; border: 0; border-radius: 999px;
    background: var(--field-option-hover); color: var(--suad-primary-blue, #002376); font-size: 13.5px; font-weight: 600;
}
.ts-wrapper.plugin-remove_button .item .remove {
    display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: 0; padding: 0;
    border: 0 !important; border-radius: 50%; color: inherit; font-size: 15px; opacity: .7;
}
.ts-wrapper.plugin-remove_button .item .remove:hover { background: rgba(0, 35, 118, .12); opacity: 1; }
[dir=rtl] .ts-wrapper.multi .ts-control > .item { padding: 3px 10px 3px 4px; }

.ts-dropdown {
    z-index: 1060; margin-top: 6px; padding: 6px; border: 1px solid var(--field-border); border-radius: 12px;
    background: #fff; box-shadow: 0 16px 40px rgba(7, 27, 71, .16); color: var(--field-text); font-size: 15px;
}
.ts-dropdown .ts-dropdown-content { max-height: 300px; }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .optgroup-header { padding: 9px 12px; border-radius: 8px; }
.ts-dropdown .optgroup-header { color: var(--field-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ts-dropdown .active { background: var(--field-option-hover); color: var(--field-text); }
.ts-dropdown .option.selected { color: var(--suad-primary-blue-3, #1c3bd9); font-weight: 600; }
.ts-wrapper.single .ts-dropdown .option.selected { padding-inline-end: 34px; position: relative; }
.ts-wrapper.single .ts-dropdown .option.selected::after {
    content: ""; position: absolute; top: 50%; inset-inline-end: 12px; width: 12px; height: 10px; margin-top: -5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%231c3bd9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ts-dropdown .no-results { color: var(--field-muted); }
.ts-dropdown .dropdown-input-wrap { padding: 2px 2px 8px; }
.ts-dropdown .dropdown-input {
    width: 100%; height: 40px; padding: 0 12px 0 38px !important; border: 1px solid var(--field-border); border-radius: 8px; font-size: 14px;
    background: #f7f8fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%238a91a6' stroke-width='1.6'/%3E%3Cpath d='M11 11l3 3' stroke='%238a91a6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 12px center / 15px no-repeat;
}
[dir=rtl] .ts-dropdown .dropdown-input { padding: 0 38px 0 12px !important; background-position: right 12px center; }
.ts-dropdown .dropdown-input:focus { border-color: var(--field-focus); box-shadow: var(--field-ring); outline: none; background-color: #fff; }
.ts-dropdown .option .checkbox, .ts-dropdown.plugin-checkbox_options .option input { margin-inline-end: 8px; accent-color: var(--suad-primary-blue, #002376); }

/* Dropdowns that keep the look of their place. */
.library-search-area .search-wrapper .ts-wrapper { width: auto; min-width: 150px; }
.library-search-area .search-wrapper .ts-control { min-height: 46px; border-radius: 100px; }
.auth-desktop-form .ts-control, .auth-mobile-form .ts-control { min-height: 52px; border-radius: 100px; border-color: transparent; background: #f3f3f9; padding-inline-start: 22px; }
.rs-select-date-box .ts-wrapper { min-width: 220px; }

/* ---- Phone fields (intl-tel-input) ---------------------------------------------------------- */
.iti--site { display: block; width: 100%; --iti-hover-color: var(--field-option-hover); --iti-border-color: var(--field-border); }
.iti--site input.iti__tel-input { padding-inline-start: 72px !important; direction: ltr; text-align: start; }
[dir=rtl] .iti--site input.iti__tel-input { text-align: right; }
.iti--site .iti__country-container { padding: 4px; }
.iti--site .iti__selected-country { border-radius: 8px 0 0 8px; padding: 0 12px 0 10px; border-inline-end: 1px solid var(--field-border); }
[dir=rtl] .iti--site .iti__selected-country { border-radius: 0 8px 8px 0; }
.iti--site .iti__selected-country-primary { padding: 0; }
.iti--site .iti__selected-country:hover, .iti--site .iti__selected-country[aria-expanded=true] { background: var(--field-option-hover); }
.iti--site .iti__arrow { margin-inline-start: 6px; border-top-color: var(--field-text); }
.iti--site .iti__arrow--up { border-bottom-color: var(--field-text); }
.iti--site input.iti__tel-input:hover { border-color: var(--field-border-hover); }
.iti--site input.iti__tel-input:focus { border-color: var(--field-focus); box-shadow: var(--field-ring); }
.iti--site input.iti__tel-input.is-invalid, .iti--site input.iti__tel-input.form-error { border-color: var(--field-error) !important; box-shadow: var(--field-error-ring) !important; }
.iti__dropdown-content { margin-top: 6px; border: 1px solid var(--field-border) !important; border-radius: 12px; box-shadow: 0 16px 40px rgba(7, 27, 71, .16); overflow: hidden; }
.iti__search-input { height: 42px; margin: 6px; width: calc(100% - 12px) !important; padding: 0 12px; border: 1px solid var(--field-border) !important; border-radius: 8px; font-size: 14px; }
.iti__search-input:focus { border-color: var(--field-focus) !important; box-shadow: var(--field-ring); outline: none; }
.iti__country-list { max-height: 260px; padding: 0 6px 6px; }
.iti__country { display: flex !important; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; line-height: 1.3; cursor: pointer; }
.iti__country .iti__flag-box, .iti__country .iti__flag { flex: 0 0 auto; display: inline-block; margin: 0; }
.iti__country .iti__country-name { flex: 0 1 auto; margin: 0; color: var(--field-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iti__country .iti__dial-code { flex: 0 0 auto; margin: 0; margin-inline-start: auto; }
[dir=rtl] .iti__country .iti__dial-code { direction: ltr; }
.iti__country.iti__highlight { background: var(--field-option-hover); }
.iti__dial-code { color: var(--field-muted); }
.iti--fullscreen-popup .iti__dropdown-content { border-radius: 14px; }

/* ---- Arabic pages: Arabic font, right-to-left fields ------------------------------------------ */
html[lang^=ar] .global-form input:not([type=checkbox]):not([type=radio]),
html[lang^=ar] .global-form textarea, html[lang^=ar] .form-control,
html[lang^=ar] .ts-wrapper .ts-control, html[lang^=ar] .ts-dropdown, html[lang^=ar] .global-form label,
html[lang^=ar] .iti__dropdown-content { font-family: "aktiv-grotesk-arabic", "Montserrat", sans-serif; }
html[lang^=ar] .global-form input:not([type=checkbox]):not([type=radio]):not([type=tel]):not([type=email]):not([type=url]),
html[lang^=ar] .global-form textarea, html[lang^=ar] .ts-wrapper .ts-control { direction: rtl; text-align: right; }
html[lang^=ar] .ts-wrapper .ts-control, html[lang^=ar] .ts-dropdown .option { text-align: right; }
html[lang^=ar] .ts-wrapper.single .ts-control, html[lang^=ar] .ts-wrapper.multi .ts-control { padding-left: 42px !important; padding-right: 16px !important; }
html[lang^=ar] .ts-wrapper.single .ts-control::after, html[lang^=ar] .ts-wrapper.multi .ts-control::after { right: auto; left: 16px; }
/* E-mail, web and phone fields stay left to right, their placeholder on the right like the others. */
html[lang^=ar] .global-form input[type=email], html[lang^=ar] .global-form input[type=url] { direction: ltr; text-align: right; }
html[lang^=ar] .global-form input[type=email]:placeholder-shown, html[lang^=ar] .global-form input[type=url]:placeholder-shown { direction: rtl; }
html[lang^=ar] .iti--site input.iti__tel-input { direction: ltr; text-align: left; padding-left: 16px !important; padding-right: 72px !important; }
html[lang^=ar] .iti--site .iti__country-container { left: auto; right: 0; }
html[lang^=ar] .iti--site .iti__selected-country { border-radius: 0 8px 8px 0; border-inline-end: 0; border-left: 1px solid var(--field-border); padding: 0 10px 0 12px; }
html[lang^=ar] .global-form input[type=checkbox], html[lang^=ar] .global-form input[type=radio] { margin-right: 0; margin-left: 8px; }
html[lang^=ar] .ts-dropdown .dropdown-input { padding: 0 38px 0 12px !important; background-position: right 12px center; direction: rtl; text-align: right; }
html[lang^=ar] .ts-wrapper.single .ts-dropdown .option.selected { padding-right: 12px; padding-left: 34px; }
html[lang^=ar] .ts-wrapper.single .ts-dropdown .option.selected::after { right: auto; left: 12px; }
html[lang^=ar] .ts-dropdown .option { text-align: right; }
