/* ===== after the application is sent =====
   The success popup is where payment happens: it names the insurer's own
   payment methods as cards, takes the proof of payment, and keeps help to two
   small icons so nothing competes with "Pay Insurer". */
.success-view .success-title {
  margin: 0 0 0.15rem;
  color: var(--accent-green, #017a78);
  font-size: 1.5rem;
  font-weight: 800;
}

.success-view .success-message {
  margin: 0 auto 0.4rem;
}

/* --- Next step: Pay Insurer --- */
.success-next-step {
  margin: 1.2rem 0 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  text-align: left;
}

.success-step-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.success-step-kicker {
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: #e4f4f3;
  color: #01545f;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.success-step-head h3 {
  margin: 0;
  color: #013947;
  font-size: 1.3rem;
  font-weight: 800;
}

.success-step-copy {
  margin: 0.4rem 0 0.9rem;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* --- the insurer's payment methods, listed in the open --- */
.success-pay-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.success-pay-card {
  border: 1px solid #d9e0e8;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

/* A card for a bank or M-PESA carries that brand's colour along its top edge,
   so the payment methods read as the institutions they are. */
.success-pay-card.has-brand {
  border-top: 3px solid var(--pay-brand, #d9e0e8);
}

/* ===== the instalment question on the application =====
   The NCBA card states the five payments; this is where the client answers
   whether they want them. Yes or No, either is a complete answer, and neither
   starts selected. A Yes tints the card, so the answer is visible at a glance. */
.ipf-optin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid #d9e0e8;
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ipf-optin-question {
  flex: 1 1 auto;
  min-width: 0;
  color: #013947;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.ipf-optin .section-radio-group {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ipf-optin.is-chosen {
  border-color: #01545f;
  background: #eef9fa;
}

@media (max-width: 640px) {
  .ipf-optin .section-radio-group { width: 100%; }
}

.success-pay-card.is-chosen {
  box-shadow: inset 0 0 0 1px #01545f;
}

/* ===== the two-sided summary under the instalment plan =====
   What the bank finances on the left, what the financing costs on the right. */
.pay-split-pill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.6rem 0 0;
  border: 1px solid #cfe2e3;
  border-radius: 999px;
  background: #f0faf9;
  overflow: hidden;
}

.pay-split-pill > span {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.4rem 0.8rem;
}

.pay-split-pill > span + span {
  border-left: 1px solid #cfe2e3;
}

.pay-split-pill small {
  color: #4f7d7f;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pay-split-pill strong {
  color: #013947;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .pay-split-pill > span { padding: 0.38rem 0.6rem; }
  .pay-split-pill small { font-size: 0.6rem; }
  .pay-split-pill strong { font-size: 0.8rem; }
}

/* ===== the description under a health question =====
   Each of the two health questions carries a Yes/No pair that starts
   unselected; the description box appears only when the answer is Yes. */
.health-details {
  margin-top: 0.55rem;
}

.health-details label {
  display: block;
  margin-bottom: 0.3rem;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.health-details textarea {
  width: 100%;
  min-height: 76px;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid #d9e0e8;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.health-details textarea:focus {
  outline: none;
  border-color: #86b5b3;
  box-shadow: 0 0 0 3px rgba(1,111,109, 0.08);
}

.health-details[hidden] {
  display: none !important;
}

/* The plain, always-open card: a titled block of details. */
.success-pay-card.is-plain {
  padding: 0.75rem 0.85rem;
}

.success-pay-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
  color: #013947;
  font-size: 0.9rem;
  font-weight: 800;
}

.success-pay-title > i {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e6fbf9;
  color: #01545f;
  font-size: 0.74rem;
}

.success-pay-card.is-plain ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.22rem;
}

.success-pay-card.is-plain li {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.success-pay-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 0;
  background: #fff;
  color: #013947;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.success-pay-toggle > i:first-child {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e6fbf9;
  color: #01545f;
  font-size: 0.8rem;
}

.success-pay-toggle > span {
  flex: 1;
  min-width: 0;
}

.success-pay-chevron {
  flex: 0 0 auto;
  color: #8a9a91;
  font-size: 0.72rem;
  transition: transform 0.2s ease;
}

.success-pay-toggle[aria-expanded="true"] .success-pay-chevron {
  transform: rotate(180deg);
}

.success-pay-toggle:hover {
  background: #f1f7f7;
}

.success-pay-panel {
  padding: 0 0.85rem 0.8rem;
  border-top: 1px solid #eef1f3;
  background: #fbfdfd;
}

.success-pay-panel ul {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
}

.success-pay-panel li {
  color: #013947;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
}

.success-pay-link {
  display: inline-block;
  margin-top: 0.55rem;
  color: #14686c;
  font-size: 0.82rem;
  font-weight: 800;
}

.success-pay-hint {
  margin: 0.6rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
}

/* --- upload the proof --- */
.success-proof {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed #d9e0e8;
}

.success-proof h4 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  color: #013947;
  font-size: 1rem;
  font-weight: 800;
}

.success-proof h4 i {
  color: var(--accent-gold, #d4af37);
}

.success-proof-pick {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px dashed #b9c9d4;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.success-proof-pick:hover {
  border-color: #86b5b3;
  background: #f4fbfb;
}

.success-proof-pick > i {
  color: #01545f;
  font-size: 1.05rem;
}

.success-proof-pick strong {
  display: block;
  color: #013947;
  font-size: 0.88rem;
}

.success-proof-pick small {
  display: block;
  color: #64748b;
  font-size: 0.74rem;
}

.success-proof-pick input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.success-proof-filelist {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.success-proof-filelist li {
  color: #013947;
  font-size: 0.8rem;
}

.success-proof-filelist i {
  color: var(--accent-gold, #d4af37);
}

.success-proof-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 40px;
  background: #D5A72A;
  color: #013947;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(1,57,71, 0.16);
}

.success-proof-submit:hover {
  background: #B98D1F;
}

.success-proof-submit[disabled] {
  opacity: 0.7;
  cursor: default;
}

.success-proof-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.success-proof-note.is-ok { color: #14686c; font-weight: 700; }
.success-proof-note.is-error { color: #b91c1c; font-weight: 700; }

/* --- help: two icons only --- */
.success-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 0;
}

.success-help-copy {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 600;
}

.success-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  border: 1px solid #d9e0e8;
  background: #fff;
  color: #013947;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.success-help-icon:hover {
  transform: translateY(-2px);
}

.success-help-icon.wa {
  background: #25D366;
  border-color: #1da851;
  color: #fff;
}

.success-help-icon.mail:hover {
  background: #f1f7f7;
}

/* --- the actions --- */
.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.1rem;
}

.success-pay-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 40px;
  background: #013947;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 16px rgb(12, 29, 30, 0.22);
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.success-pay-cta:hover {
  background: #1d494b;
  color: #fff;
}

.success-pay-cta[disabled] {
  opacity: 0.75;
  cursor: default;
}

/* ===== Download Completed Application =====
   A white button read as inert next to the "Close & Pay Insurer Later" pill;
   a dull sky blue marks it as the one thing the client can take away with
   them. Dark ink keeps the label legible on the blue. */
.success-actions #successDownloadPdfBtn {
  background: #7ba7c9 !important;
  border: 1px solid #6b96b8 !important;
  color: #0f2b40 !important;
  font-weight: 800 !important;
}

.success-actions #successDownloadPdfBtn i {
  color: #0f2b40 !important;
}

