/* Multi-step application form */

.apply-shell { padding: 48px 0 100px; }
.apply-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }

.progress-rail { max-width: 780px; margin: 0 auto 48px; }
.progress-steps { display: flex; justify-content: space-between; position: relative; }
.progress-steps::before {
  content: ""; position: absolute; top: 17px; left: 0; right: 0; height: 2px; background: var(--border); z-index: 0;
}
.progress-fill { position: absolute; top: 17px; left: 0; height: 2px; background: linear-gradient(90deg, var(--blue-600), var(--emerald-500)); z-index: 1; transition: width .4s var(--ease); width: 0%; }
.progress-step { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.progress-dot {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--text-400);
  transition: all .3s var(--ease);
}
.progress-label { font-size: .76rem; font-weight: 600; color: var(--text-400); text-align: center; }
.progress-step.active .progress-dot { border-color: var(--blue-600); color: var(--blue-600); box-shadow: 0 0 0 6px var(--blue-100); }
.progress-step.active .progress-label { color: var(--text-900); }
.progress-step.done .progress-dot { background: var(--emerald-500); border-color: var(--emerald-500); color: #fff; }
.progress-step.done .progress-label { color: var(--emerald-500); }

.form-card { max-width: 780px; margin: 0 auto; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 44px; }
@media (max-width: 640px) { .form-card { padding: 28px 20px; } .progress-label { display: none; } }

.form-step { display: none; animation: stepIn .35s var(--ease); }
.form-step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

.form-step h2 { margin-bottom: 6px; }
.form-step .step-sub { margin-bottom: 30px; }

.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.field-grid.single { grid-template-columns: minmax(0, 1fr); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-900); }
.field .hint { font-size: .76rem; color: var(--text-400); font-weight: 400; }
.field input, .field select, .field textarea {
  padding: 13px 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-900); font-size: .95rem; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100);
}
.field input.invalid, .field select.invalid { border-color: #d64545; }
.field-error { font-size: .76rem; color: #d64545; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error input, .field.has-error select { border-color: #d64545; }
@media (max-width: 640px) { .field-grid { grid-template-columns: minmax(0, 1fr); } }

/* Loan purpose cards */
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.choice-card { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 18px 14px; text-align: center; cursor: pointer; transition: all .2s var(--ease); background: var(--surface); }
.choice-card:hover { border-color: var(--blue-500); }
.choice-card.selected { border-color: var(--blue-600); background: var(--blue-100); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card .choice-icon { font-size: 1.5rem; margin-bottom: 8px; }
.choice-card .choice-title { font-size: .86rem; font-weight: 600; }
@media (max-width: 640px) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Amount input + slider */
.amount-input-row {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  margin: 10px 0 4px;
}
.amount-currency { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; color: var(--text-900); }
.amount-input-big {
  font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; color: var(--text-900);
  border: none; border-bottom: 2px solid transparent; background: transparent;
  width: 100%; max-width: 320px; text-align: left; padding: 0 2px 2px;
  transition: border-color .2s var(--ease);
}
.amount-input-big:focus { outline: none; border-bottom-color: var(--blue-600); }
.amount-input-big::-webkit-inner-spin-button, .amount-input-big::-webkit-outer-spin-button { opacity: .5; }
.amount-input-big::placeholder { color: var(--blue-600); opacity: .55; font-weight: 600; }

/* Blinking border while the field is empty, to draw the eye to the animated placeholder */
.blink-caret:placeholder-shown {
  animation: amountBlink 1.4s ease-in-out infinite;
}
@keyframes amountBlink {
  0%, 100% { border-bottom-color: var(--blue-600); }
  50% { border-bottom-color: transparent; }
}
.amount-slider-wrap { padding: 0 6px; margin-bottom: 6px; }
input[type="range"] { width: 100%; accent-color: var(--blue-600); height: 6px; }
.amount-range-labels { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-400); margin-top: 6px; }

/* Upload zones */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-md); padding: 28px; text-align: center;
  cursor: pointer; transition: all .2s var(--ease); position: relative;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue-600); background: var(--blue-100); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .upload-icon { margin-bottom: 10px; color: var(--blue-600); }
.upload-filename { margin-top: 10px; font-size: .84rem; font-weight: 600; color: var(--emerald-500); display: none; }
.upload-zone.filled .upload-filename { display: block; }
.upload-zone.filled { border-style: solid; border-color: var(--emerald-500); background: var(--emerald-100); }

/* Review step */
.review-block { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 24px; margin-bottom: 16px; }
.review-block h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-400); margin-bottom: 12px; }
.review-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .92rem; border-top: 1px solid var(--border); }
.review-row:first-of-type { border-top: none; }
.review-row span:first-child { color: var(--text-400); }
.review-row span:last-child { font-weight: 600; text-align: right; }

.consent-box { display: flex; gap: 12px; align-items: flex-start; padding: 18px; background: var(--surface-alt); border-radius: var(--radius-md); margin: 22px 0; }
.consent-box input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--blue-600); }
.consent-box p { font-size: .85rem; }

.form-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; gap: 14px; }
.form-nav .btn { min-width: 130px; }

.success-panel { text-align: center; padding: 20px 0; }
.success-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--emerald-100); display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; animation: pulseRing 1.8s ease-out 1; }

.secure-note { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: .8rem; color: var(--text-400); margin-top: 20px; }
