/* ═══════════════════════════════════════════
   HOMEPAGE REQUEST CARDS — component-only CSS
   The "ابدأ طلبك" box (GlobalDatabase ProjectRequestCards) and its modal,
   whose form is the HAForms variable ProjectRequest.Form (pinlist theme).
   Colours come from the site: --LogoColor2 (pink) and the turquoise
   --primary-bg-color; icons are Font Awesome 7 Pro duotone in both.
═══════════════════════════════════════════ */

/* scoped design tokens */
.op-req-box,
.op-req-modal {
  --op-pink: var(--LogoColor2, #be1b74);
  --op-pink-soft: #fbeef5;
  --op-teal: var(--primary-bg-color, #209eb8);
  --op-teal-dark: #16829a;
  --op-teal-soft: #eaf7fa;
  --op-ink: #1d2b3a;
  --op-muted: #66708a;
  --op-line: #dfe4ec;
  --op-soft: #f6f8fb;
  --op-bad: #d14343;
}
.op-req-box .fa-duotone,
.op-req-modal .fa-duotone {
  --fa-primary-color: var(--op-pink);
  --fa-secondary-color: var(--op-teal);
  --fa-secondary-opacity: .55;
}

/* ── The box beside the quick services ── */
.op-req-box { position: relative; }
.op-req-box::before {
  content: "";
  position: absolute;
  inset: 0 20px auto;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--op-teal), var(--op-pink));
}
.op-req-box .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
}
/* Title and line on one line; a narrow column wraps the line under the title. */
.op-req-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin-bottom: 14px;
}
.op-req-title {
  margin: 0;
  color: var(--op-ink);
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}
.op-req-lead {
  margin: 0;
  color: var(--op-muted);
  font-size: .8rem;
}

/* ── Cards: 2 × 2, equal width and height ── */
.op-req-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.op-req-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 96px;
  padding: 12px 6px;
  border: 1px solid #e8ebf3;
  border-radius: 8px;
  background-color: #fff;
  color: var(--op-ink);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.op-req-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--op-pink-soft), var(--op-teal-soft));
  font-size: 1.2rem;
  line-height: 1;
}
.op-req-card:hover {
  border-color: var(--op-pink);
  background-color: #fffafc;
  box-shadow: 0 6px 16px rgba(190, 27, 116, .1);
}
.op-req-card:focus-visible {
  outline: 2px solid var(--op-pink);
  outline-offset: 2px;
}
/* An odd last card (the fifth) spans the row, its icon beside its name. */
.op-req-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 56px;
  padding: 8px 12px;
}

/* ── The modal: card, accent strip, soft lights ── */
.op-req-modal .modal-dialog {
  /* The theme fixes .modal-dialog at 500px wide. */
  width: calc(100% - 1rem);
  max-width: 600px;
}
.op-req-modal .modal-content {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(14, 34, 56, .28);
}
.op-req-modal .modal-content::before {
  content: "";
  position: absolute;
  inset: 0 28px auto;
  z-index: 2;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--op-teal), var(--op-pink));
}
body:has(#opReqModal.show) .modal-backdrop.show {
  opacity: 1;
  background-color: rgba(13, 31, 51, .55);
  backdrop-filter: blur(3px);
}

