/* ============================================================================
   apply.css — 2-step funding application wizard
   Uses the design tokens already defined in styles.css (:root).
   ========================================================================== */

/* ---- Wizard card ---------------------------------------------------------- */
.wz {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 40px 40px;
}
.wz-form { position: relative; }
.wz-hp {
  position: absolute !important;
  left: -9999px; top: -9999px;
  width: 0; height: 0; opacity: 0; pointer-events: none;
}

/* ---- Step indicator ------------------------------------------------------- */
.wz-steps {
  list-style: none;
  display: flex;
  margin: 0 0 32px;
  padding: 0;
}
.wz-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  min-width: 0;
}
.wz-step::before {
  content: "";
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--gray-100);
  z-index: 0;
}
.wz-step:first-child::before { display: none; }
.wz-step.is-done::before,
.wz-step.is-active::before { background: var(--gold-400); }

.wz-dot {
  position: relative;
  z-index: 1;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-500);
  font-weight: 700; font-size: 14px;
  transition: all var(--transition);
}
.wz-step.is-active .wz-dot {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-800);
  box-shadow: 0 6px 16px rgba(201, 168, 76, 0.35);
}
.wz-step.is-done .wz-dot {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.wz-step-text { display: flex; flex-direction: column; line-height: 1.2; }
.wz-step-text b { font-size: 12.5px; color: var(--navy-800); font-weight: 700; }
.wz-step-text span { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.wz-step:not(.is-active):not(.is-done) .wz-step-text b { color: var(--gray-500); }

/* ---- Panels --------------------------------------------------------------- */
.wz-panel { display: none; }
.wz-panel.is-active { display: block; animation: wzFade 0.35s var(--ease); }
.wz-panel[hidden] { display: none; }
@keyframes wzFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.wz-title { font-size: 24px; margin: 12px 0 6px; color: var(--navy-800); }
.wz-sub { font-size: 14.5px; color: var(--gray-600); margin: 0 0 26px; line-height: 1.6; }
.wz-opt { color: var(--gray-400); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---- Inline field errors -------------------------------------------------- */
.wz-err { display: block; color: #C0392B; font-size: 12.5px; margin-top: 6px; }
.wz-err:empty { margin-top: 0; }

/* ---- Actions / buttons ---------------------------------------------------- */
.wz-actions { margin-top: 28px; }
.wz-actions .btn { min-width: 210px; justify-content: center; }
.wz-actions-center { display: flex; justify-content: center; }

.btn-ghost {
  background: transparent;
  color: var(--navy-800);
  border: 1.5px solid var(--gray-200);
  justify-content: center;
}
.btn-ghost:hover {
  border-color: var(--navy-800);
  background: var(--navy-800);
  color: #fff;
  transform: translateY(-2px);
}

.wz-link {
  display: inline-block;
  background: none; border: 0;
  color: var(--navy-600);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 4px 2px;
  transition: color var(--transition);
}
.wz-link:hover { color: var(--gold-500); }
.wz-link[disabled] { color: var(--gray-400); cursor: not-allowed; text-decoration: none; }
.wz-back { margin-top: 18px; }

.wz-spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(10, 22, 40, 0.25);
  border-top-color: var(--navy-800);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px; vertical-align: -2px;
  animation: wzspin 0.7s linear infinite;
}
@keyframes wzspin { to { transform: rotate(360deg); } }

/* ---- Inline status messages ---------------------------------------------- */
.wz-inline-msg { display: none; margin-top: 16px; font-size: 13.5px; border-radius: 9px; line-height: 1.55; }
.wz-inline-msg.show { display: block; padding: 12px 15px; }
.wz-inline-msg.info    { background: var(--gray-50); color: var(--gray-600); border: 1px solid var(--gray-100); }
.wz-inline-msg.success { background: #EAF6EF; color: #1A7F4B; border: 1px solid #B7E0C7; }
.wz-inline-msg.error   { background: #FCEDEC; color: #B0392C; border: 1px solid #F2C9C4; }

/* ---- Step 2: section headings -------------------------------------------- */
.wz-section-head {
  display: flex; align-items: center; gap: 11px;
  font-size: 15px; font-weight: 700; color: var(--navy-800);
  margin: 32px 0 18px; padding-top: 26px;
  border-top: 1px solid var(--border);
}
.wz-section-head:first-of-type { border-top: 0; padding-top: 4px; margin-top: 10px; }
.wz-section-num {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--navy-800); color: var(--gold-400);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

/* amount with R prefix */
.wz-amount { position: relative; display: flex; align-items: center; }
.wz-amount-cur {
  position: absolute; left: 15px;
  font-weight: 600; color: var(--gray-500); font-size: 15px;
  pointer-events: none;
}
.wz-amount input { padding-left: 32px !important; }

/* ---- Step 3: documents ---------------------------------------------------- */
.wz-docs-intro { font-size: 13.5px; color: var(--gray-600); margin: 0 0 18px; line-height: 1.6; }
.wz-jump { color: var(--navy-600); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.wz-jump:hover { color: var(--gold-500); }

.wz-docs { display: flex; flex-direction: column; gap: 10px; }
.wz-doc {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-100);
  border-radius: 10px;
  background: var(--off-white);
  transition: border-color var(--transition), background var(--transition);
}
.wz-doc.has-file { border-color: #B7E0C7; background: #F4FBF7; }
.wz-doc.missing  { border-color: #E7A8A1; background: #FDF3F2; }

.wz-doc-info { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.wz-doc-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  margin-top: 1px;
}
.wz-doc.has-file .wz-doc-num { background: #1A8F5C; }
.wz-doc-text { display: flex; flex-direction: column; min-width: 0; }
.wz-doc-title { font-size: 13.5px; font-weight: 600; color: var(--navy-800); }
.wz-doc-note { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.wz-file { display: flex; align-items: center; gap: 10px; justify-self: end; max-width: 100%; }
.wz-file-input {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.wz-file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--navy-800);
  background: var(--white);
  border: 1.5px solid var(--gray-200); border-radius: 7px;
  padding: 8px 14px;
  transition: all var(--transition);
}
.wz-file-btn:hover { border-color: var(--gold-500); }
.wz-file-input:focus + .wz-file-btn {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.15);
}
.wz-file-list {
  font-size: 12px; color: var(--gray-500);
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wz-file-list.has { color: var(--navy-700); font-weight: 500; }
.wz-file-clear {
  background: none; border: 0; color: var(--gray-400);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.wz-file-clear:hover { color: #C0392B; }
.wz-doc .wz-err { grid-column: 1 / -1; margin-top: 0; }

/* ---- Step 2: email-instead callout --------------------------------------- */
.wz-email-instead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin-top: 24px; padding: 18px 20px;
  border: 1px dashed var(--gray-200); border-radius: 12px;
  background: var(--gray-50);
}
.wz-email-instead-text { display: flex; flex-direction: column; gap: 3px; }
.wz-email-instead-text strong { font-size: 14px; color: var(--navy-800); }
.wz-email-instead-text span { font-size: 12.5px; color: var(--gray-600); max-width: 48ch; }
.wz-email-instead .btn { flex: none; }

/* ---- Done panel ----------------------------------------------------------- */
.wz-done-panel { text-align: center; padding: 14px 0 8px; }
.wz-check {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(26, 143, 92, 0.10);
  border: 1.5px solid rgba(26, 143, 92, 0.45);
  display: grid; place-items: center;
  margin: 6px auto 18px;
  animation: wzPop 0.4s var(--ease);
}
.wz-check svg { width: 36px; height: 36px; stroke: #1A8F5C; fill: none; }
@keyframes wzPop { from { transform: scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
.wz-done-title { font-size: 25px; }
.wz-done-lead { max-width: 52ch; margin: 0 auto 24px; }

.wz-code-card {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--navy-800);
  background-image: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border-radius: var(--radius-lg);
  padding: 22px 44px; margin: 0 auto 18px;
  box-shadow: var(--shadow-md);
}
.wz-code-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-400); font-weight: 600;
}
.wz-code { font-family: 'Courier New', monospace; font-size: 26px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.wz-copy {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 6px; cursor: pointer;
  transition: all var(--transition);
}
.wz-copy:hover { background: var(--gold-500); color: var(--navy-800); border-color: var(--gold-500); }
.wz-processing { font-size: 14.5px; color: var(--gray-600); margin: 4px 0 0; }
.wz-done-note { font-size: 13px; color: var(--gray-500); max-width: 48ch; margin: 12px auto 24px; line-height: 1.6; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 768px) {
  .wz { padding: 28px 22px 32px; }
}
@media (max-width: 600px) {
  .wz { padding: 24px 18px 28px; border-radius: var(--radius-md); }
  .wz-actions .btn, .btn-ghost { width: 100%; }
  .wz-email-instead { flex-direction: column; align-items: stretch; }
  .wz-email-instead .btn { width: 100%; }

  .wz-doc { grid-template-columns: 1fr; }
  .wz-file { justify-self: start; }
  .wz-file-list { max-width: 60vw; }
}
@media (max-width: 560px) {
  .wz-steps { margin-bottom: 26px; }
  .wz-step-text span { display: none; }
  .wz-step-text b { font-size: 11px; }
  .wz-dot { width: 30px; height: 30px; font-size: 12px; }
  .wz-step::before { top: 14px; }
  .wz-title, .wz-done-title { font-size: 21px; }
  .wz-code-card { padding: 20px 28px; }
  .wz-code { font-size: 22px; }
}

/* ============================================================================
   Apply page layout — instructions banner (top) · wide form · contact (below)
   ========================================================================== */

/* --- Top: "how it works" instructions banner --- */
.apply-intro { max-width: 960px; margin: 0 auto 46px; text-align: center; }
.apply-intro h2 { font-size: clamp(25px, 3vw, 33px); color: var(--navy-800); margin: 12px 0 10px; letter-spacing: -0.01em; }
.apply-intro > p { color: var(--gray-600); max-width: 62ch; margin: 0 auto 32px; font-size: 15px; line-height: 1.65; }

.apply-intro-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: left; }
.intro-step {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.intro-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-300); }
.intro-step-num {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-800); color: var(--gold-400);
  font-weight: 700; font-size: 16px; margin-bottom: 16px;
}
.intro-step h4 { font-size: 16px; color: var(--navy-800); margin: 0 0 7px; }
.intro-step p { font-size: 13.5px; color: var(--gray-600); line-height: 1.6; margin: 0; }

.apply-assurances {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 30px; margin-top: 30px; padding-top: 26px;
  border-top: 1px solid var(--border);
}
.apply-assurance { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--navy-700); }
.apply-assurance svg { width: 19px; height: 19px; fill: none; stroke: var(--gold-500); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* --- The form is now the focal point: wide and centered --- */
.apply-main { max-width: 960px; margin: 0 auto; }

/* --- Below the form: alternative "speak directly" contact card --- */
.apply-contact {
  max-width: 960px; margin: 46px auto 0;
  background: var(--navy-800);
  background-image: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  border-radius: var(--radius-lg);
  padding: 34px 40px;
  box-shadow: var(--shadow-md);
}
.apply-contact-head { text-align: center; margin-bottom: 24px; }
.apply-contact-head h3 { color: #fff; font-size: 21px; margin: 0 0 6px; }
.apply-contact-head p { color: rgba(255, 255, 255, 0.7); font-size: 14px; margin: 0; }
.apply-contact-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.apply-contact-card {
  display: flex; align-items: center; gap: 13px; min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; padding: 16px 18px;
  color: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
a.apply-contact-card:hover { background: rgba(201, 168, 76, 0.12); border-color: var(--gold-500); transform: translateY(-2px); }
.apply-contact-card svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--gold-400); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.apply-contact-card span { min-width: 0; word-break: break-word; }
.apply-contact-card strong { display: block; color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.apply-contact-card span { color: rgba(255, 255, 255, 0.72); font-size: 13px; line-height: 1.35; }

/* --- Responsive --- */
@media (max-width: 880px) {
  .apply-intro-steps { grid-template-columns: 1fr; gap: 14px; }
  .apply-contact-rows { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .apply-intro { margin-bottom: 34px; }
  .apply-contact { padding: 26px 20px; margin-top: 36px; }
  .apply-assurances { gap: 10px 22px; }
}
