/* ==========================================================================
   Al Masa -- forms and the Contact / Careers pages
   One spacing scale (same as the service pages): sections 4-7 rem apart, heading block 2.5-4 rem,
   cards and grids 1.5 rem (2 rem on wide screens), fields 1.25 rem. Light and dark read the tokens below.
   ========================================================================== */
.fm {
    --fm-bg: #F8F2E6; --fm-band: #F1E8D3; --fm-card: #FFFDF8; --fm-text: #1F2937; --fm-muted: #475569; --fm-title: #0B1556;
    --fm-line: rgba(183, 142, 59, 0.34); --fm-field: #FFFFFF; --fm-field-line: rgba(11, 21, 86, 0.28); --fm-gap: 1.5rem;
    background-color: var(--fm-bg) !important;
}
html.dark .fm {
    --fm-bg: #060A2B; --fm-band: #0A1040; --fm-card: #0F1857; --fm-text: #F8F2E6; --fm-muted: rgba(248, 242, 230, 0.8); --fm-title: #F8F2E6;
    --fm-line: rgba(217, 178, 90, 0.3); --fm-field: #0A1040; --fm-field-line: rgba(217, 178, 90, 0.4);
}
@media (min-width: 1100px) { .fm { --fm-gap: 2rem; } }

.fm-container { max-width: 80rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.fm-container--narrow { max-width: 52rem; }
.fm-section { padding-block: clamp(4rem, 9vw, 7rem); }
.fm-section--tight { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.fm-section--channels { padding-block: 0; margin-top: clamp(-4rem, -5vw, -2.5rem); position: relative; z-index: 3; }
.fm-section--band { background: var(--fm-band); border-block: 1px solid var(--fm-line); }

.fm-head { text-align: center; max-width: 46rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.fm-head h2 { margin: 0.6rem 0 0; }
.fm-head::after { content: ''; display: block; width: 3.5rem; height: 3px; margin: 1.3rem auto 0; background: var(--am-gold); border-radius: 3px; }
.fm-head__sub { margin: 1rem 0 0; color: var(--fm-muted); }
.fm-kicker { display: inline-block; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--am-gold-deep); }
.fm-kicker--small { font-size: 0.8125rem; letter-spacing: 0.14em; }
html.dark .fm-kicker { color: var(--am-gold-light); }
html[lang="ar"] .fm-kicker { letter-spacing: 0.02em; text-transform: none; font-size: 1rem; }

.fm-grid { display: grid; gap: var(--fm-gap); }
.fm-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.fm-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.fm .am-feature h3 { margin: 0 !important; font-size: 1.15rem !important; }
.fm .am-feature:hover h3 { color: #F8F2E6 !important; }
html.dark .fm .am-feature h3 { color: #F8F2E6 !important; }
html.dark .fm .am-feature:hover h3 { color: #0B1556 !important; }

/* ---------- cards, panels, alerts ---------- */
.fm-card { padding: clamp(1.6rem, 3.5vw, 2.8rem); border-radius: 1.5rem; background: var(--fm-card); border: 1px solid var(--fm-line); box-shadow: 0 30px 50px -34px rgba(11, 21, 86, 0.55); }
.fm-card h2 { margin: 0 0 0.8rem; }
.fm-card__lead { margin: 0 0 1.8rem; color: var(--fm-muted); font-size: 1.0625rem; line-height: 1.8; }
.fm-panel { padding: clamp(1.4rem, 3vw, 2rem); border-radius: 1.3rem; background: var(--fm-card); border: 1px solid var(--fm-line); }
.fm-panel h3 { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1rem !important; font-size: 1.2rem !important; }
.fm-panel h3 i { color: var(--am-gold); }
.fm-panel--navy { color: var(--am-cream); border-color: #D9B25A; background: linear-gradient(160deg, #0B1556, #031169); box-shadow: 0 26px 44px -28px rgba(3, 17, 105, 0.9); }
.fm-panel--navy h3 { color: #fff !important; }
.fm-panel--navy p { margin: 0 0 1.4rem; color: rgba(248, 242, 230, 0.9) !important; line-height: 1.75; }
.fm-panel__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.fm-alert { margin-bottom: 1.5rem; padding: 1rem 1.2rem; border-radius: 0.9rem; font-weight: 600; line-height: 1.6; }
.fm-alert ul { margin: 0.4rem 0 0; padding-inline-start: 1.2rem; list-style: disc; font-weight: 500; }
.fm-alert--ok { background: #E8F7EE; color: #0B5D2C; border: 1px solid #9ADBB4; }
.fm-alert--error { background: #FDECEC; color: #8A1C1C; border: 1px solid #F1A9A9; }
.fm-alert:focus { outline: 3px solid var(--am-gold); outline-offset: 2px; }

/* ---------- fields ---------- */
.fm-row { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .fm-row { grid-template-columns: 1fr 1fr; } }
.fm-field { margin-bottom: 1.25rem; }
.fm-field label:not(.fm-drop):not(.fm-check) { display: block; margin-bottom: 0.45rem; font-size: 0.9375rem; font-weight: 700; color: var(--fm-title); }
.fm-field abbr { color: #B3261E; text-decoration: none; }
html.dark .fm-field abbr { color: #FF9C94; }
.fm input[type="text"], .fm input[type="email"], .fm input[type="tel"], .fm select, .fm textarea {
    display: block; width: 100%; min-height: 3.25rem; padding: 0.8rem 1rem; border-radius: 0.8rem; font-size: 1rem; line-height: 1.5;
    color: var(--fm-text); background: var(--fm-field); border: 1px solid var(--fm-field-line); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fm textarea { min-height: 9rem; resize: vertical; line-height: 1.7; }
.fm input:invalid, .fm select:invalid, .fm textarea:invalid { box-shadow: none; border-color: var(--fm-field-line); }   /* errors are shown by our own messages, not the browser's red */
.fm input:focus, .fm select:focus, .fm textarea:focus { outline: none; border-color: var(--am-gold); box-shadow: 0 0 0 4px rgba(183, 142, 59, 0.28); }
.fm .has-error input:invalid, .fm .has-error select:invalid, .fm .has-error textarea:invalid, .fm .has-error input, .fm .has-error select, .fm .has-error textarea, .fm .has-error .fm-drop { border-color: #B3261E; }
html.dark .fm .has-error input, html.dark .fm .has-error select, html.dark .fm .has-error textarea, html.dark .fm .has-error .fm-drop { border-color: #FF9C94; }
.fm-help { margin: 0.4rem 0 0; font-size: 0.9375rem; color: var(--fm-muted); }
.fm-error { display: none; margin: 0.4rem 0 0; font-size: 0.9375rem; font-weight: 600; color: #B3261E; }
html.dark .fm-error { color: #FF9C94; }
.fm-count.is-ok { color: #0B7A3E; font-weight: 700; }
html.dark .fm-count.is-ok { color: #8AE0B0; }

.fm-check { display: flex; align-items: flex-start; gap: 0.8rem; cursor: pointer; font-size: 1rem; line-height: 1.6; color: var(--fm-text); }
.fm-check input { flex: none; width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; accent-color: var(--am-gold); }

.fm-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.fm-drop {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1.6rem 1rem; text-align: center; cursor: pointer;
    border: 2px dashed var(--fm-field-line); border-radius: 1rem; background: var(--fm-field); color: var(--fm-text); transition: border-color 0.2s, background 0.2s;
}
.fm-drop i { font-size: 2rem; color: var(--am-gold); }
.fm-drop__text { font-weight: 700; word-break: break-word; }
.fm-drop small { color: var(--fm-muted); font-size: 0.9375rem; }
.fm-drop:hover, .fm-drop.is-over { border-color: var(--am-gold); background: rgba(183, 142, 59, 0.08); }
.fm-drop.has-file { border-style: solid; border-color: #0B7A3E; }
.fm-drop.has-file i::before { content: '\f15c'; }
.fm-file:focus-visible + .fm-error, .fm-field:focus-within .fm-drop { box-shadow: 0 0 0 4px rgba(183, 142, 59, 0.28); border-color: var(--am-gold); }

.fm-submit { width: 100%; min-height: 3.4rem; margin-top: 0.5rem; font-size: 1rem !important; }
.fm-submit:disabled { cursor: not-allowed; opacity: 0.5; transform: none; filter: grayscale(0.4); }
.fm-submit.is-sending { opacity: 0.8; }
.fm-submit-help { text-align: center; margin-top: 0.8rem; }
html.dark .fm .am-btn--navy { background: #D9B25A !important; color: #0B1556 !important; border-color: #D9B25A !important; }
.am-btn--ghost-dark { border-color: #0B1556; color: #0B1556; background: transparent; }
.am-btn--ghost-dark:hover { background: #0B1556; color: #fff; }
html.dark .am-btn--ghost-dark { border-color: #D9B25A; color: #F8F2E6; }
html.dark .am-btn--ghost-dark:hover { background: #D9B25A; color: #0B1556; }

/* ---------- careers: checklist + layout ---------- */
.fm-apply { display: grid; gap: var(--fm-gap); align-items: start; }
@media (min-width: 980px) { .fm-apply { grid-template-columns: 22rem 1fr; } .fm-checklist { position: sticky; top: 7rem; } }
.fm-checklist { padding: 1.6rem; border-radius: 1.3rem; background: var(--fm-card); border: 1px solid var(--fm-line); }
.fm-checklist h3 { margin: 0 0 1rem !important; font-size: 1.2rem !important; }
.fm-progress { height: 0.6rem; border-radius: 999px; background: rgba(183, 142, 59, 0.2); overflow: hidden; }
.fm-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #D9B25A, #B78E3B); transition: width 0.35s ease; }
.fm-checklist__count { margin: 0.6rem 0 1.2rem; font-weight: 700; color: var(--fm-title); }
.fm-checklist ul { display: grid; gap: 0.85rem; margin: 0; padding: 0; list-style: none; }
.fm-checklist li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 1rem; line-height: 1.5; color: var(--fm-muted); transition: color 0.25s; }
.fm-checklist li i { flex: none; width: 1rem; margin-top: 0.3rem; text-align: center; color: var(--am-gold); font-size: 0.55rem; opacity: 0.55; }
.fm-checklist li.is-done i { font-size: 1rem; margin-top: 0.15rem; opacity: 1; }
.fm-checklist li.is-done { color: var(--fm-text); font-weight: 600; }
.fm-checklist li.is-done i { color: #0B7A3E; }
html.dark .fm-checklist li.is-done i { color: #8AE0B0; }

.fm-done { max-width: 40rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem); text-align: center; border-radius: 1.5rem; background: var(--fm-card); border: 1px solid #0B7A3E; box-shadow: 0 30px 50px -34px rgba(11, 21, 86, 0.55); }
.fm-done__icon { display: block; font-size: 3.5rem; color: #0B7A3E; }
html.dark .fm-done__icon { color: #8AE0B0; }
.fm-done h3 { margin: 1rem 0 0.8rem !important; }
.fm-done p { margin: 0 0 1.8rem; color: var(--fm-muted); font-size: 1.0625rem; line-height: 1.8; }
.fm-done__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

.fm-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2rem; text-align: center; }
.fm-note p { margin: 0; font-size: 1.125rem; }

/* ---------- contact ---------- */
.ct-channels { display: grid; gap: var(--fm-gap); margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.ct-channels li { display: flex; }
.ct-channel { flex: 1; text-decoration: none; background: var(--fm-card); box-shadow: 0 24px 44px -26px rgba(11, 21, 86, 0.6); }
.ct-channel__label { font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.04em; color: var(--fm-muted); transition: color 0.3s; }
.ct-channel strong { display: block; font-size: 1.15rem; line-height: 1.4; color: var(--fm-title); word-break: break-word; transition: color 0.3s; }
.ct-channel:hover .ct-channel__label { color: rgba(248, 242, 230, 0.85) !important; }
.ct-channel:hover strong { color: #F8F2E6 !important; }
html.dark .ct-channel:hover .ct-channel__label, html.dark .ct-channel:hover strong { color: #0B1556 !important; }
html.dark .ct-channel strong { color: #F8F2E6; }
.ct-channel:focus-visible { outline: 3px solid var(--am-gold); outline-offset: 3px; }

.ct-main { display: grid; gap: var(--fm-gap); align-items: start; }
@media (min-width: 980px) { .ct-main { grid-template-columns: 1.6fr 1fr; } .ct-side { position: sticky; top: 7rem; } }
.ct-side { display: grid; gap: var(--fm-gap); }
.ct-hours { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; color: var(--fm-muted); font-size: 1.0625rem; }

.ct-office { display: flex; flex-direction: column; gap: 1rem; }
.ct-office h3 { margin: 0.2rem 0 0.4rem !important; }
.ct-office p { margin: 0; font-size: 1rem; line-height: 1.7; }
.ct-office__meta { display: grid; gap: 0.5rem; margin: auto 0 0; padding: 1rem 0 0; list-style: none; border-top: 1px solid var(--fm-line); font-size: 1rem; }
.ct-office__meta li { display: flex; gap: 0.7rem; align-items: center; }
.ct-office__meta i { color: var(--am-gold); width: 1rem; text-align: center; transition: color 0.3s; }
.ct-office__meta a { color: inherit; text-decoration: none; word-break: break-all; }
.ct-office__link { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--am-gold-deep); text-decoration: none; }
html.dark .ct-office__link { color: var(--am-gold-light); }
.ct-office:hover .ct-office__link, .ct-office:hover .ct-office__meta i { color: #F6DE9A !important; }
.ct-office:hover .ct-office__meta { border-color: rgba(217, 178, 90, 0.4); }
html.dark .ct-office:hover .ct-office__link, html.dark .ct-office:hover .ct-office__meta i { color: #0B1556 !important; }
.ct-office:hover p, .ct-office:hover .ct-office__meta a { color: inherit !important; }

.ct-map { height: clamp(20rem, 45vw, 28rem); border-block: 1px solid var(--fm-line); }
.ct-map iframe { display: block; width: 100%; height: 100%; border: 0; filter: grayscale(0.6) contrast(1.05); opacity: 0.92; }
html.dark .ct-map iframe { filter: grayscale(0.8) invert(0.9) hue-rotate(180deg); }

.fm-faq { display: grid; gap: 1rem; }
.fm-q { border-radius: 1.1rem; background: var(--fm-card); border: 1px solid var(--fm-line); overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s; }
.fm-q[open] { border-color: var(--am-gold); box-shadow: 0 18px 34px -24px rgba(122, 90, 26, 0.6); }
.fm-q summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.125rem; line-height: 1.5; color: var(--fm-title); }
.fm-q summary::-webkit-details-marker { display: none; }
.fm-q summary:focus-visible { outline: 3px solid var(--am-gold); outline-offset: -3px; }
.fm-q summary i { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-size: 0.8rem; color: var(--am-gold); border: 1px solid var(--fm-line); transition: transform 0.3s, background 0.3s, color 0.3s; }
.fm-q[open] summary i { transform: rotate(180deg); background: var(--am-gold); color: #0B1556; }
.fm-q p { margin: 0; padding: 0 1.4rem 1.4rem; font-size: 1.0625rem; line-height: 1.85; color: var(--fm-muted); }

@media (prefers-reduced-motion: reduce) {
    .fm-progress span, .fm-drop, .fm-q, .fm-q summary i, .fm input, .fm select, .fm textarea { transition: none; }
}