.success-actions #successDownloadPdfBtn:hover {
  background: #6b9ac0 !important;
  border-color: #5d8bae !important;
  color: #0b2233 !important;
}

.success-pay-cta-sub {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
}

.success-pay-note {
  flex: 1 1 100%;
  margin: 0.2rem 0 0;
  color: #475569;
  font-size: 0.82rem;
  text-align: center;
}

.success-pay-note.is-ok { color: #14686c; font-weight: 700; }
.success-pay-note.is-error { color: #b91c1c; font-weight: 700; }

/* The IPF interest bands, printed inside the card so no link is needed. */
.success-pay-bands {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.success-pay-bands li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.22rem 0;
  border-bottom: 1px solid #eef1f3;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 500;
}

.success-pay-bands li:last-child { border-bottom: 0; }
.success-pay-bands strong { color: #013947; font-weight: 800; }

/* ===== NCBA IPF: the five payments =====
   Each row names who is paid, when, and how much, so the instalment plan reads
   as a short schedule rather than a paragraph. */
.success-pay-schedule {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.success-pay-schedule li {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.45rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid #eef1f3;
  color: #33485c;
  font-size: 0.78rem;
}

.success-pay-schedule li:last-child { border-bottom: 0; }

.success-pay-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #e4f4f3;
  color: #01545f;
  font-size: 0.7rem;
  font-weight: 800;
}

.success-pay-what {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.success-pay-what small {
  color: #6b7d8c;
  font-size: 0.7rem;
  font-weight: 600;
}

.success-pay-schedule li strong {
  color: #013947;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .success-pay-cards { grid-template-columns: 1fr; }
  .success-step-head h3 { font-size: 1.15rem; }
  .success-pay-cta,
  .success-actions .btn-secondary { width: 100%; }
  .success-proof-submit { width: 100%; }
  /* The Apply form's proof heading carries a quiet pill beside it. On a phone
     the two cannot share the line without breaking both across two lines, so
     the heading keeps its own line and the pill drops under it. */
  .payment-details-modal .success-proof > h4 { display: block; }
  .payment-details-modal .success-proof > h4 > i { margin-right: 0.4rem; }
  .payment-details-modal .success-proof > h4 .payment-details-optional {
    display: inline-block;
    margin: 0.35rem 0 0;
  }
}

/* ===== the same payment block inside the Apply form ===== */
/* A quiet pill for the one-line notes the Apply form carries. */
.payment-details-optional {
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e4f4f3;
  color: #01545f;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
}

.payment-details-modal .payment-details-lead {
  margin: 0 0 0.8rem;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ===== when will you pay? =====
   Two choices under the proof heading: pay now and send the proof with the
   application, or pay straight after it. The chosen one wears the site's light
   green so the answer is obvious at a glance, and "Pay Now" is the default. */
.pay-when {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
}

.pay-when-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.7rem;
  border: 1.5px solid #d3dde4;
  border-radius: 10px;
  background: #fff;
  color: #3f5162;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.pay-when-option input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #01545f;
}

.pay-when-option:has(input:checked) {
  border-color: #01545f;
  background: #e4f4f3;
  color: #013947;
  font-weight: 800;
}

/* The upload waits for the answer: it belongs to "Pay Now" alone. */
.pay-when-body {
  margin-top: 0.7rem;
}

.pay-when-note {
  margin: 0.7rem 0 0;
  color: #4f7d7f;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.success-proof-message-label {
  display: block;
  margin: 0.7rem 0 0.3rem;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.success-proof-message {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid #d3dde4;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
  resize: vertical;
}

.success-proof-message:focus {
  outline: none;
  border-color: #86b5b3;
  box-shadow: 0 0 0 3px rgba(1,111,109, 0.08);
}

/* ===== is the proof attached? =====
   A quiet line that answers the question before the client sends anything. It
   turns green once a file or a payment message is there. */
.proof-status {
  margin: 0.7rem 0 0;
  padding: 0.42rem 0.6rem;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f0dca6;
  color: #8a6d1f;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
}

.proof-status.is-attached {
  background: #e4f4f3;
  border-color: #a5d4d6;
  color: #01545f;
}

/* The three states the script switches between. */
#applyPayNowBody[hidden],
#applyPayLaterNote[hidden],
#successNextStep[hidden] {
  display: none !important;
}

.payment-details-modal .success-pay-cards {
  gap: 0.5rem;
}

.payment-details-modal .success-pay-toggle,
.payment-details-modal .success-pay-panel {
  background: #fff;
}

.apply-pay-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.apply-pay-actions .success-pay-cta {
  padding: 0.7rem 1.3rem;
  font-size: 0.86rem;
}

.apply-pay-actions .btn-secondary {
  padding: 0.68rem 1.2rem;
  font-size: 0.86rem;
}

.payment-details-modal .success-pay-note {
  text-align: left;
  flex: 1 1 100%;
}

.payment-details-modal .success-proof {
  margin-top: 0.9rem;
}

@media (max-width: 1024px) {
  .apply-pay-actions .success-pay-cta,
  .apply-pay-actions .btn-secondary {
    width: 100%;
  }
}
