/**
 * TW Steps / Kroki
 */

.tw-steps {
    --tw-steps-marker-size: 56px;
    --tw-steps-line-thickness: 3px;
    position: relative;
}

/* ── HORIZONTAL ── */

.tw-steps--horizontal {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.tw-steps--horizontal .tw-steps__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tw-steps--horizontal .tw-steps__body {
    margin-top: 16px;
}

.tw-steps--horizontal > .tw-steps__line {
    position: absolute;
    top: calc(var(--tw-steps-marker-size) / 2);
    left: calc(var(--tw-steps-marker-size) / 2);
    right: calc(var(--tw-steps-marker-size) / 2);
    height: var(--tw-steps-line-thickness);
    transform: translateY(-50%);
    z-index: 0;
}

/* ── VERTICAL ── */

.tw-steps--vertical {
    display: flex;
    flex-direction: column;
}

.tw-steps--vertical .tw-steps__item {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding-bottom: 30px;
}

.tw-steps--vertical .tw-steps__item:last-child {
    padding-bottom: 0;
}

.tw-steps--vertical .tw-steps__body {
    margin-left: 16px;
    padding-top: 4px;
}

.tw-steps--vertical > .tw-steps__line {
    position: absolute;
    top: calc(var(--tw-steps-marker-size) / 2);
    bottom: calc(var(--tw-steps-marker-size) / 2);
    left: calc(var(--tw-steps-marker-size) / 2);
    width: var(--tw-steps-line-thickness);
    transform: translateX(-50%);
    z-index: 0;
}

/* ── ALTERNATE ── */

.tw-steps--alternate > .tw-steps__line {
    left: 50% !important;
    transform: translateX(-50%);
}

.tw-steps--alternate .tw-steps__item {
    width: 50%;
    align-self: flex-start;
    padding-right: 30px;
    flex-direction: row-reverse;
    text-align: right;
}

.tw-steps--alternate .tw-steps__item .tw-steps__body {
    margin-left: 0;
    margin-right: 16px;
}

.tw-steps--alternate .tw-steps__item:nth-child(even) {
    align-self: flex-end;
    flex-direction: row;
    text-align: left;
    padding-right: 0;
    padding-left: 30px;
}

.tw-steps--alternate .tw-steps__item:nth-child(even) .tw-steps__body {
    margin-right: 0;
    margin-left: 16px;
}

/* ── LINIA ── */

.tw-steps__line {
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.tw-steps__line-progress {
    background-color: #1B8C6A;
    border-radius: 2px;
}

/* Horizontal: progress rośnie w prawo */
.tw-steps--horizontal > .tw-steps__line > .tw-steps__line-progress {
    height: 100%;
    width: 0;
}

/* Vertical: progress rośnie w dół */
.tw-steps--vertical > .tw-steps__line > .tw-steps__line-progress {
    width: 100%;
    height: 0;
}

/* ── MARKER ── */

.tw-steps__marker {
    width: var(--tw-steps-marker-size);
    height: var(--tw-steps-marker-size);
    min-width: var(--tw-steps-marker-size);
    border-radius: 50%;
    background-color: #1B8C6A;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.tw-steps__marker i,
.tw-steps__marker svg {
    font-size: calc(var(--tw-steps-marker-size) * 0.4);
    width: calc(var(--tw-steps-marker-size) * 0.4);
    height: calc(var(--tw-steps-marker-size) * 0.4);
}

/* ── TREŚĆ ── */

.tw-steps__title {
    margin: 0 0 8px 0;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.tw-steps__content {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

/* ── MOBILE (< 768px) ── */

@media (max-width: 767px) {
    .tw-steps--horizontal {
        flex-direction: column !important;
    }

    .tw-steps--horizontal .tw-steps__item {
        flex: none;
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding-bottom: 30px;
    }

    .tw-steps--horizontal .tw-steps__item:last-child {
        padding-bottom: 0;
    }

    .tw-steps--horizontal .tw-steps__body {
        margin-top: 0;
        margin-left: 16px;
        padding-top: 4px;
    }

    .tw-steps--horizontal > .tw-steps__line {
        top: calc(var(--tw-steps-marker-size) / 2);
        bottom: calc(var(--tw-steps-marker-size) / 2);
        left: calc(var(--tw-steps-marker-size) / 2);
        right: auto;
        width: var(--tw-steps-line-thickness);
        height: auto;
        transform: translateX(-50%);
    }

    .tw-steps--horizontal > .tw-steps__line > .tw-steps__line-progress {
        width: 100%;
        height: 0;
    }

    .tw-steps--alternate .tw-steps__item,
    .tw-steps--alternate .tw-steps__item:nth-child(even) {
        width: 100%;
        align-self: stretch;
        flex-direction: row;
        text-align: left;
        padding-left: 0;
        padding-right: 0;
    }

    .tw-steps--alternate .tw-steps__item .tw-steps__body,
    .tw-steps--alternate .tw-steps__item:nth-child(even) .tw-steps__body {
        margin-left: 16px;
        margin-right: 0;
    }

    .tw-steps--alternate > .tw-steps__line {
        left: calc(var(--tw-steps-marker-size) / 2) !important;
    }
}
