/* =========================================================
   STEP-BY-STEP FORM
   Все стили изолированы внутри .step-by-step-form
   ========================================================= */

.step-by-step-form {
    --sbs-primary: #aa0101;
    --sbs-primary-hover: #8b0101;
    --sbs-primary-soft: #edf5ff;

    --sbs-text: #333333;
    --sbs-text-secondary: #657083;
    --sbs-text-muted: #8b95a5;

    --sbs-border: #e3e8ef;
    --sbs-border-hover: #c8d1dd;

    --sbs-bg: #f4f7fa;
    --sbs-white: #ffffff;

    --sbs-danger: #d92d3d;
    --sbs-danger-bg: #fff2f3;

    --sbs-success: #159570;
    --sbs-success-bg: #ecfbf5;

    width: 100%;
    color: var(--sbs-text);

    box-sizing: border-box;
}

.step-by-step-form *,
.step-by-step-form *::before,
.step-by-step-form *::after {
    box-sizing: border-box;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.step-by-step-container-fluid {
    width: 100%;
    padding: 56px 24px 42px;
}

.step-by-step-container {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
}


/* =========================================================
   HERO
   ========================================================= */
.step-by-step-title {
    font-size: 32px;
    font-weight: 700;
}
.step-by-step-subtitle {
    max-width: 590px;
    margin: 17px auto 0;

    color: var(--sbs-text-secondary);

    font-size: 18px;
    line-height: 1.6;
}

.step-by-step-benefits {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px 22px;

    margin-top: 20px;
}

.step-by-step-benefit {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--sbs-text-secondary);

    font-size: 13px;
    font-weight: 500;
}

.step-by-step-benefit i {
    color: var(--sbs-primary);
    font-size: 15px;
}


/* =========================================================
   CARD
   ========================================================= */

.step-by-step-card {
    position: relative;

    background: var(--sbs-white);

    border: 1px solid #e6ebf1;
    border-radius: 24px;

    box-shadow:
        0 18px 60px rgba(25, 42, 70, .08),
        0 3px 12px rgba(25, 42, 70, .03);

    overflow: hidden;
}

.step-by-step-form-element {
    width: 100%;
}


/* =========================================================
   PROGRESS
   ========================================================= */

.step-by-step-progress-wrapper {
    padding: 23px 30px 20px;

    background: #fbfcfd;
    border-bottom: 1px solid #edf0f4;
}

.step-by-step-progress-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 11px;
}

.step-by-step-progress-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.step-by-step-progress-label {
    color: var(--sbs-text);

    font-size: 13px;
    font-weight: 700;
}

.step-by-step-progress-percent {
    color: var(--sbs-primary);

    font-size: 13px;
    font-weight: 800;
}

.step-by-step-progress {
    width: 100%;
    height: 6px;

    overflow: hidden;

    background: #e8edf3;
    border-radius: 999px;
}

.step-by-step-progress-bar {
    height: 100%;
    background: #388286;
    border-radius: inherit;
    transition:
        width .45s cubic-bezier(.4, 0, .2, 1);
}

.step-by-step-progress-hint {
    margin-top: 8px;
    color: var(--sbs-text-muted);
    font-size: 11px;
}


/* =========================================================
   SERVER STATUS
   ========================================================= */

/*
 * ВАЖНО:
 * По умолчанию элемент НЕ занимает место и НЕ рисует линию.
 * JS должен показывать его только через .step-by-step-status-message--visible
 */

.step-by-step-status-message {
    display: none !important;

    margin: 0;
    padding: 0;
}

.step-by-step-status-message.step-by-step-status-message--visible {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;

    margin: 18px 30px 0;
    padding: 13px 15px;

    color: var(--sbs-danger);
    background: var(--sbs-danger-bg);

    border: 1px solid #ffd6da;
    border-radius: 12px;

    font-size: 13px;
    line-height: 1.45;
}

.step-by-step-status-message.step-by-step-status-message--visible::before {
    content: "\f33a";

    flex: 0 0 auto;

    font-family: "bootstrap-icons";
    font-size: 16px;
}


/* =========================================================
   STEP
   ========================================================= */

.step-by-step-step {
    display: none;

    padding: 34px 30px 30px;
}

.step-by-step-step--active {
    display: block;

    animation:
        step-by-step-fade-in .28s ease;
}

@keyframes step-by-step-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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


