/* Al-Saffar Forms. Override the variables below from the theme to match the brand. */
.asf {
  --asf-accent: #0b5ea8;
  --asf-accent-dark: #084a85;
  --asf-text: #1f2933;
  --asf-muted: #6b7785;
  --asf-border: #d5dbe3;
  --asf-bg: #ffffff;
  --asf-soft: #f4f7fa;
  --asf-danger: #c62828;
  --asf-ok: #2e7d32;
  --asf-radius: 10px;
  max-width: 760px;
  margin: 0 auto;
  color: var(--asf-text);
  font-size: 16px;
  line-height: 1.6;
}
.asf *, .asf *::before, .asf *::after { box-sizing: border-box; }
.asf-form, .asf-success {
  background: var(--asf-bg);
  border: 1px solid var(--asf-border);
  border-radius: calc(var(--asf-radius) * 1.4);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: 0 10px 30px rgba(16, 42, 67, 0.06);
}
.asf-title { margin: 0 0 6px; font-size: 1.5em; line-height: 1.3; color: var(--asf-text); }
.asf-intro { margin: 0 0 22px; color: var(--asf-muted); }
.asf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.asf-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .asf-grid { grid-template-columns: 1fr; } }

.asf .asf-field label { display: block; margin: 0 0 6px; padding: 0; font-weight: 600; font-size: 0.95em; line-height: 1.4; }
.asf-req { color: var(--asf-danger); font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
.asf-opt { color: var(--asf-muted); font-weight: 400; font-size: 0.85em; }
/* Themes such as Enfold style form controls with ID selectors (#top input[type=text]), which
   beat any class selector, so the essentials below are marked !important. */
.asf .asf-field input, .asf .asf-field select, .asf .asf-field textarea {
  display: block !important;
  width: 100% !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  font: inherit !important;
  line-height: 1.5 !important;
  color: var(--asf-text) !important;
  background-color: var(--asf-soft) !important;
  border: 1px solid var(--asf-border) !important;
  border-radius: var(--asf-radius) !important;
  box-shadow: none !important;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.asf .asf-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--asf-muted) 50%), linear-gradient(135deg, var(--asf-muted) 50%, transparent 50%) !important;
  background-size: 6px 6px !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50% !important;
  padding-inline-end: 40px !important;
}
.asf[dir="rtl"] .asf-field select { background-position: 14px 50%, 20px 50% !important; padding-left: 40px !important; padding-right: 14px !important; }
.asf[dir="rtl"] .asf-field input[dir="ltr"] { text-align: right !important; }
.asf .asf-field textarea { min-height: 110px !important; resize: vertical; }
.asf .asf-field input::placeholder, .asf .asf-field textarea::placeholder { color: #9aa5b1; opacity: 1; }
.asf .asf-field input:focus, .asf .asf-field select:focus, .asf .asf-field textarea:focus {
  outline: none !important;
  background-color: #fff !important;
  border-color: var(--asf-accent) !important;
  box-shadow: 0 0 0 3px rgba(11, 94, 168, 0.18) !important;
}
.asf .asf-invalid input, .asf .asf-invalid select, .asf .asf-invalid textarea { border-color: var(--asf-danger) !important; }
.asf-error { margin: 4px 0 0; min-height: 0; color: var(--asf-danger); font-size: 0.85em; }
.asf-error:empty { display: none; }

/* Captcha */
.asf-captcha-box {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 18px 10px 14px;
  font: inherit; color: inherit; cursor: pointer;
  background: var(--asf-soft); border: 1px solid var(--asf-border); border-radius: var(--asf-radius);
}
.asf-captcha-box:focus-visible { outline: 3px solid rgba(11, 94, 168, 0.35); outline-offset: 2px; }
.asf-captcha-check {
  position: relative; width: 26px; height: 26px; flex: 0 0 26px;
  background: #fff; border: 2px solid var(--asf-border); border-radius: 6px;
}
.asf-captcha[data-state="verifying"] .asf-captcha-check {
  border-color: var(--asf-accent); border-top-color: transparent; border-radius: 50%;
  animation: asf-spin 0.8s linear infinite;
}
.asf-captcha[data-state="verified"] .asf-captcha-check { background: var(--asf-ok); border-color: var(--asf-ok); }
.asf-captcha[data-state="verified"] .asf-captcha-check::after {
  content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.asf-captcha[data-state="verified"] .asf-captcha-box { cursor: default; border-color: var(--asf-ok); }
.asf-captcha[data-state="error"] .asf-captcha-check { border-color: var(--asf-danger); }
@keyframes asf-spin { to { transform: rotate(360deg); } }

.asf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.asf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.asf .asf-submit {
  min-height: 52px; padding: 12px 32px;
  font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  background: var(--asf-accent); border: 0; border-radius: var(--asf-radius);
  transition: background 0.15s, transform 0.05s;
  line-height: 1.4; margin: 0; width: auto;
}
.asf .asf-submit:hover { background: var(--asf-accent-dark); color: #fff; }
.asf-submit:active { transform: translateY(1px); }
.asf-submit:disabled { opacity: 0.7; cursor: progress; }
.asf-privacy { margin: 0; color: var(--asf-muted); font-size: 0.85em; }
.asf-form-error { color: var(--asf-danger); }
.asf-form-error:empty { display: none; }

.asf-success { text-align: center; }
.asf-success:focus { outline: none; }
.asf-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin-bottom: 12px;
  font-size: 32px; color: #fff; background: var(--asf-ok); border-radius: 50%;
}
.asf-success-text { margin: 0 0 6px; font-size: 1.15em; font-weight: 600; }
.asf-success-ref { margin: 0; color: var(--asf-muted); direction: ltr; unicode-bidi: plaintext; }
.asf-success-ref:empty { display: none; }

/* Map ([alsaffar_map]) */
.asf-map { position: relative; width: 100%; height: var(--asf-map-h, 420px); line-height: 0; background: #e8eaed; }
.asf-map iframe { display: block; width: 100%; height: 100%; margin: 0; border: 0; }
.asf-map .asf-map-link {
  position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px; line-height: 1.4; font-weight: 700; white-space: nowrap;
  color: #fff; background: var(--asf-accent, #0b5ea8); border-radius: 999px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.28); text-decoration: none;
}
.asf-map .asf-map-link:hover, .asf-map .asf-map-link:focus { color: #fff; background: var(--asf-accent-dark, #084a85); text-decoration: none; }
@media (max-width: 640px) { .asf-map { height: min(var(--asf-map-h, 420px), 340px); } }
