/* ──────────────────────────────────────────────────────────────────────
   RealtyPromoo — Q&A Section Styles
   Matches site palette: navy #0a1a3a, gold #c9a84c, neutrals.
   ────────────────────────────────────────────────────────────────────── */

/* CRITICAL: many Q&A elements use display:flex/block via class rules.
   These would override the browser's default [hidden]{display:none} (which is
   a UA-stylesheet rule, lower specificity). Without this override, modals and
   form blocks marked `hidden` in HTML would render on page load — covering
   the page content. Keep this rule at the top so it always loads first. */
.rp-qa-section [hidden],
.rp-qa-modal[hidden],
.rp-qa-tc-modal[hidden] {
  display: none !important;
}

.rp-qa-section {
  margin: 32px 0;
  padding: 24px 22px;
  background: #fff;
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 8px;
  font-family: inherit;
  color: var(--color-text, #252525);
}

.rp-qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border, #e8e8e8);
}

.rp-qa-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary, #0a1a3a);
}

.rp-qa-count {
  color: var(--color-text-secondary, #686868);
  font-weight: 400;
  margin-left: 4px;
}

.rp-qa-expand {
  background: transparent;
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--color-text-secondary, #686868);
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.rp-qa-expand:hover {
  background: var(--color-bg-light, #f7f7f7);
  color: var(--color-primary, #0a1a3a);
}

.rp-qa-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--color-text-secondary, #686868);
  font-size: 0.95rem;
}

.rp-qa-container {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.rp-qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rp-qa-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border, #e8e8e8);
}

.rp-qa-item:last-child {
  border-bottom: none;
}

.rp-qa-q {
  font-weight: 600;
  color: var(--color-primary, #0a1a3a);
  line-height: 1.5;
  margin-bottom: 4px;
}

.rp-qa-meta {
  font-size: 0.82rem;
  color: var(--color-text-secondary, #686868);
  margin-bottom: 8px;
}

.rp-qa-a {
  color: var(--color-text, #252525);
  line-height: 1.6;
  font-size: 0.95rem;
}

.rp-qa-a p {
  margin: 0 0 10px;
}

.rp-qa-a p:last-child {
  margin-bottom: 0;
}

.rp-qa-a ul, .rp-qa-a ol {
  margin: 8px 0;
  padding-left: 22px;
}

.rp-qa-label {
  display: inline-block;
  background: var(--color-primary, #0a1a3a);
  color: #fff;
  width: 22px;
  height: 22px;
  text-align: center;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 22px;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}

.rp-qa-label-a {
  background: var(--color-accent, #c9a84c);
}

.rp-qa-cta {
  margin-top: 18px;
  text-align: center;
}

.rp-qa-ask-btn {
  background: var(--color-primary, #0a1a3a);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  letter-spacing: 0.2px;
}

.rp-qa-ask-btn:hover {
  opacity: 0.92;
}

.rp-qa-ask-btn:active {
  transform: translateY(1px);
}

/* ── Form ──────────────────────────────────────────────────────────── */
.rp-qa-form-wrap {
  margin-top: 22px;
  padding: 22px;
  background: var(--color-bg-light, #f7f7f7);
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 8px;
}

.rp-qaf-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  color: var(--color-primary, #0a1a3a);
  font-weight: 600;
}

.rp-qaf-sub {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--color-text-secondary, #686868);
}

.rp-qaf-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-qaf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.rp-qaf-label {
  display: block;
}

.rp-qaf-label > span:first-child {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary, #0a1a3a);
  margin-bottom: 5px;
}

.rp-qaf-label em {
  color: #c0392b;
  font-style: normal;
  margin-left: 2px;
}

.rp-qaf-name,
.rp-qaf-email,
.rp-qaf-phone,
.rp-qaf-otp,
.rp-qaf-question {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #d0d6de;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text, #252525);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.rp-qaf-name:focus,
.rp-qaf-email:focus,
.rp-qaf-phone:focus,
.rp-qaf-otp:focus,
.rp-qaf-question:focus {
  outline: none;
  border-color: var(--color-primary, #0a1a3a);
  box-shadow: 0 0 0 2px rgba(10, 26, 58, 0.08);
}

.rp-qaf-phone-row,
.rp-qaf-otp-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.rp-qaf-cc {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #d0d6de;
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--color-text-secondary, #686868);
}

.rp-qaf-otp-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-qaf-send-otp,
.rp-qaf-verify-otp {
  background: var(--color-primary, #0a1a3a);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.rp-qaf-send-otp:disabled,
.rp-qaf-verify-otp:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rp-qaf-send-otp:hover:not(:disabled),
.rp-qaf-verify-otp:hover:not(:disabled) {
  opacity: 0.9;
}

.rp-qaf-otp-cooldown {
  font-size: 0.85rem;
  color: var(--color-text-secondary, #686868);
}

.rp-qaf-otp-status {
  padding: 10px 12px;
  font-size: 0.88rem;
  background: #e8f4ec;
  border: 1px solid #b8d8c4;
  color: #1a5b35;
  border-radius: 6px;
}

.rp-qaf-otp-status.is-error {
  background: #fdecea;
  border-color: #e6b4b0;
  color: #8b1f1a;
}

.rp-qaf-verified {
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a5b35;
  background: #e8f4ec;
  border-radius: 6px;
  border: 1px solid #b8d8c4;
}

.rp-qaf-charcount {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary, #686868);
  margin-top: 4px;
  text-align: right;
}

.rp-qaf-charcount.is-near-limit {
  color: #c9a84c;
}

.rp-qaf-charcount.is-over {
  color: #c0392b;
}

.rp-qaf-charcount.is-too-short {
  color: #c0392b;
  font-weight: 500;
}

.rp-qaf-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--color-text, #252525);
  cursor: pointer;
  line-height: 1.45;
}

.rp-qaf-consent input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.rp-qaf-tc-link {
  color: var(--color-primary, #0a1a3a);
  text-decoration: underline;
  font-weight: 600;
}

.rp-qaf-actions {
  display: flex;
  justify-content: center;
}

.rp-qaf-submit {
  background: var(--color-accent, #c9a84c);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 36px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: opacity 0.15s, transform 0.05s;
}

.rp-qaf-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rp-qaf-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.rp-qaf-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.rp-qaf-result {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.rp-qaf-result.is-ok {
  background: #e8f4ec;
  border: 1px solid #b8d8c4;
  color: #1a5b35;
}

.rp-qaf-result.is-soft {
  background: #fef6e7;
  border: 1px solid #ecd4a4;
  color: #7a5b00;
}

.rp-qaf-result.is-hard {
  background: #fdecea;
  border: 1px solid #e6b4b0;
  color: #8b1f1a;
}

.rp-qaf-result-answer {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #b8d8c4;
}

.rp-qaf-result-answer p {
  margin: 0 0 8px;
}
.rp-qaf-result-answer p:last-child {
  margin-bottom: 0;
}

/* ── Fullscreen modal (Q&A list) ───────────────────────────────────── */
.rp-qa-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rp-qa-modal-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 22px;
  box-sizing: border-box;
}

.rp-qa-modal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border, #e8e8e8);
}

.rp-qa-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-primary, #0a1a3a);
  flex: 1;
}

.rp-qa-modal-back {
  background: transparent;
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-primary, #0a1a3a);
  font-weight: 600;
}

.rp-qa-modal-back:hover {
  background: var(--color-bg-light, #f7f7f7);
}

.rp-qa-modal-controls {
  display: flex;
  gap: 10px;
  flex-basis: 100%;
}

.rp-qa-modal-filter {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d0d6de;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

.rp-qa-modal-sort {
  padding: 8px 10px;
  border: 1px solid #d0d6de;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  font-family: inherit;
}

.rp-qa-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 24px;
}

.rp-qa-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── T&C modal ─────────────────────────────────────────────────────── */
.rp-qa-tc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}

.rp-qa-tc-modal-inner {
  background: #fff;
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.rp-qa-tc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border, #e8e8e8);
}

.rp-qa-tc-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-primary, #0a1a3a);
}

.rp-qa-tc-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-text-secondary, #686868);
  line-height: 1;
  padding: 0 4px;
}

.rp-qa-tc-close:hover {
  color: var(--color-primary, #0a1a3a);
}

.rp-qa-tc-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--color-text, #252525);
}

.rp-qa-tc-modal-body h4 {
  margin: 18px 0 6px;
  font-size: 0.98rem;
  color: var(--color-primary, #0a1a3a);
}

.rp-qa-tc-modal-body h4:first-child {
  margin-top: 0;
}

.rp-qa-tc-modal-body ul {
  margin: 6px 0 12px;
  padding-left: 20px;
}

.rp-qa-tc-modal-body li {
  margin-bottom: 4px;
}

.rp-qa-tc-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--color-border, #e8e8e8);
  display: flex;
  justify-content: flex-end;
}

.rp-qa-tc-agree {
  background: var(--color-accent, #c9a84c);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.rp-qa-tc-agree:hover {
  opacity: 0.9;
}

/* ── Mobile responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rp-qa-section {
    padding: 18px 14px;
    margin: 24px 0;
  }
  .rp-qa-header h3 {
    font-size: 1.02rem;
  }
  .rp-qa-container {
    max-height: 500px;
  }
  .rp-qa-form-wrap {
    padding: 16px;
  }
  .rp-qaf-otp-block {
    flex-wrap: wrap;
  }
  .rp-qaf-send-otp,
  .rp-qaf-verify-otp,
  .rp-qaf-submit {
    width: 100%;
  }
  .rp-qaf-actions {
    width: 100%;
  }
  .rp-qa-modal-inner {
    padding: 0 14px;
  }
  .rp-qa-tc-modal-inner {
    max-height: 92vh;
  }
}

/* Body lock when modal is open (added by JS) */
body.rp-qa-modal-open {
  overflow: hidden;
}
