.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 40px 0;
    padding: 0 12px;
    position: relative;
    width: calc(100% - 24px);
    max-width: 600px;
    overflow: visible;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 2px;
    min-width: 35px;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--tg-theme-bg-color);
    border: 2px solid var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    border-color: var(--tg-theme-button-color);
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.step.completed .step-circle {
    background-color: var(--tg-theme-bg-color);
    border-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.step-title {
    font-size: 10px;
    margin-top: 8px;
    color: var(--tg-theme-hint-color);
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45px;
    min-height: 16px;
    display: block;
    text-align: center;
    line-height: 1.2;
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.step.active .step-title {
    color: var(--tg-theme-text-color);
    font-weight: 600;
    font-size: 11px;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    z-index: 3;
    background-color: var(--tg-theme-bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step.completed .step-title {
    color: var(--tg-theme-text-color);
}

/* Base line */
.step-indicator::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: var(--tg-theme-hint-color);
    z-index: 0;
    width: calc(100% - 40px);
}

/* Progress line */
.step-indicator::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    height: 2px;
    background-color: var(--tg-theme-button-color);
    z-index: 0;
    transition: width 0.3s ease;
}

/* Set progress width based on current step for 3 steps */
.step-indicator:not(.has-four-steps)[data-current="0"]::after { width: 0; }
.step-indicator:not(.has-four-steps)[data-current="1"]::after { width: calc(50% - 20px); }
.step-indicator:not(.has-four-steps)[data-current="2"]::after { width: calc(100% - 40px); }

/* Set progress width based on current step for 4 steps */
.step-indicator.has-four-steps[data-current="0"]::after { width: 0; }
.step-indicator.has-four-steps[data-current="1"]::after { width: calc(33.33% - 20px); }
.step-indicator.has-four-steps[data-current="2"]::after { width: calc(66.66% - 20px); }
.step-indicator.has-four-steps[data-current="3"]::after { width: calc(100% - 40px); }

/* Base line adjustments */
.step-indicator:not(.has-four-steps)::before {
    right: calc(40px + 16.66%);
}

.step-indicator.has-four-steps::before {
    right: 40px;
}

.step-check {
    font-size: 16px;
    color: var(--tg-theme-text-color);
}

.step-number {
    font-size: 14px;
    font-weight: 600;
}

/* Container adjustments for 4 steps */
.step-indicator.has-four-steps {
    padding: 0 8px;
}

.step-indicator.has-four-steps .step {
    min-width: 30px;
}

.step-indicator.has-four-steps .step-title {
    font-size: 9px;
    max-width: 35px;
}

.step-indicator.has-four-steps .step.active .step-title {
    font-size: 10px;
}

/* Form transitions */
.form-step {
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 16px;
    border-top: 1px solid var(--tg-theme-hint-color);
    position: fixed;
    bottom: 0;
    background-color: var(--tg-theme-bg-color);
    width: calc(100% - 32px);
    left: 0;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
}

@media screen and (max-width: 640px) {
    .form-navigation {
        width: 100%;
        max-width: 100%;
    }
}

.nav-button {
    padding: 10px 20px;
    border-radius: var(--tg-border-radius);
    border: none;
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    max-width: 160px;
    flex: 1;
    margin: 0 8px;
}

.nav-button:disabled {
    display: none;
    cursor: not-allowed;
    opacity: 0.5;
} 