/* ==========================================================================
   Prayer Request Page
   Location: assets/css/prayer.css
   Enqueued only on the `template-prayer.php` page template.

   Reference brief asked for a premium, elegant, trustworthy form
   experience — dark navy + metallic gold, soft shadows, 24px rounded
   corners, floating labels. The navy/gold pairing itself is the
   shared --lgm-deep-navy/--lgm-metallic-gold tokens from
   variables.css (aliased below to this file's own --lgm-prayer-*
   names, used throughout everything that isn't the hero banner —
   the hero itself now lives in main.css as the shared
   .lgm-page-header, since History/Contact/Sermons use the exact
   same banner).
   ========================================================================== */

:root {
  /* Aliased to the canonical tokens in variables.css — see that
     file's comment for why. Kept as --lgm-prayer-* names since
     they're used throughout the rest of this file (form panel,
     promise card, etc.), not just the hero (which now lives in
     main.css as .lgm-page-header). */
  --lgm-prayer-navy: var(--lgm-deep-navy);
  --lgm-prayer-navy-light: var(--lgm-deep-navy-light);
  --lgm-prayer-gold: var(--lgm-metallic-gold);
  --lgm-prayer-gold-deep: var(--lgm-metallic-gold-deep);

  /* Muted indigo-blue used only for the Disclaimer & Consent
     statement text, matching a supplied reference design — distinct
     from the rest of the form's plain --lgm-dark-grey body copy on
     purpose, to draw the eye to what's being agreed to. */
  --lgm-prayer-disclaimer-text: #3E4C7A;
}

/* ==========================================================================
   Two-column layout — form left, sidebar right
   ========================================================================== */

.lgm-prayer-layout-section {
  background: var(--lgm-off-white);
  padding-block: var(--lgm-space-2xl);
}

.lgm-prayer-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--lgm-space-xl);
  align-items: start;
}

/* No sidebar (see template-prayer.php) — a single centered column
   reads better than a full-width form stretching edge to edge. */
.lgm-prayer-layout--centered {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
}

/* ==========================================================================
   Form panel
   ========================================================================== */

.lgm-prayer-form-panel {
  background: var(--lgm-white);
  border-radius: var(--lgm-radius-card);
  box-shadow: var(--lgm-shadow-card);
  padding: var(--lgm-space-xl) var(--lgm-space-lg);
}

.lgm-prayer-form-panel h2 {
  margin-bottom: var(--lgm-space-lg);
}

.lgm-prayer-form-section-title {
  display: block;
  margin: var(--lgm-space-lg) 0 var(--lgm-space-md);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--lgm-prayer-gold);
  color: var(--lgm-prayer-navy);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.lgm-prayer-form-section-title:first-child {
  margin-top: 0;
}

.lgm-prayer-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lgm-space-md);
}

.lgm-prayer-form-row--name {
  grid-template-columns: 130px 1fr 1fr;
}

.lgm-required {
  color: var(--lgm-red);
}

/* ---- Static-label fields (selects) ---- */

.lgm-prayer-field {
  margin-bottom: var(--lgm-space-md);
}