/* Header: the request's icon, its title and one line, the close button. */
.op-req-modal .op-req-head {
  position: relative;
  align-items: flex-start;
  gap: 14px;
  padding: 26px 24px 18px;
  border-bottom: 1px solid #eef1f6;
  background:
    radial-gradient(280px 170px at 0 0, rgba(190, 27, 116, .08), transparent 70%),
    radial-gradient(320px 190px at 100% 0, rgba(32, 158, 184, .1), transparent 70%),
    #fff;
}
.op-req-modal .op-req-head::after {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 22px;
  width: 70px;
  height: 30px;
  background-image: radial-gradient(rgba(32, 158, 184, .35) 1.2px, transparent 1.5px);
  background-size: 10px 10px;
  pointer-events: none;
}
.op-req-head-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--op-pink-soft), var(--op-teal-soft));
  box-shadow: inset 0 0 0 1px rgba(190, 27, 116, .12);
  font-size: 1.45rem;
}
.op-req-head-text {
  flex: 1;
  min-width: 0;
}
.op-req-modal .modal-title {
  margin: 2px 0;
  color: var(--op-ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
}
.op-req-head-lead {
  margin: 0;
  color: var(--op-muted);
  font-size: .88rem;
  line-height: 1.7;
}
.op-req-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--op-soft);
  color: var(--op-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.op-req-close .fa-duotone {
  --fa-primary-color: currentColor;
  --fa-secondary-color: currentColor;
}
.op-req-close:hover {
  background: var(--op-pink-soft);
  color: var(--op-pink);
}
.op-req-close:focus-visible {
  outline: 2px solid var(--op-pink);
  outline-offset: 2px;
}

/* ── The form ── */
.op-req-modal .modal-body { padding: 20px 24px 22px; }
.op-req-modal .op-req-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  color: var(--op-ink);
  font-size: .95rem;
  font-weight: 800;
}
.op-req-modal .op-req-legend::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--op-line));
}
.op-req-modal .op-req-legend i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--op-pink-soft);
  font-size: .95rem;
}
.op-req-modal .op-req-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border: 1px dashed rgba(32, 158, 184, .5);
  border-radius: 12px;
  background: #f2fafc;
  color: #3d5a66;
  font-size: .85rem;
  line-height: 1.7;
}
.op-req-modal .op-req-note i {
  margin-top: 4px;
  font-size: 1rem;
}
.op-req-modal .form-label {
  margin-bottom: 6px;
  color: var(--op-ink);
  font-size: .88rem;
  font-weight: 700;
}
.op-req-modal .form-label .required { color: var(--op-pink) !important; }
.op-req-modal .form-control {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--op-line);
  border-radius: 10px;
  background-color: #fff;
  color: var(--op-ink);
  font-size: .95rem;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.op-req-modal textarea.form-control {
  height: auto;
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.7;
  resize: vertical;
}
.op-req-modal .form-control::placeholder { color: #a3abbb; }
.op-req-modal .form-control:focus {
  border-color: var(--op-teal);
  box-shadow: 0 0 0 3px rgba(32, 158, 184, .16);
}
.op-req-modal .is-invalid { border-color: var(--op-bad) !important; }
/* The theme turns email, tel and number boxes right-to-left; their values read left-to-right. */
.op-req-modal input[dir="ltr"] {
  direction: ltr;
  text-align: right;
}

/* A field's icon (HAForms "icon") and suffix: one rounded box with the input. */
.op-req-modal .input-group {
  flex-wrap: nowrap;
  border-radius: 10px;
  transition: box-shadow .15s ease;
}
.op-req-modal .input-group > * { border-radius: 0 !important; }
.op-req-modal .input-group > :first-child {
  border-top-right-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
}
.op-req-modal .input-group > :last-child {
  border-top-left-radius: 10px !important;
  border-bottom-left-radius: 10px !important;
}
.op-req-modal .input-group-text {
  justify-content: center;
  min-width: 46px;
  border: 1px solid var(--op-line);
  background: var(--op-soft);
  color: var(--op-muted);
  font-size: 1.05rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.op-req-modal .input-group:focus-within { box-shadow: 0 0 0 3px rgba(32, 158, 184, .16); }
.op-req-modal .input-group:focus-within .form-control,
.op-req-modal .input-group:focus-within .input-group-text { border-color: var(--op-teal); }
.op-req-modal .input-group .form-control:focus { box-shadow: none; }
.op-req-modal .input-group:focus-within .input-group-text { background: var(--op-teal-soft); }
/* A field the check refused: red frame and icon box, without Bootstrap's warning icon inside. */
.op-req-modal .form-control.is-invalid {
  padding-right: 14px;
  padding-left: 14px;
  background-image: none;
}
.op-req-modal .hf-invalid .input-group-text {
  border-color: var(--op-bad);
  background: #fdf1f1;
  color: var(--op-bad);
}
.op-req-modal .hf-invalid .input-group:focus-within { box-shadow: 0 0 0 3px rgba(209, 67, 67, .14); }
.op-req-modal .form-text {
  margin-top: 5px;
  color: var(--op-muted);
  font-size: .8rem;
}
.op-req-modal .invalid-feedback {
  margin-top: 5px;
  color: var(--op-bad);
  font-size: .8rem;
  font-weight: 600;
}
.op-req-modal .hf-state {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
}

/* Submit: wide, rounded, turquoise; HAForms disables it and marks .hf-busy while sending. */
.op-req-modal .op-req-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--op-teal), var(--op-teal-dark));
  box-shadow: 0 10px 22px rgba(32, 158, 184, .28);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease;
}
.op-req-modal .op-req-submit:hover,
.op-req-modal .op-req-submit:focus {
  background: linear-gradient(135deg, var(--op-teal), var(--op-teal-dark));
  color: #fff;
}
.op-req-modal .op-req-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(32, 158, 184, .34);
}
.op-req-modal .op-req-submit:focus-visible {
  outline: 3px solid var(--op-pink);
  outline-offset: 2px;
}
.op-req-modal .op-req-submit[disabled] {
  opacity: .75;
  cursor: progress;
  transform: none;
}
.op-req-modal .op-req-submit .fa-duotone {
  --fa-primary-color: #fff;
  --fa-secondary-color: #fff;
  --fa-secondary-opacity: .55;
}
/* Sending: haforms.css turns the label into a spinner; the icon steps aside. */
.op-req-modal .hf-busy .op-req-submit i { display: none; }
.op-req-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--op-muted);
  font-size: .8rem;
  text-align: center;
}
.op-req-modal.op-req-sent .op-req-foot { display: none; }

/* Sent: the engine's note, with a check badge (project-request.js adds it). */
.op-req-modal .hf-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 6px 0;
  padding: 28px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #eef9f3, #fff);
  color: #17603a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
}
.op-req-done-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 96, 58, .16);
  font-size: 2rem;
}
.op-req-modal .op-req-done-icon .fa-duotone {
  --fa-primary-color: #1f9d55;
  --fa-secondary-color: #1f9d55;
  --fa-secondary-opacity: .3;
}

/* ── Narrow screens ── */
@media (max-width: 991.98px) {
  .op-req-box .card-body { padding: 14px; }
  .op-req-card {
    min-height: 88px;
    font-size: .8rem;
  }
  .op-req-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }
}
@media (max-width: 575.98px) {
  .op-req-modal .op-req-head { padding: 22px 16px 14px; }
  .op-req-modal .modal-body { padding: 16px; }
  .op-req-head-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .op-req-card,
  .op-req-close,
  .op-req-modal .form-control,
  .op-req-modal .input-group,
  .op-req-modal .op-req-submit { transition: none; }
}
