/* Multi-step form wizard -- shared by the IPO application and Account
   Opening forms. Generic, driven purely by markup/classes so both pages
   can reuse it without per-page CSS. */

.wizard-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 10px 0 30px 0;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e4e4e4;
    z-index: 0;
}

.wizard-progress-fill {
    position: absolute;
    top: 18px;
    left: 0;
    height: 3px;
    background: #eca413;
    z-index: 1;
    transition: width 0.25s ease;
    width: 0%;
}

.wizard-progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: default;
}

.wizard-progress-step .circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFF;
    border: 3px solid #e4e4e4;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.wizard-progress-step .label {
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
    color: #888;
    max-width: 90px;
    line-height: 1.3;
}

.wizard-progress-step.is-current .circle {
    border-color: #eca413;
    color: #eca413;
    background: #FFF;
}

.wizard-progress-step.is-current .label {
    color: #0b2545;
    font-weight: 700;
}

.wizard-progress-step.is-complete .circle {
    border-color: #eca413;
    background: #eca413;
    color: #FFF;
}

.wizard-progress-step.is-complete {
    cursor: pointer;
}

.wizard-progress-step.is-complete .label {
    color: #0b2545;
}

.wizard-step {
    display: none;
}

.wizard-step.is-active {
    display: block;
    animation: wizardFadeIn 0.2s ease;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.wizard-nav .btn-wizard-back {
    background: #FFF;
    border: 2px solid #0b2545;
    color: #0b2545;
    padding: 10px 30px;
}

.wizard-nav .btn-wizard-next,
.wizard-nav .btn-wizard-submit {
    background: #eca413;
    border: 2px solid #eca413;
    color: #FFF;
    padding: 10px 30px;
}

.wizard-review-table th {
    width: 45%;
    color: #6b6b6b;
    font-weight: 600;
    font-size: 13px;
}

.wizard-review-table td {
    font-size: 14px;
    color: #2b2b2b;
}

.wizard-review-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #eca413;
    font-weight: 700;
    margin: 18px 0 8px 0;
}

.wizard-review-section-title:first-child {
    margin-top: 0;
}

/* ---------------- Field presentation ----------------
   Labels sit above their control (reads better than left-aligned labels
   given how long some of these labels are, and degrades cleanly on mobile).
   The job here is to keep them tidy and consistently aligned. */

/* The surrounding page section sets text-align:center, which the form would
   otherwise inherit -- centred field labels over left-aligned inputs. */
.wizard-step {
    text-align: left;
}

.wizard-step label {
    font-size: 13px;
    font-weight: 600;
    color: #3d4852;
    margin-bottom: 6px;
    line-height: 1.35;
}

/* Labels that wrap their own checkbox/radio are body copy, not field titles. */
.wizard-step label.d-block,
.wizard-step label.mr-3 {
    font-weight: 400;
    color: #2b2b2b;
}

.wizard-step .form-group {
    margin-bottom: 18px;
}

/* One explicit control height for everything, so a row of text inputs, a
   select and a date picker line up. Left to `height:auto` they render at
   41px / 25px / 56px respectively, and the select clips its own text. */
.wizard-step .form-control {
    border: 1px solid #d4d8dd;
    border-radius: 4px;
    padding: 9px 12px;
    height: 42px;
    line-height: 1.5;
    box-sizing: border-box;
    font-size: 14px;
    color: #2b2b2b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Bootstrap ships `select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}`,
   and this site sets a ~10px root font-size, so that rem value collapses the
   select to ~25px and clips the chosen option. The :not() qualifiers here are
   to match that rule's specificity, not because they filter anything.
   Selects also centre their text themselves, so vertical padding would only
   eat into the content box -- horizontal padding only. Native arrow kept. */
.wizard-step select.form-control:not([size]):not([multiple]) {
    height: 42px;
    padding: 0 12px;
}

.wizard-step textarea.form-control {
    height: auto;
    min-height: 64px;
}

/* File inputs need room for the browser's own "Choose file" button. */
.wizard-step input[type="file"].form-control {
    height: auto;
    padding: 8px 12px;
}

.wizard-step .form-control:focus {
    border-color: #eca413;
    box-shadow: 0 0 0 3px rgba(236, 164, 19, 0.15);
    outline: none;
}

.wizard-step .form-control::placeholder {
    color: #a8adb3;
}

/* Within a row, a label that wraps to two lines must not shove its own input
   below its neighbours'. Making each column a flex column and letting the
   label absorb the slack keeps every input on the same line. */
@media (min-width: 768px) {
    .wizard-step .form-group.row,
    .wizard-step .form-group > .row {
        display: flex;
        flex-wrap: wrap;
    }

    .wizard-step .form-group.row > [class*="col-"],
    .wizard-step .form-group > .row > [class*="col-"] {
        display: flex;
        flex-direction: column;
    }

    .wizard-step .form-group.row > [class*="col-"] > label,
    .wizard-step .form-group > .row > [class*="col-"] > label {
        flex: 1 0 auto;
        display: flex;
        align-items: flex-end;
    }
}

/* Declarations read as a checklist rather than a wall of text. */
.wizard-step label.d-block {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

.wizard-step label.d-block:last-child {
    border-bottom: 0;
}

/* Inline server-validation messages, rendered next to the offending field
   by wizard.js -- in addition to the summary list at the top of the form. */
.is-invalid {
    border-color: #dc3545 !important;
}

.wizard-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Collapse the labeled stepper into a compact "Step X of N" line on narrow screens */
@media (max-width: 576px) {
    .wizard-progress-step .label {
        display: none;
    }

    .wizard-progress-text {
        display: block;
        text-align: center;
        font-size: 13px;
        color: #0b2545;
        font-weight: 700;
        margin-bottom: 10px;
    }
}

@media (min-width: 577px) {
    .wizard-progress-text {
        display: none;
    }
}