.lgm-prayer-field > label {
  display: block;
  color: var(--lgm-heading-color);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.lgm-prayer-field select,
.lgm-prayer-field .lgm-phone-code {
  width: 100%;
  background: var(--lgm-off-white);
  border: 1.5px solid var(--lgm-border);
  border-radius: var(--lgm-radius-md);
  color: var(--lgm-dark-grey);
  padding: 14px 16px;
  font-family: var(--lgm-font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--lgm-transition-fast), box-shadow var(--lgm-transition-fast);
}

/* ---- Floating-label fields (text/email/tel/textarea) ---- */

.lgm-prayer-field--float {
  position: relative;
}

.lgm-prayer-field--float input,
.lgm-prayer-field--float textarea {
  width: 100%;
  background: var(--lgm-off-white);
  border: 1.5px solid var(--lgm-border);
  border-radius: var(--lgm-radius-md);
  color: var(--lgm-dark-grey);
  padding: 22px 16px 10px;
  font-family: var(--lgm-font-body);
  font-size: 1rem;
  transition: border-color var(--lgm-transition-fast), box-shadow var(--lgm-transition-fast);
}

.lgm-prayer-field--float textarea {
  padding-top: 26px;
  min-height: 180px;
  resize: vertical;
}

.lgm-prayer-field--float label {
  position: absolute;
  left: 16px;
  top: 17px;
  color: var(--lgm-medium-grey);
  font-size: 1rem;
  pointer-events: none;
  transition: top var(--lgm-transition-fast), font-size var(--lgm-transition-fast), color var(--lgm-transition-fast);
}

.lgm-prayer-field--float input:focus + label,
.lgm-prayer-field--float input:not(:placeholder-shown) + label,
.lgm-prayer-field--float textarea:focus + label,
.lgm-prayer-field--float textarea:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lgm-prayer-navy);
}

/* Input focus glow — premium, soft, on brand (see the project's global
   "Input Focus Glow" animation requirement). */
.lgm-prayer-field input:focus-visible,
.lgm-prayer-field textarea:focus-visible,
.lgm-prayer-field select:focus-visible,
.lgm-prayer-field .lgm-phone-code:focus-visible {
  outline: none;
  border-color: var(--lgm-prayer-gold);
  box-shadow: 0 0 0 4px rgba(200, 169, 81, 0.18);
}

.lgm-prayer-phone-group {
  display: flex;
  gap: 10px;
}

.lgm-prayer-phone-group .lgm-phone-code {
  flex: 0 0 210px;
}

.lgm-prayer-phone-input {
  flex: 1;
  background: var(--lgm-off-white);
  border: 1.5px solid var(--lgm-border);
  border-radius: var(--lgm-radius-md);
  color: var(--lgm-dark-grey);
  padding: 14px 16px;
  font-family: var(--lgm-font-body);
  font-size: 1rem;
  transition: border-color var(--lgm-transition-fast), box-shadow var(--lgm-transition-fast);
}

.lgm-prayer-char-count {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--lgm-medium-grey);
}

.lgm-prayer-char-count.is-near-limit {
  color: var(--lgm-red);
  font-weight: 600;
}

/* ---- Field-level errors ---- */

.lgm-prayer-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--lgm-red);
  font-size: 0.85rem;
}

.lgm-prayer-error::before {
  content: "\26A0";
  font-size: 0.9rem;
}

.lgm-prayer-field.has-error input,
.lgm-prayer-field.has-error textarea,
.lgm-prayer-field.has-error select,
.lgm-prayer-field.has-error .lgm-phone-code {
  border-color: var(--lgm-red);
}

.lgm-prayer-field.has-error .lgm-prayer-error {
  display: flex;
}

/* ---- Disclaimer & Consent (restyled to match a supplied reference:
        a plain, larger heading with a thin full-width underline, a
        statement in a distinct accent color, then Yes/No radio
        buttons for the one required consent — permission for the
        Prayer Team to pray for the request. The optional preference
        checkboxes (confidential / contact me / subscribe) that used
        to sit below this were removed on request; the field data
        they used to set (confidential, may_contact, subscribe) still
        exists in the database schema and just defaults to "No" now
        that nothing in the form sets it — see inc/prayer-form.php /
        inc/prayer-messages.php if those are wanted back later.) ---- */

.lgm-prayer-disclaimer {
  margin-bottom: var(--lgm-space-lg);
}

.lgm-prayer-disclaimer-heading {
  padding-bottom: var(--lgm-space-sm);
  margin-bottom: var(--lgm-space-md);
  border-bottom: 1px solid var(--lgm-border);
  color: var(--lgm-heading-color);
  font-size: 1.15rem;
  font-weight: 700;
}

