/*
 * Patch 014 — Batch 00D: conversion/form system foundation.
 *
 * The legacy compatibility skin intentionally styles the RCL form controls,
 * not the historical outer page wrappers. Wrapper/placement migration is done
 * per cluster so guide/service context is never changed blindly.
 */

:root {
  --rr-conv-navy: #0f2340;
  --rr-conv-navy-2: #132e51;
  --rr-conv-gold: #d2ad45;
  --rr-conv-gold-hover: #e2c66f;
  --rr-conv-cream: #f7f2e8;
  --rr-conv-white: #fff;
  --rr-conv-text: #506173;
  --rr-conv-line: rgba(15,35,64,.14);
  --rr-conv-radius: 14px;
  --rr-conv-shadow: 0 18px 45px rgba(15,35,64,.10);
}

/* ---------- Legacy RCL host: one control language everywhere ---------- */
.rr-p014-rcl,
[data-rcl-form] {
  width: 100%;
  min-width: 0;
  color: var(--rr-conv-navy);
  font-family: var(--r-font-body, "Outfit", system-ui, sans-serif);
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(label,.rcl-label) {
  display: block;
  margin: 0 0 .38rem;
  color: var(--rr-conv-navy) !important;
  font-size: .79rem !important;
  font-weight: 750 !important;
  line-height: 1.35;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="url"], input[type="date"], select, textarea
) {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
  padding: .72rem .78rem !important;
  background: #fff !important;
  color: var(--rr-conv-navy) !important;
  -webkit-text-fill-color: var(--rr-conv-navy) !important;
  border: 1px solid rgba(15,35,64,.20) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font: inherit !important;
  line-height: 1.35 !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

:where(.rr-p014-rcl,[data-rcl-form]) textarea {
  min-height: 118px !important;
  resize: vertical;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="url"], input[type="date"], select, textarea
):focus {
  outline: 0 !important;
  border-color: var(--rr-conv-gold) !important;
  box-shadow: 0 0 0 3px rgba(210,173,69,.17) !important;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(input,textarea)::placeholder {
  color: #83909c !important;
  opacity: 1;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(
  button[type="submit"], input[type="submit"], .rcl-submit
) {
  min-height: 46px !important;
  padding: .78rem 1rem !important;
  background: var(--rr-conv-gold) !important;
  color: var(--rr-conv-navy) !important;
  -webkit-text-fill-color: var(--rr-conv-navy) !important;
  border: 1px solid var(--rr-conv-gold) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font: inherit !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(
  button[type="submit"], input[type="submit"], .rcl-submit
):hover {
  background: var(--rr-conv-gold-hover) !important;
  border-color: var(--rr-conv-gold-hover) !important;
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(
  button[type="submit"], input[type="submit"], .rcl-submit
):active { transform: translateY(1px); }

:where(.rr-p014-rcl,[data-rcl-form]) :where(input[type="checkbox"],input[type="radio"]) {
  accent-color: var(--rr-conv-gold);
}

:where(.rr-p014-rcl,[data-rcl-form]) :where(.error,.rcl-error,[aria-invalid="true"] + span) {
  color: #a43434 !important;
  font-size: .78rem;
}

/* ---------- Canonical A/B/C conversion components ---------- */
.rr-conversion {
  box-sizing: border-box;
  width: min(100%, 1180px);
  margin: clamp(2rem, 5vw, 4rem) auto;
  border-radius: var(--rr-conv-radius);
  overflow: hidden;
}

.rr-conversion *, .rr-conversion *::before, .rr-conversion *::after { box-sizing: border-box; }

.rr-conversion__eyebrow {
  display: inline-block;
  margin: 0 0 .55rem;
  color: var(--rr-conv-gold);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .095em;
  line-height: 1.3;
  text-transform: uppercase;
}

.rr-conversion__copy h2 {
  margin: 0 0 .75rem;
  font-family: var(--r-font-heading, "Syne", var(--r-font-body, sans-serif));
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
  line-height: 1.12;
}

.rr-conversion__copy > p {
  max-width: 700px;
  margin: 0;
  font-size: .98rem;
  line-height: 1.68;
}

.rr-conversion__trust {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin: 1.05rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .78rem;
  font-weight: 650;
}

.rr-conversion__trust li::before {
  content: "✓";
  margin-right: .35rem;
  color: var(--rr-conv-gold);
  font-weight: 900;
}

/* A — full service form */
.rr-conversion--form {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(360px,.82fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.4rem, 4vw, 3rem);
  background: var(--rr-conv-navy);
  color: #fff;
  box-shadow: 0 20px 52px rgba(15,35,64,.14);
}

.rr-conversion--form .rr-conversion__copy > p,
.rr-conversion--form .rr-conversion__trust { color: rgba(255,255,255,.78); }

.rr-conversion__form-card {
  min-width: 0;
  background: #fff;
  color: var(--rr-conv-navy);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.16);
}

.rr-conversion__form-head {
  padding: 1rem 1.15rem .9rem;
  background: var(--rr-conv-cream);
  border-bottom: 1px solid var(--rr-conv-line);
}

.rr-conversion__form-head h3 { margin: 0 0 .25rem; color: var(--rr-conv-navy); font-size: 1rem; }
.rr-conversion__form-head p { margin: 0; color: var(--rr-conv-text); font-size: .8rem; }
.rr-conversion__form-body { padding: 1.1rem; }

/* B — compact route from guide/tool to the correct service owner */
.rr-conversion--service {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 1.4rem;
  align-items: center;
  padding: clamp(1.2rem, 3vw, 1.75rem);
  background: var(--rr-conv-cream);
  color: var(--rr-conv-navy);
  border: 1px solid rgba(210,173,69,.34);
}

.rr-conversion--service .rr-conversion__copy h2 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.rr-conversion--service .rr-conversion__copy > p { color: var(--rr-conv-text); }
.rr-conversion--service .rr-conversion__trust { display: none; }

/* C — ambiguous/strategic need -> consultation */
.rr-conversion--consultation {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.3rem, 3vw, 2rem);
  background: linear-gradient(135deg, var(--rr-conv-navy), var(--rr-conv-navy-2));
  color: #fff;
  border: 1px solid rgba(210,173,69,.28);
  box-shadow: var(--rr-conv-shadow);
}

.rr-conversion--consultation .rr-conversion__copy > p,
.rr-conversion--consultation .rr-conversion__trust { color: rgba(255,255,255,.78); }

.rr-conversion__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .8rem 1.05rem;
  background: var(--rr-conv-gold);
  color: var(--rr-conv-navy) !important;
  border: 1px solid var(--rr-conv-gold);
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.rr-conversion__button:hover,
.rr-conversion__button:focus-visible {
  background: var(--rr-conv-gold-hover);
  border-color: var(--rr-conv-gold-hover);
  color: var(--rr-conv-navy) !important;
}

@media (max-width: 820px) {
  .rr-conversion--form,
  .rr-conversion--service,
  .rr-conversion--consultation {
    grid-template-columns: 1fr;
  }
  .rr-conversion__action { justify-self: start; }
}

@media (max-width: 560px) {
  .rr-conversion { border-radius: 11px; }
  .rr-conversion--form,
  .rr-conversion--service,
  .rr-conversion--consultation { padding: 1rem; }
  .rr-conversion__button { width: 100%; white-space: normal; text-align: center; }
  .rr-conversion__trust { flex-direction: column; gap: .4rem; }
}


/* ---------- 00D.2 visual isolation hotfix ---------- */
/* Old page-family CSS can set dark H2 colors inside navy sections.
   Canonical conversion components must own their heading contrast. */
.rr-conversion--form .rr-conversion__copy h2,
.rr-conversion--consultation .rr-conversion__copy h2 {
  color: #fff !important;
}

.rr-conversion--service .rr-conversion__copy h2 {
  color: var(--rr-conv-navy) !important;
}

/* Supplemental cluster/hub note directly below a canonical card in a legacy
   dark section must remain readable. */
.sec.dk > .rr-conversion + p {
  color: rgba(255,255,255,.76) !important;
}

.sec.dk > .rr-conversion + p a {
  color: var(--rr-conv-gold) !important;
  text-decoration-color: rgba(210,173,69,.55);
}


/* ---------- 00D.3 RCL dark-form microcopy contrast ---------- */
/*
 * Scope is deliberately narrow:
 *   1) RCL shortcode mode="card" — standard dark navy form body.
 *   2) Canonical Type A conversion forms — RCL embedded inside the navy form body.
 *
 * Embedded RCL forms elsewhere are NOT globally forced to light text because many
 * legacy page families place them on light/cream surfaces.
 */
:where(.rcl-card,[data-rcl-mode="card"]) form :where(label,.rcl-label),
.rr-conversion--form .rr-conversion__form-body form :where(label,.rcl-label) {
  color: #e7edf3 !important;
  -webkit-text-fill-color: #e7edf3 !important;
  font-size: .82rem !important;
  font-weight: 750 !important;
  opacity: 1 !important;
}

/* Small explanatory/privacy copy inside the dark form body. */
:where(.rcl-card,[data-rcl-mode="card"]) form :where(
  .rcl-privacy,.rcl-help,.rcl-helper,.rcl-note,.rcl-description,
  .form-privacy,.form-help,.form-note,.privacy,.description
),
.rr-conversion--form .rr-conversion__form-body form :where(
  .rcl-privacy,.rcl-help,.rcl-helper,.rcl-note,.rcl-description,
  .form-privacy,.form-help,.form-note,.privacy,.description
) {
  color: #c6d2de !important;
  -webkit-text-fill-color: #c6d2de !important;
  opacity: 1 !important;
}

/*
 * Current RCL output places its privacy sentence as the last textual paragraph
 * of the form. This structural fallback also covers older RCL markup that has
 * no dedicated privacy class.
 */
:where(.rcl-card,[data-rcl-mode="card"]) form > p:last-of-type,
.rr-conversion--form .rr-conversion__form-body form > p:last-of-type {
  color: #c6d2de !important;
  -webkit-text-fill-color: #c6d2de !important;
  font-size: .78rem !important;
  line-height: 1.5 !important;
  opacity: 1 !important;
}
