/* FindraCapital — Loan Application UX */

.application-page {
    background: linear-gradient(160deg, #f0f4ff 0%, #f8fafc 45%, #eef2ff 100%);
    min-height: calc(100vh - 72px);
    padding: 1.5rem 0 2rem;
}

.application-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.app-trust-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    color: #475569;
}

.app-trust-bar span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    backdrop-filter: blur(8px);
}

.app-progress-card {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(12px);
}

.app-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.app-progress-header h6 {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}

.app-progress-pct {
    font-weight: 700;
    color: #4f46e5;
}

.app-time-left {
    font-size: 0.8rem;
    color: #64748b;
}

.app-progress-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.app-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    background-size: 200% 100%;
    animation: appProgressShine 2.5s ease infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes appProgressShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-glass-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 20px 50px -12px rgba(79, 70, 229, 0.18);
    overflow: hidden;
}

.app-card-body {
    padding: 1.75rem 1.5rem 1rem;
}

@media (min-width: 768px) {
    .app-card-body {
        padding: 2rem 2.25rem 1rem;
    }
}

.app-stage-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.app-stage-sub {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.app-field-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .app-field-grid.two-col {
        grid-template-columns: 1fr 1fr;
    }
    .app-field-grid .span-full {
        grid-column: 1 / -1;
    }
}

.fc-field-wrap {
    position: relative;
}

.fc-field-wrap .form-floating > .form-control,
.fc-field-wrap .form-floating > .form-select {
    border-radius: 12px;
    border-color: #cbd5e1;
    min-height: 3.25rem;
    padding-left: 2.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fc-field-wrap .form-floating > .form-control:focus,
.fc-field-wrap .form-floating > .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.fc-field-wrap.is-valid .form-control,
.fc-field-wrap.is-valid .form-select {
    border-color: #22c55e;
}

.fc-field-wrap.is-invalid .form-control,
.fc-field-wrap.is-invalid .form-select {
    border-color: #ef4444;
}

.fc-field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    color: #94a3b8;
    pointer-events: none;
    font-size: 1rem;
}

.fc-field-wrap .form-floating > label {
    padding-left: 2.75rem;
    color: #64748b;
}

.fc-valid-mark {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 4;
}

.fc-field-wrap.is-valid .fc-valid-mark {
    opacity: 1;
}

.fc-check-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem 1rem 2.85rem;
    margin-bottom: 0;
}

