/* Public form pages: Consultation, CallForIslam, Voulnteering (landing), VolunteeringForm.
   Tokens and shared primitives (page-head, empty-state, result-modal) live in theme.css. */

/* ==========================================================================
   Page frame
   ========================================================================== */
.request-page,
.volunteer-page { background: transparent; }
#main-content-container > .request-page { max-width: 820px; }

.request-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 36px;
  margin-bottom: .5rem;
  color: var(--h-muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.request-back:hover { color: var(--h-accent); }

/* ==========================================================================
   Form card, sections and field grid
   ========================================================================== */
.request-card {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  background: var(--h-surface);
}
.request-form { counter-reset: request-section; }

.request-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.request-section + .request-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--h-line);
}
.request-section-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  float: none;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  color: var(--h-ink);
  font-family: var(--h-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
}
.request-section-title::before {
  counter-increment: request-section;
  content: counter(request-section);
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--h-gold-soft);
  color: var(--h-gold);
  font-family: var(--h-font);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
}

.request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  align-items: start;
}
.request-field { min-width: 0; }
.request-field.is-wide { grid-column: 1 / -1; }
.request-field > .form-label { display: block; }
.request-field .validation-message { margin-top: .4rem; }
.request-form .required-mark { margin-inline-start: .15rem; font-weight: 700; }

/* Phone prefix: keep "+966" reading left to right, corners matching the inputs. */
.request-card .input-group-text {
  border-radius: var(--h-radius-sm);
  direction: ltr;
  font-size: .95rem;
}

/* ==========================================================================
   Radio groups as option chips
   ========================================================================== */
.request-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.request-option {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 46px;
  margin: 0;
  padding: .5rem 1rem;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-radius-sm);
  background: var(--h-surface);
  color: var(--h-ink-soft);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.request-option .form-check-input { flex: 0 0 auto; float: none; margin: 0; cursor: pointer; }
.request-option:has(:checked) {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
  color: var(--h-accent-strong);
  font-weight: 600;
}
.request-option:has(:focus-visible) { box-shadow: var(--h-ring); }
.request-option:has(.form-check-input.invalid) { border-color: rgba(168, 53, 42, .45); }
@media (hover: hover) {
  .request-option:hover { border-color: #bdb39d; background: var(--h-surface-soft); }
  .request-option:has(:checked):hover { border-color: var(--h-accent); background: var(--h-accent-tint); }
}

/* ==========================================================================
   Radzen dropdowns inside the form (single and multi-select)
   ========================================================================== */
#main-content-container .request-card .rz-dropdown.form-select {
  --rz-input-value-color: var(--h-ink);
  --rz-input-placeholder-color: var(--h-faint);
  --rz-chip-background-color: var(--h-accent-soft);
  --rz-chip-color: var(--h-accent-strong);
  --rz-chip-border-radius: 999px;
  display: flex;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 46px;
  box-shadow: none;
  cursor: pointer;
}
#main-content-container .request-card .rz-dropdown.form-select:focus-within,
#main-content-container .request-card .rz-dropdown.form-select.rz-dropdown-open {
  border-color: var(--h-accent);
  box-shadow: var(--h-ring);
}
#main-content-container .request-card .rz-dropdown.form-select.rz-state-disabled {
  border-color: var(--h-line);
  background-color: var(--h-surface-soft);
  color: var(--h-muted);
  cursor: not-allowed;
}
.request-card .rz-dropdown-label { line-height: 1.6; }
.request-card .rz-dropdown-chips .rz-chip { font-weight: 600; }

/* ==========================================================================
   Consent row and footer actions
   ========================================================================== */
.request-consent {
  margin-top: 2rem;
  padding: .85rem 1.25rem;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-surface-soft);
}
.request-consent .form-check {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  margin: 0;
  padding: 0;
}
.request-consent .form-check-input { flex: 0 0 auto; float: none; margin: 0; }
.request-consent .form-check-label { color: var(--h-ink); font-weight: 600; cursor: pointer; }
.request-consent .validation-message { margin-top: .25rem; }

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--h-line);
}
.request-consent + .request-actions { margin-top: 1.5rem; }
.request-actions .btn { min-width: 140px; min-height: 46px; }

