/* Chance Payments application form, brought into the brand system.

   The application pages are a historical compiled React build, so this sheet restyles
   them from the outside rather than editing a hashed bundle. Every rule is scoped to
   body.cp-apply-route, which the referral bridge sets only on /apply/standard and
   /apply/high-risk, so nothing here can reach the rest of the site.

   What it changes and why:
   - The solid #0a2a6b section bars were an off-brand blue (the brand navy is #173a6d)
     and read like a 2010s admin form. They become typographic section headers with a
     red index mark, which is the same hierarchy without the weight.
   - Inputs were grey fills with almost no edge. White with a real border reads as
     something you are meant to type in, and matches the agent portal.
   - Radii, borders, and the focus ring are pulled onto the site's own tokens. */

body.cp-apply-route #root form {
  --cp-form-navy: #173a6d;
  --cp-form-red: #e0241c;
  --cp-form-ink: #0f1a2e;
  --cp-form-line: #e6eaf1;
}

/* ---- section headers ---- */
body.cp-apply-route #root form [class~="bg-[#0a2a6b]"] {
  position: relative;
  margin: 0 0 26px !important;
  padding: 0 0 13px 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  border-bottom: 1px solid var(--cp-form-line);
  color: var(--cp-form-ink) !important;
}
body.cp-apply-route #root form [class~="bg-[#0a2a6b]"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34px;
  height: 2px;
  background: var(--cp-form-red);
}
body.cp-apply-route #root form [class~="bg-[#0a2a6b]"] h2 {
  margin: 0;
  color: var(--cp-form-navy) !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  letter-spacing: .15em !important;
  line-height: 1.3 !important;
}

/* ---- section cards ---- */
body.cp-apply-route #root form > div[class*="rounded-3xl"] {
  border-radius: 20px !important;
  border-color: var(--cp-form-line) !important;
  box-shadow: 0 1px 2px rgba(15, 26, 46, .04), 0 12px 30px -18px rgba(15, 26, 46, .16) !important;
}

/* ---- fields ---- */
body.cp-apply-route #root form input:not([type="checkbox"]):not([type="radio"]),
body.cp-apply-route #root form select,
body.cp-apply-route #root form textarea,
body.cp-apply-route #root form button[role="combobox"] {
  background-color: #fff !important;
  border: 1px solid var(--cp-form-line) !important;
  border-radius: 10px !important;
  color: var(--cp-form-ink) !important;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.cp-apply-route #root form input:not([type="checkbox"]):not([type="radio"]):focus,
body.cp-apply-route #root form select:focus,
body.cp-apply-route #root form textarea:focus,
body.cp-apply-route #root form button[role="combobox"]:focus-visible {
  border-color: var(--cp-form-navy) !important;
  box-shadow: 0 0 0 3px rgba(23, 58, 109, .13) !important;
  outline: none !important;
}
body.cp-apply-route #root form label {
  color: var(--cp-form-ink) !important;
  font-weight: 600 !important;
}

/* The focus ring above is a border colour and a shadow, and forced-colors paints
   neither. Without this, a keyboard user in high contrast cannot tell which of the
   fields on a merchant application is focused, because the UA outline was removed. */
@media (forced-colors: active) {
  body.cp-apply-route #root form input:focus,
  body.cp-apply-route #root form select:focus,
  body.cp-apply-route #root form textarea:focus,
  body.cp-apply-route #root form button[role="combobox"]:focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px !important;
  }
}

/* ---- the referred-by panel the bridge injects ---- */
body.cp-apply-route #root form [data-cp-referral-field] {
  border-radius: 12px !important;
}

/* ---- the invitation hero above the form ----

   A merchant who opened a link their agent sent is met by the same dark hero the rest
   of the site uses, with the darkwaves footage behind it, rather than a paragraph. The
   video sits under a scrim heavy enough that the copy holds its contrast whatever frame
   is showing. */
body.cp-apply-route #cp-referral-welcome.cp-referral-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 28px;
  padding: clamp(28px, 4.5vw, 46px);
  border-radius: 20px;
  background-color: #0a0b0d;
  box-shadow: 0 30px 70px -32px rgba(10, 11, 13, .75);
  animation: cp-referral-hero-in .5s cubic-bezier(.22, .61, .36, 1) both;
}
.cp-referral-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.cp-referral-hero__bg video,
.cp-referral-hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Legibility first: the footage is texture, not the subject. */
.cp-referral-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(10, 11, 13, .93) 0%, rgba(10, 11, 13, .82) 46%, rgba(10, 11, 13, .6) 100%);
}
.cp-referral-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.cp-referral-hero__kicker {
  margin: 0;
  color: #ff8a84;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.cp-referral-hero__title {
  margin: 12px 0 0;
  color: #fff;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
}
.cp-referral-hero__lead {
  margin: 12px 0 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, .8);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.6;
}
.cp-referral-hero__actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cp-referral-hero__signature {
  margin-top: 26px;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.cp-referral-hero__signature strong { color: #fff; font-size: 14.5px; font-weight: 800; }
.cp-referral-hero__signature > span { color: rgba(255, 255, 255, .55); font-size: 12.5px; }
.cp-referral-hero__verified {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #6ee7b7 !important;
  font-size: 12px;
  font-weight: 700;
}
.cp-referral-hero__verified span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

/* Signed commercial terms sit between the personal invitation and the application.
   They are read-only because the server, not the browser, is the source of truth. */
body.cp-apply-route .cp-high-risk-terms {
  margin: 0 0 28px;
  padding: clamp(22px, 3.5vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
  gap: 22px 32px;
  align-items: end;
  background: #fff;
  border: 1px solid #e6eaf1;
  border-radius: 20px;
  box-shadow: 0 12px 30px -22px rgba(15, 26, 46, .22);
}
.cp-high-risk-terms__head span {
  color: #e0241c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.cp-high-risk-terms__head h2 { margin: 8px 0 0; color: #173a6d; font-size: clamp(20px, 2.5vw, 27px); line-height: 1.15; }
.cp-high-risk-terms__head p { margin: 8px 0 0; max-width: 54ch; color: #5f6f82; font-size: 13px; line-height: 1.55; }
.cp-high-risk-terms__values { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cp-high-risk-terms__values > div { padding: 14px; background: #f5f8fc; border: 1px solid #e0ebf5; border-radius: 12px; }
.cp-high-risk-terms__values dt { color: #5f6f82; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cp-high-risk-terms__values dd { margin: 5px 0 0; color: #173a6d; font-size: 19px; font-weight: 800; }
@keyframes cp-referral-hero-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  body.cp-apply-route .cp-high-risk-terms { grid-template-columns: minmax(0, 1fr); }
  .cp-referral-hero__signature { margin-top: 22px; }
  .cp-referral-hero__verified { margin-left: 0; flex-basis: 100%; }
  body.cp-apply-route #cp-referral-welcome.cp-referral-hero .cp-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  body.cp-apply-route #cp-referral-welcome.cp-referral-hero { animation: none; }
}
