/* ═══════════════════════════════════════════════════════════════════════════
   Apply For Credit — Minimal page-specific styles
   Uses site Bootstrap classes for layout, cards, buttons, forms, alerts.
   Only wizard-specific (stepper, step panels, uploads, etc.) styles here.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell ─────────────────────────────────────────────────────────────── */
.afc-shell {
    background: #fff;
    min-height: calc(100vh - 72px);
}

/* ── Content cards — prominent on white bg ─────────────────────────────── */
.afc-shell .card.shadow-sm {
    box-shadow: 0 2px 12px rgba(33, 52, 72, .08), 0 0 0 1px rgba(33, 52, 72, .06) !important;
}

/* ── Sidebar sticky ────────────────────────────────────────────────────── */
.afc-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
}

@media (max-width: 991px) {
    .afc-sidebar {
        position: static;
    }
}

/* ── Progress / Stepper ────────────────────────────────────────────────── */
.afc-progress-wrap {
    max-width: 100%;
}

.afc-progress .card-body {
    overflow-x: auto;
}

.afc-progress__step {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.afc-progress__num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #e7eaf3;
    color: #8c98a4;
    background: #fff;
    transition: all .25s ease;
    flex-shrink: 0;
}

.afc-progress__num--active {
    border-color: var(--primary, #213448);
    color: #fff;
    background: var(--primary, #213448);
    box-shadow: 0 0 0 4px rgba(33, 52, 72, .12);
}

.afc-progress__num--done {
    border-color: var(--success, #00c9a7);
    color: #fff;
    background: var(--success, #00c9a7);
}

.afc-progress__label {
    font-size: 12px;
    font-weight: 600;
    color: #8c98a4;
    transition: color .25s;
}

.afc-progress__label--active {
    color: var(--dark, #1e2022);
}

.afc-progress__label--done {
    color: var(--success, #00c9a7);
}

.afc-progress__line {
    flex: 1;
    height: 2px;
    background: #e7eaf3;
    min-width: 16px;
    margin: 0 6px;
    transition: background .25s;
}

.afc-progress__line--done {
    background: var(--success, #00c9a7);
}

@media (max-width: 700px) {
    .afc-progress__label {
        display: none;
    }

    .afc-progress__line {
        min-width: 10px;
    }

    .afc-progress__num {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* ── Step Panels ───────────────────────────────────────────────────────── */
.afc-step {
    display: none;
}

.afc-step.is-active {
    display: block;
    animation: afcFadeIn .3s ease;
}

@keyframes afcFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Field-level error (JS-toggled) ────────────────────────────────────── */
.afc-field-error {
    font-size: 12px;
    color: var(--danger, #de4437);
    margin-top: 2px;
    display: none;
}

.afc-field-error.is-visible {
    display: block;
}

/* ── Validation states on form-control ─────────────────────────────────── */
.form-control.is-error,
.afc-input.is-error,
.afc-select.is-error,
.afc-textarea.is-error {
    border-color: var(--danger, #de4437);
    box-shadow: 0 0 0 3px rgba(222, 68, 55, .06);
}

.form-control.is-valid,
.afc-input.is-valid {
    border-color: var(--success, #00c9a7);
}

/* ── Password Strength ─────────────────────────────────────────────────── */
.afc-pw-strength {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    height: 3px;
}

.afc-pw-strength__bar {
    flex: 1;
    border-radius: 2px;
    background: #e7eaf3;
    transition: background .2s;
}

.afc-pw-strength[data-level="1"] .afc-pw-strength__bar:nth-child(-n+1) {
    background: var(--danger, #de4437);
}

.afc-pw-strength[data-level="2"] .afc-pw-strength__bar:nth-child(-n+2) {
    background: #d4820b;
}

.afc-pw-strength[data-level="3"] .afc-pw-strength__bar:nth-child(-n+3) {
    background: #c9b700;
}

.afc-pw-strength[data-level="4"] .afc-pw-strength__bar:nth-child(-n+4) {
    background: var(--success, #00c9a7);
}

.afc-pw-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    color: #8c98a4;
}

/* ── Password visibility toggle ────────────────────────────────────────── */
.afc-pw-wrap {
    position: relative;
}

.afc-pw-wrap .form-control,
.afc-pw-wrap .afc-input {
    padding-right: 42px;
}

.afc-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8c98a4;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    line-height: 1;
}

.afc-pw-toggle:hover {
    color: var(--dark, #1e2022);
}

/* ── Upload Area ───────────────────────────────────────────────────────── */
.afc-upload {
    border: 2px dashed #e7eaf3;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    transition: border-color .2s, background .2s;
    cursor: pointer;
    margin-top: 8px;
}

.afc-upload:hover {
    border-color: var(--primary, #213448);
    background: rgba(33, 52, 72, .02);
}

.afc-upload.has-file {
    border-color: var(--success, #00c9a7);
    border-style: solid;
    background: rgba(0, 201, 167, .04);
}

.afc-upload input[type="file"] {
    display: none;
}

.afc-upload__label {
    font-size: 13px;
    color: #8c98a4;
}

.afc-upload__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark, #1e2022);
    margin-top: 6px;
    display: none;
}

/* ── Spinner ───────────────────────────────────────────────────────────── */
.afc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: afcSpin .6s linear infinite;
}

@keyframes afcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Summary Grid (Review step — JS-populated) ─────────────────────────── */
.afc-summary {
    margin-bottom: 20px;
}

.afc-summary__section {
    margin-bottom: 16px;
}

.afc-summary__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e7eaf3;
}

.afc-summary__section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark, #1e2022);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.afc-summary__edit {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary, #213448);
    cursor: pointer;
    background: none;
    border: none;
}

.afc-summary__edit:hover {
    text-decoration: underline;
}

.afc-summary__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 600px) {
    .afc-summary__grid {
        grid-template-columns: 1fr;
    }
}

.afc-summary__item {
    background: var(--light, #f7faff);
    border-radius: 8px;
    padding: 10px 12px;
}

.afc-summary__item--full {
    grid-column: 1 / -1;
}

.afc-summary__label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #8c98a4;
    margin: 0 0 2px;
}

.afc-summary__value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dark, #1e2022);
    margin: 0;
    word-break: break-word;
}

/* ── Next steps wrap (success screen) ──────────────────────────────────── */
.afc-next-steps-wrap {
    max-width: 440px;
}

/* ── Global Error Banner ───────────────────────────────────────────────── */
.afc-global-error {
    margin-bottom: 16px;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.afc-hidden {
    display: none !important;
}

/* ── Font weight helper (if not in theme) ──────────────────────────────── */
.font-weight-600 {
    font-weight: 600 !important;
}