/* Signed-out state (Consultation) */
.request-locked { padding: 3.5rem 1.5rem; }
.request-locked > i { font-size: 2.5rem; }
.request-locked p { max-width: 42ch; margin: 0 auto 1.5rem; }
.request-locked-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.request-locked .request-locked-actions i { display: inline; margin: 0; color: inherit; font-size: 1em; }

/* ==========================================================================
   Volunteering landing
   ========================================================================== */
.volunteer-intro {
  margin-bottom: 2rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 3px solid var(--h-gold-soft);
}
.volunteer-intro-text {
  max-width: 72ch;
  margin: 0;
  color: var(--h-ink-soft);
  font-size: 1.08rem;
  line-height: 2;
}

.volunteer-terms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.volunteer-terms-card {
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  background: var(--h-surface);
}
.volunteer-terms-card .section-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--h-line);
}
.volunteer-terms-card .section-title i {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--h-radius-sm);
  background: var(--h-accent-tint);
  color: var(--h-accent);
  font-size: 1.1rem;
}
.volunteer-terms-list { margin: 0; padding: 0; list-style: none; counter-reset: volunteer-term; }
.volunteer-terms-list li {
  position: relative;
  padding-inline-start: 2.25rem;
  color: var(--h-ink-soft);
  line-height: 1.85;
}
.volunteer-terms-list li + li { margin-top: .85rem; }
.volunteer-terms-list li::before {
  counter-increment: volunteer-term;
  content: counter(volunteer-term);
  position: absolute;
  top: .2rem;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--h-gold-soft);
  color: var(--h-gold);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.volunteer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 2rem;
  padding: 1.5rem clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--h-accent-soft);
  border-radius: var(--h-radius-lg);
  background: var(--h-accent-tint);
}
.volunteer-cta-text {
  margin: 0;
  color: var(--h-ink);
  font-family: var(--h-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
}
.volunteer-page .btn-primary i { transition: transform .16s ease; }
@media (hover: hover) {
  .volunteer-page .btn-primary:hover i { transform: translateX(-3px); }
}

@media (max-width: 991.98px) {
  .volunteer-terms { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Phone
   ========================================================================== */
@media (max-width: 767px) {
  .request-card { padding: 18px; border-radius: var(--app-radius, 16px); }
  .request-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .request-section + .request-section { margin-top: 1.5rem; padding-top: 1.5rem; }
  .request-section-title { margin-bottom: 1rem; font-size: 1.1rem; }

  .request-option { flex: 1 1 auto; min-height: 48px; }
  .request-option .form-check-input { margin: 0; }

  /* mobile-app.css rounds every .form-control; re-join the phone prefix. */
  #main-content-container .request-card .input-group > .form-control {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
  }

  .request-consent { margin-top: 1.5rem; padding: .75rem 1rem; }
  .request-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }
  .request-actions .btn { width: 100%; min-width: 0; }

  .request-locked { padding: 2.5rem 1.25rem; }
  .request-locked-actions { flex-direction: column; }
  .request-locked-actions .btn { width: 100%; }

  .volunteer-page .page-actions,
  .volunteer-page .page-actions .btn { width: 100%; }
  .volunteer-intro { margin-bottom: 1.5rem; padding-inline-start: 1rem; }
  #main-content-container .volunteer-intro-text { font-size: 1rem; line-height: 1.95; }
  .volunteer-terms { gap: 1rem; }
  .volunteer-terms-card { padding: 18px; border-radius: var(--app-radius, 16px); }
  .volunteer-terms-card .section-title { font-size: 1.15rem; }
  .volunteer-cta { flex-direction: column; align-items: stretch; margin-top: 1.5rem; padding: 18px; }
  .volunteer-cta-text { font-size: 1.05rem; }
  .volunteer-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .request-option,
  .volunteer-page .btn-primary i { transition: none; }
  .volunteer-page .btn-primary:hover i { transform: none; }
}