/* =========================================================
   STEP INTRO
   ========================================================= */

.step-by-step-step-intro {
    display: flex;
    align-items: flex-start;
    gap: 15px;

    margin-bottom: 29px;
}

.step-by-step-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #388286;
    background: var(--sbs-primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.step-by-step-step-title {
    margin: 1px 0 5px;

    color: var(--sbs-text);

    font-size: 23px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.step-by-step-step-description {
    margin: 0;

    color: var(--sbs-text-secondary);

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   FIELDS
   ========================================================= */

.step-by-step-field {
    width: 100%;
}

.step-by-step-label {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 9px;

    color: var(--sbs-text);

    font-size: 13px;
    font-weight: 750;
}

/* =========================================================
   INPUTS
   ========================================================= */

.step-by-step-input-wrapper {
    position: relative;
}

.step-by-step-input-icon {
    position: absolute;
    left: 17px;
    top: 50%;

    z-index: 2;

    transform: translateY(-50%);

    color: #99a4b3;

    font-size: 17px;

    pointer-events: none;

    transition: color .2s ease;
}

.step-by-step-input-wrapper:focus-within
.step-by-step-input-icon {
    color: #388286;
}

.step-by-step-input,
.step-by-step-textarea {
    display: block;
    width: 100%;
    margin: 0;
    border: 1px solid var(--sbs-border);
    outline: none;
    color: var(--sbs-text);
    background: #fff;
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.step-by-step-input {
    min-height: 54px;

    padding: 0 17px 0 47px;

    border-radius: 13px;
}

.step-by-step-textarea {
    min-height: 145px;

    padding: 15px 17px;

    border-radius: 13px;

    resize: vertical;
}

.step-by-step-input::placeholder,
.step-by-step-textarea::placeholder {
    color: #a5afbc;
}

.step-by-step-input:hover,
.step-by-step-textarea:hover {
    border-color: #388286;
}

.step-by-step-input:focus,
.step-by-step-textarea:focus {
    border-color: #388286;
    box-shadow:
        0 0 0 4px rgba(23, 105, 224, .10);
}

.step-by-step-input--error,
.step-by-step-textarea--error {
    border-color: var(--sbs-danger) !important;
    background: #fffafa;
}

.step-by-step-input--error:focus,
.step-by-step-textarea--error:focus {
    box-shadow:
        0 0 0 4px rgba(217, 45, 61, .09);
}

.step-by-step-field-error {
    margin-top: 7px;

    color: var(--sbs-danger);

    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   TEXTAREA
   ========================================================= */

.step-by-step-textarea-wrapper {
    position: relative;
}

.step-by-step-textarea-counter {
    position: absolute;
    right: 13px;
    bottom: 10px;

    padding: 3px 7px;

    border-radius: 6px;

    color: var(--sbs-text-muted);
    background: rgba(255, 255, 255, .9);

    font-size: 10px;

    pointer-events: none;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.step-by-step-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: 30px;
}

.step-by-step-actions--single {
    justify-content: flex-end;
}

.step-by-step-actions-right {
    display: flex;
    align-items: center;
    gap: 9px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.step-by-step-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 48px;

    padding: 0 20px;

    border: 1px solid transparent;
    border-radius: 11px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;

    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        color .18s ease;
}

.step-by-step-button:active {
    transform: translateY(1px);
}

.step-by-step-button--primary {
    min-width: 155px;

    color: #fff;
    background: var(--sbs-primary);

    box-shadow:
        0 7px 18px rgba(23, 105, 224, .18);
}

.step-by-step-button--primary:hover {
    color: #fff;
    background: var(--sbs-primary-hover);

    box-shadow:
        0 9px 22px rgba(23, 105, 224, .24);

    transform: translateY(-1px);
}

.step-by-step-button--secondary {
    color: var(--sbs-text-secondary);
    background: #fff;
    border-color: var(--sbs-border);
}

.step-by-step-button--secondary:hover {
    color: var(--sbs-text);
    background: #f8fafc;
    border-color: var(--sbs-border-hover);
}

.step-by-step-button--link {
    min-height: 42px;
    padding: 0 10px;

    color: var(--sbs-text-muted);
    background: transparent;
}

.step-by-step-button--link:hover {
    color: var(--sbs-text);
    background: #f5f7fa;
}

.step-by-step-submit {
    min-width: 235px;
}

.step-by-step-submit--loading {
    opacity: .7;
    pointer-events: none;
}


/* =========================================================
   UPLOAD
   ========================================================= */

.step-by-step-upload {
    position: relative;

    overflow: hidden;

    border: 1.5px dashed #cbd7e5;
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #fbfdff 0%,
            #f5f9fd 100%
        );

    transition:
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.step-by-step-upload:hover {
    border-color: #9bb9df;
    background: #f8fbff;
}

.step-by-step-upload--drag-over {
    border-color: var(--sbs-primary);

    background: var(--sbs-primary-soft);

    box-shadow:
        0 0 0 4px rgba(23, 105, 224, .08);
}

.step-by-step-upload > input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.step-by-step-upload-label {
    display: flex;
    align-items: center;
    gap: 16px;

    min-height: 130px;

    padding: 24px;

    cursor: pointer;
}

.step-by-step-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #388286;
    background: #fff;

    box-shadow:
        0 4px 14px rgba(30, 70, 110, .08);

    font-size: 24px;
}

.step-by-step-upload-content {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.step-by-step-upload-title {
    color: var(--sbs-text);

    font-size: 14px;
    font-weight: 750;
}

.step-by-step-upload-description {
    margin-top: 3px;

    color: var(--sbs-text-secondary);

    font-size: 12px;
}

.step-by-step-upload-format {
    margin-top: 7px;

    color: var(--sbs-text-muted);

    font-size: 10px;
}


/* =========================================================
   FILE LIST
   ========================================================= */

.step-by-step-file-list {
    display: flex;
    flex-direction: column;
    gap: 7px;

    padding: 0 16px 16px;
}

.step-by-step-file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 40px;

    padding: 7px 9px;

    border: 1px solid #e5eaf0;
    border-radius: 9px;

    background: #fff;
}

.step-by-step-file-list-name {
    flex: 1;

    overflow: hidden;

    color: var(--sbs-text-secondary);

    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-by-step-file-list-remove {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 26px;

    width: 26px;
    height: 26px;

    padding: 0;

    border: 0;
    border-radius: 7px;

    color: #8b95a5;
    background: transparent;

    cursor: pointer;

    font-size: 17px;
}

.step-by-step-file-list-remove:hover {
    color: var(--sbs-danger);
    background: var(--sbs-danger-bg);
}

.step-by-step-file-error {
    display: none;

    margin: 0 16px 14px;

    color: var(--sbs-danger);

    font-size: 12px;
}

.step-by-step-file-error:not(:empty) {
    display: block;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.step-by-step-summary {
    margin-bottom: 27px;

    overflow: hidden;

    border: 1px solid #e6ebf1;
    border-radius: 15px;

    background: #fbfcfd;
}

.step-by-step-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 15px;

    border-bottom: 1px solid #e9edf2;

    color: var(--sbs-text);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.step-by-step-summary-header i {
    color: var(--sbs-success);
    font-size: 15px;
}

.step-by-step-summary-item {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 12px 15px;

    border-bottom: 1px solid #edf0f4;
}

.step-by-step-summary-item:last-child {
    border-bottom: 0;
}

.step-by-step-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #388286;
    background: var(--sbs-primary-soft);
    font-size: 14px;
}

.step-by-step-summary-content {
    display: flex;
    flex-direction: column;
    gap: 2px;

    min-width: 0;
}

.step-by-step-summary-label {
    color: var(--sbs-text-muted);

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.step-by-step-summary-value {
    overflow: hidden;
    color: var(--sbs-text);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   CONTACTS
   ========================================================= */

.step-by-step-contact-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 13px;
}

.step-by-step-contact-heading-title {
    color: var(--sbs-text);

    font-size: 14px;
    font-weight: 800;
}

.step-by-step-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}


/* =========================================================
   CONSENT
   ========================================================= */

.step-by-step-consent {
    margin-top: 20px;
}

.step-by-step-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.step-by-step-consent-checkbox {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin: 1px 0 0;

    accent-color: var(--sbs-primary);

    cursor: pointer;
}

.step-by-step-consent-label {
    color: var(--sbs-text-muted);

    font-size: 10px;
    line-height: 1.55;

    cursor: pointer;
}

.step-by-step-consent-label a {
    color: var(--sbs-text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.step-by-step-consent-label a:hover {
    color: var(--sbs-primary);
}

.step-by-step-consent--error {
    padding: 10px 12px;

    border-radius: 10px;

    background: var(--sbs-danger-bg);
}

.step-by-step-consent-error {
    display: none;

    margin-top: 7px;
    margin-left: 27px;

    color: var(--sbs-danger);

    font-size: 11px;
}

.step-by-step-consent--error .step-by-step-consent-error {
    display: block;
}


/* =========================================================
   SUBMIT NOTE
   ========================================================= */

.step-by-step-submit-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    margin-top: 13px;

    color: var(--sbs-text-muted);

    font-size: 10px;
}

.step-by-step-submit-note i {
    font-size: 10px;
}


/* =========================================================
   SUCCESS
   ========================================================= */

.step-by-step-success {
    padding: 65px 30px 70px;

    text-align: center;
}

.step-by-step-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 66px;
    height: 66px;

    margin: 0 auto 20px;

    border-radius: 50%;

    color: var(--sbs-success);
    background: var(--sbs-success-bg);

    font-size: 30px;
}

.step-by-step-success-title {
    margin: 0;

    color: var(--sbs-text);

    font-size: 25px;
    font-weight: 800;
}

.step-by-step-success-text {
    max-width: 430px;

    margin: 10px auto 0;

    color: var(--sbs-text-secondary);

    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .step-by-step-container-fluid {
        padding: 30px 12px 25px;
    }

    .step-by-step-hero {
        margin-bottom: 20px;
    }

    .step-by-step-subtitle {
        margin-top: 12px;

        font-size: 14px;
    }

    .step-by-step-benefits {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 8px;

        margin-top: 17px;
    }

    .step-by-step-benefit {
        justify-content: center;

        padding: 7px;

        border: 1px solid #e5ebf2;
        border-radius: 8px;

        background: #fff;

        font-size: 10px;
    }

    .step-by-step-benefit:last-child {
        grid-column: 1 / -1;
    }

    .step-by-step-card {
        border-radius: 18px;
    }

    .step-by-step-progress-wrapper {
        padding: 18px 18px 16px;
    }

    .step-by-step-step {
        padding: 27px 18px 22px;
    }

    .step-by-step-step-intro {
        gap: 11px;
        margin-bottom: 23px;
    }

    .step-by-step-step-number {
        flex-basis: 36px;

        width: 36px;
        height: 36px;

        border-radius: 10px;

        font-size: 10px;
    }

    .step-by-step-step-title {
        font-size: 20px;
    }

    .step-by-step-step-description {
        font-size: 12px;
    }

    .step-by-step-actions {
        margin-top: 23px;
    }

    .step-by-step-button {
        min-height: 46px;

        padding: 0 15px;

        font-size: 12px;
    }

    .step-by-step-button--primary {
        min-width: 135px;
    }

    .step-by-step-submit {
        min-width: 0;
        flex: 1;
    }

    .step-by-step-upload-label {
        min-height: 120px;

        padding: 18px 15px;

        gap: 11px;
    }

    .step-by-step-upload-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 20px;
    }

    .step-by-step-upload-title {
        font-size: 12px;
    }

    .step-by-step-upload-description {
        font-size: 10px;
    }

    .step-by-step-upload-format {
        font-size: 9px;
    }

    .step-by-step-contacts {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .step-by-step-contact-heading {
        flex-direction: column;
        gap: 3px;
    }

    .step-by-step-summary {
        margin-bottom: 22px;
    }

    .step-by-step-summary-item {
        padding: 10px 12px;
    }

    .step-by-step-summary-value {
        white-space: normal;
    }

    .step-by-step-submit-note {
        padding: 0 15px;
    }

    .step-by-step-status-message.step-by-step-status-message--visible {
        margin-right: 18px;
        margin-left: 18px;
    }

    .step-by-step-success {
        padding: 50px 20px 55px;
    }
}


@media (max-width: 420px) {

    .step-by-step-benefits {
        grid-template-columns: 1fr;
    }

    .step-by-step-benefit:last-child {
        grid-column: auto;
    }

    .step-by-step-actions {
        gap: 7px;
    }

    .step-by-step-actions-right {
        gap: 2px;
    }

    .step-by-step-button--link {
        padding-right: 6px;
        padding-left: 6px;
    }

    .step-by-step-button--primary {
        min-width: 120px;
    }
}