.fc-check-row .form-check-input {
    margin-left: -1.75rem;
    margin-top: 0.15rem;
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

.fc-check-row .form-check-input:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

.fc-check-row:has(.form-check-input:checked) {
    border-color: #c7d2fe;
    background: #f5f7ff;
}

.fc-check-row .form-check-label {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #334155;
}

.app-sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e2e8f0;
    backdrop-filter: blur(12px);
    padding: 0.85rem 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

.app-sticky-footer .application-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.app-footer-actions {
    flex-wrap: wrap;
}

.app-footer-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.app-sticky-footer .btn {
    border-radius: 12px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
}

.app-autosave-status {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.5rem;
    min-height: 1.1rem;
}

.app-autosave-status.is-saving { color: #6366f1; }
.app-autosave-status.is-saved { color: #22c55e; }

/* Eligibility result */
.eligibility-hero {
    text-align: center;
    padding: 1rem 0 1.5rem;
}

.eligibility-hero .celebration-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.eligibility-stats {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

@media (min-width: 576px) {
    .eligibility-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.eligibility-stat {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}

.eligibility-stat .label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.eligibility-stat .value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.25rem;
}

/* Document checklist */
.doc-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-item {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    transition: border-color 0.2s, background 0.2s;
}

.doc-item.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.doc-item.is-active {
    border-color: #a5b4fc;
    background: #fafaff;
}

.doc-item.is-missing {
    border-color: #f87171;
    background: #fef2f2;
}

.doc-item.is-missing .status-icon {
    background: #ef4444;
    color: #fff;
}

.doc-item-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    color: #0f172a;
}

.doc-item-header .status-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.doc-item.is-done .status-icon {
    background: #22c55e;
    color: #fff;
}

.doc-item:not(.is-done) .status-icon {
    background: #e2e8f0;
    color: #64748b;
}

.doc-dropzone {
    margin-top: 0.75rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.doc-dropzone:hover,
.doc-dropzone.is-dragover {
    border-color: #6366f1;
    background: #f5f3ff;
}

.doc-dropzone input[type="file"] {
    display: none;
}

.doc-upload-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    margin-top: 0.5rem;
    overflow: hidden;
    display: none;
}

.doc-upload-progress .bar {
    height: 100%;
    background: #6366f1;
    width: 0%;
    transition: width 0.3s;
}

/* Review cards */
.review-grid {
    display: grid;
    gap: 1rem;
}

.review-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.review-card-header h6 {
    margin: 0;
    font-weight: 700;
}

.review-card-body {
    padding: 0.85rem 1.1rem;
}

.review-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
}

.review-row:last-child {
    border-bottom: none;
}

.review-row .key {
    color: #64748b;
    flex-shrink: 0;
}

.review-row .val {
    text-align: right;
    color: #0f172a;
    font-weight: 500;
}

/* Success screen */
.success-page {
    background: linear-gradient(160deg, #f0fdf4 0%, #f8fafc 50%, #eef2ff 100%);
    min-height: calc(100vh - 72px);
    padding: 3rem 0;
}

.success-card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 20px 50px -12px rgba(34, 197, 94, 0.2);
}

.success-ref {
    background: linear-gradient(135deg, #eef2ff, #f0fdf4);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.success-ref .ref-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: 0.05em;
}

.success-meta {
    display: grid;
    gap: 0.75rem;
    text-align: left;
    margin: 1.25rem 0;
}

.success-meta-item {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.9rem;
}

.app-fade-in {
    animation: appFadeIn 0.4s ease;
}

@keyframes appFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.application-page .form-control,
.application-page .form-select {
    border-radius: 12px;
    border-color: #cbd5e1;
    min-height: 3rem;
}

.application-page .form-control:focus,
.application-page .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.elig-page.application-page {
    padding-bottom: 3rem;
}

.elig-continue:disabled {
    background: #cbd5e1;
    border-color: #cbd5e1;
    color: #64748b;
    opacity: 1;
    cursor: not-allowed;
}

.elig-continue {
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    font-weight: 700;
    padding: 0.85rem 1rem;
}

.elig-consent-link {
    border: 0;
    padding: 0;
    background: none;
    color: #4f46e5;
    font-weight: 700;
    text-decoration: underline;
}

.elig-modal .modal-content {
    border: none;
    border-radius: 20px;
}

.elig-modal .modal-body {
    max-height: min(60vh, 28rem);
    overflow: auto;
}

/* Two-step lead journey */
.vf-wrap {
    max-width: 720px;
    padding-top: 1rem;
}

.vf-steps {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 1.25rem;
}

.vf-step {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}

.vf-step:not(:last-child)::after {
    content: '';
    flex: 1 1 auto;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-right: 0.25rem;
}

.vf-step.is-done:not(:last-child)::after {
    background: #4f46e5;
}

.vf-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.85rem;
}

.vf-step.is-active {
    color: #0f172a;
}

.vf-step.is-active .vf-step-dot {
    border-color: #4f46e5;
    color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.vf-step.is-done {
    color: #334155;
}

.vf-step.is-done .vf-step-dot {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.vf-step-label {
    white-space: nowrap;
}

.vf-card-body {
    padding-bottom: 1.75rem;
}

@media (min-width: 768px) {
    .vf-card-body {
        padding-bottom: 2rem;
    }
}

.vf-eyebrow {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.application-page .app-stage-title {
    font-size: 1.6rem;
    font-weight: 800;
}

.vf-alert {
    border-radius: 12px;
    font-size: 0.9rem;
}

.application-page .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
    margin-bottom: 0.4rem;
}

.application-page .form-control::placeholder {
    color: #a0aec0;
}

.application-page .input-group-text {
    border-radius: 12px 0 0 12px;
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}

.application-page .input-group > .form-control {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.application-page .form-text {
    font-size: 0.78rem;
    color: #94a3b8;
}

.vf-mono {
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

.application-page fieldset {
    min-width: 0;
}

.application-page legend.form-label {
    float: none;
    width: auto;
}

.vf-choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.vf-choice-group.three {
    grid-template-columns: repeat(3, 1fr);
}

.vf-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.vf-choice:hover {
    border-color: #a5b4fc;
}

.btn-check:checked + .vf-choice {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #3730a3;
}

.btn-check:focus-visible + .vf-choice {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.vf-otp-input {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.6em;
    text-align: center;
    padding-left: 0.6em;
    max-width: 320px;
    min-height: 3.5rem !important;
}

.vf-consents {
    display: grid;
    gap: 0.75rem;
}

.vf-fields {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.vf-fields:disabled {
    opacity: 0.6;
}

.vf-otp-panel {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 16px;
    background: #f8faff;
    animation: appFadeIn 0.3s ease;
}

.vf-otp-panel .vf-otp-input {
    max-width: none;
    background: #fff;
}

.vf-inline-error {
    margin-top: 0.5rem;
    color: #b91c1c;
    font-size: 0.85rem;
}

.vf-resend {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.vf-link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: #4f46e5;
    font-weight: 700;
}

.vf-link-btn:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.vf-fineprint {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
}

.vf-fineprint a {
    color: #64748b;
}

.vf-trust {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    padding: 0;
    margin: 1.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.vf-trust i {
    color: #4f46e5;
    margin-right: 0.25rem;
}

.vf-result {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.vf-result .app-stage-sub {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.vf-result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.vf-result-icon.is-success {
    background: #dcfce7;
    color: #16a34a;
}

.vf-result-icon.is-neutral {
    background: #eef2ff;
    color: #4f46e5;
}

.vf-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.vf-result-actions .btn {
    border-radius: 12px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

@media (max-width: 575.98px) {
    .vf-step-label {
        display: none;
    }

    .vf-step.is-active .vf-step-label {
        display: inline;
    }

    .vf-choice-group.three {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .vf-otp-input {
        max-width: none;
    }

    .vf-result-actions .btn {
        width: 100%;
    }

    .app-footer-actions {
        flex-direction: column;
    }

    .app-footer-actions .btn {
        width: 100%;
        flex: none;
    }

    .app-sticky-footer .btn {
        padding: 0.75rem 1rem;
    }
}