.lgm-prayer-disclaimer-statement {
  margin: 0 0 var(--lgm-space-sm);
  color: var(--lgm-prayer-disclaimer-text, #3E4C7A);
  font-size: 0.98rem;
  line-height: 1.6;
}

.lgm-prayer-radio-group {
  display: flex;
  gap: var(--lgm-space-lg);
  margin-bottom: var(--lgm-space-lg);
  padding: 4px 10px;
  border-radius: var(--lgm-radius-sm);
  transition: background-color var(--lgm-transition-fast);
}

.lgm-prayer-radio-group.has-error {
  background: rgba(198, 40, 40, 0.06);
}

.lgm-prayer-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.lgm-prayer-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--lgm-prayer-navy);
  cursor: pointer;
}

.lgm-prayer-radio span {
  color: var(--lgm-prayer-disclaimer-text, #3E4C7A);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---- Status + submit ---- */

.lgm-prayer-form-status {
  min-height: 0;
  margin-bottom: var(--lgm-space-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.lgm-prayer-form-status.is-success {
  color: #1B7A3D;
}

.lgm-prayer-form-status.is-error {
  color: var(--lgm-red);
}

.lgm-prayer-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  border-radius: var(--lgm-radius-pill);
  border: 2px solid transparent;
  background: var(--lgm-prayer-navy);
  color: var(--lgm-white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 15px 40px rgba(11, 31, 58, 0.25);
  transition: transform var(--lgm-transition-fast), box-shadow var(--lgm-transition-fast), background-color var(--lgm-transition-fast);
}

.lgm-prayer-submit:hover {
  background: var(--lgm-prayer-navy-light);
  transform: translateY(-3px) scale(1.01);
}

.lgm-prayer-submit:active {
  transform: translateY(0) scale(0.98);
}

.lgm-prayer-submit[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Honeypot — kept in the DOM/tab order out of view, not display:none,
   so it still catches naive bots while staying invisible to sighted
   users and skipped correctly by screen readers via aria-hidden. */
.lgm-prayer-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.lgm-prayer-faq-section {
  background: var(--lgm-off-white);
  padding-block: var(--lgm-space-2xl);
}

.lgm-prayer-faq-list {
  max-width: 760px;
  margin-inline: auto;
}

.lgm-prayer-faq-item {
  background: var(--lgm-white);
  border-radius: var(--lgm-radius-md);
  box-shadow: var(--lgm-shadow-sm);
  margin-bottom: var(--lgm-space-sm);
  overflow: hidden;
}

.lgm-prayer-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lgm-space-md);
  width: 100%;
  padding: var(--lgm-space-md) var(--lgm-space-lg);
  background: transparent;
  border: none;
  text-align: left;
  color: var(--lgm-prayer-navy);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.lgm-prayer-faq-icon {
  flex: none;
  transition: transform var(--lgm-transition-fast);
  color: var(--lgm-prayer-gold);
}

.lgm-prayer-faq-item.is-open .lgm-prayer-faq-icon {
  transform: rotate(45deg);
}

.lgm-prayer-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--lgm-transition-med);
}

.lgm-prayer-faq-answer p {
  margin: 0;
  padding: 0 var(--lgm-space-lg) var(--lgm-space-md);
  color: var(--lgm-dark-grey);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ==========================================================================
   Fade/slide-up entrance (respects prefers-reduced-motion via the
   global rule already in main.css)
   ========================================================================== */

@keyframes lgmPrayerFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lgm-prayer-form-panel {
  animation: lgmPrayerFadeUp 0.5s ease-out both;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991px) {
  .lgm-prayer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .lgm-prayer-form-panel {
    padding: var(--lgm-space-lg) var(--lgm-space-md);
  }

  .lgm-prayer-form-row,
  .lgm-prayer-form-row--name {
    grid-template-columns: 1fr;
  }

  .lgm-prayer-phone-group {
    flex-direction: column;
  }

  .lgm-prayer-phone-group .lgm-phone-code {
    flex: 1;
  }

  .lgm-prayer-submit {
    width: auto;
    padding: 12px 28px;
    font-size: 0.9rem;
    margin-inline: auto;
  }
}
