/* ==============================================
   TEKLLY WITHDRAWAL — Public Styles
   ============================================== */
:root {
    --twd-color-primary: #a0845c;
}

.twd-form-wrap {
    color: var( --twd-color-primary );
}


/* Wrap */
.twd-form-wrap {
    max-width: 53.75rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==============================================
   PASEK KROKÓW
   ============================================== */

.twd-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.twd-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    position: relative;
    flex: 1;
    max-width: 10rem;
}

.twd-step + .twd-step::before {
    content: '';
    position: absolute;
    top: 1.125rem;
    left: calc( -50% + 1.125rem );
    right: calc( 50% + 1.125rem );
    height: 0.125rem;
    background: #e0e0e0;
    z-index: 0;
}

.twd-step--done + .twd-step::before {
    background: currentColor;
}

.twd-step__number {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 0.125rem solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #999;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.twd-step__label {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    transition: all 0.2s;
}

.twd-step--active .twd-step__number {
    border-color: currentColor;
    background: currentColor;
    color: #fff;
}

.twd-step--active .twd-step__label {
    color: inherit;
    font-weight: 600;
}

.twd-step--done .twd-step__number {
    border-color: currentColor;
    color: inherit;
}

/* ==============================================
   PANEL
   ============================================== */

.twd-panel--hidden {
    display: none;
}

/* ==============================================
   KARTA
   ============================================== */

.twd-card {
    background: #fff;
    border: 0.0625rem solid #e8e8e8;
    border-radius: 0.75rem;
    padding: 2rem;
}

.twd-card__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    background: #f5f0eb;
    border-radius: 1.25rem;
    padding: 0.1875rem 0.75rem;
    margin-bottom: 0.75rem;
}

.twd-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.twd-card__desc {
    color: #666;
    margin: 0 0 1.5rem;
}

/* ==============================================
   INFO BAR
   ============================================== */

.twd-info-bar {
    background: #f0f4ff;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #444;
    margin-top: 1.5rem;
}

/* ==============================================
   BŁĄD
   ============================================== */

.twd-error {
    background: #fff3f3;
    border: 0.0625rem solid #f5c6c6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #c00;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ==============================================
   POLA FORMULARZA
   ============================================== */

.twd-field {
    margin-bottom: 1.25rem;
}

.twd-field--hidden {
    display: none;
}

.twd-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.twd-optional {
    font-weight: 400;
    color: #999;
    font-size: 0.8125rem;
    margin-left: 0.25rem;
}

.twd-field__hint {
    font-size: 0.8125rem;
    color: #888;
    margin: 0 0 0.5rem;
}

.twd-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 0.0625rem solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.twd-input:focus {
    border-color: currentColor;
}

.twd-textarea {
    resize: vertical;
    min-height: 6.25rem;
}

.twd-char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.25rem;
}

/* ==============================================
   PRZYCISKI
   ============================================== */

.twd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, background 0.15s;
    text-decoration: none;
}

.twd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.twd-btn--primary {
    background: #111;
    color: #fff;
}

.twd-btn--primary:hover {
    opacity: 0.85;
}

.twd-btn--ghost {
    background: transparent;
    color: #444;
    border: 0.0625rem solid #ddd;
}

.twd-btn--ghost:hover {
    background: #f5f5f5;
}

.twd-btn--link {
    background: transparent;
    color: #444;
    text-decoration: underline;
}

.twd-btn--full {
    width: 100%;
}

/* ==============================================
   POWODY ZWROTU
   ============================================== */

.twd-reasons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.twd-reason {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ==============================================
   LAYOUT KROKU 2
   ============================================== */

.twd-step2-layout {
    display: grid;
    grid-template-columns: 1fr 13.75rem;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.twd-step2-bottom {
    border-top: 0.0625rem solid #e8e8e8;
    padding-top: 1.5rem;
}

.twd-step2-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Sidebar */
.twd-step2-sidebar {
    background: #f9f9f9;
    border: 0.0625rem solid #e8e8e8;
    border-radius: 0.625rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.twd-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.twd-sidebar-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.twd-sidebar-label {
    font-size: 0.6875rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
    margin-bottom: 0.125rem;
}

.twd-sidebar-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Responsive */
@media ( max-width: 40rem ) {
    .twd-step2-layout {
        grid-template-columns: 1fr;
    }

    .twd-step2-sidebar {
        order: -1;
    }

    .twd-step2-actions {
        flex-direction: column-reverse;
    }

    .twd-btn--ghost {
        width: 100%;
    }

    .twd-reasons {
        grid-template-columns: 1fr;
    }
}

/* ==============================================
   PRODUKTY
   ============================================== */

.twd-product {
    display: flex;
    flex-direction: column;
    border: 0.0625rem solid #e8e8e8;
    border-radius: 0.625rem;
    margin-bottom: 0.625rem;
    overflow: hidden;
    transition: border-color 0.15s;
}

.twd-product:has( .twd-product__checkbox:checked ) {
    border-color: currentColor;
}

.twd-product--disabled {
    opacity: 0.6;
}

.twd-product__label {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
}

.twd-product--disabled .twd-product__label {
    cursor: default;
}

.twd-product__checkbox {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    cursor: pointer;
}

.twd-product__image {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.twd-product__info {
    flex: 1;
}

.twd-product__name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.twd-product__qty {
    font-size: 0.8125rem;
    color: #888;
}

.twd-product__expired {
    background: #fffbf0;
    border-top: 0.0625rem solid #f0e0b0;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* ==============================================
   KROK 3 — POTWIERDZENIE
   ============================================== */

.twd-card--confirmation {
    text-align: center;
}

.twd-confirmation-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: #e6f4ea;
    color: #2e7d32;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.twd-confirmation-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.twd-confirmation-meta__item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    text-align: left;
}

.twd-confirmation-details {
    background: #f9f9f9;
    border-radius: 0.625rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.twd-confirmation-details h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.twd-confirmation-details h4 {
    margin: 1rem 0 0.625rem;
    font-size: 0.875rem;
}

.twd-confirmation-order-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.twd-conf-product {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0;
    border-bottom: 0.0625rem solid #e8e8e8;
}

.twd-conf-product:last-child {
    border-bottom: none;
}

.twd-confirmation-next {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f5f5f5;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #555;
}

.twd-confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media ( max-width: 40rem ) {
    .twd-card {
        padding: 1.25rem 1rem;
    }

    .twd-step2-layout {
        grid-template-columns: 1fr;
    }

    .twd-step2-sidebar {
        order: -1;
    }

    .twd-step2-actions {
        flex-direction: column-reverse;
    }

    .twd-btn--ghost {
        width: 100%;
    }

    .twd-reasons {
        grid-template-columns: 1fr;
    }

    .twd-confirmation-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .twd-confirmation-order-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.twd-step__number, .twd-reason {
    color: var(--base);
    line-height: 1;
}

.twd-step--active .twd-step__number {
    border-color: var(--secondary) !important;
    background-color: var(--secondary) !important;
    color: #FFF;
}
.twd-step--done + .twd-step::before {
    background-color: var(--secondary) !important;
}
.twd-step--done .twd-step__number, .twd-product:has( .twd-product__checkbox:checked ) {
    border-color:  var(--secondary) !important;
}

.twd-card__desc, .twd-label, .twd-field__hint, .twd-input, .twd-product__qty,  .twd-product__name, .twd-reason {
    color: rgba(29, 29, 29, 0.8);
}

.twd-input:focus, .twd-sidebar-value {
    color: var(--base);
}
.twd-product__checkbox, .twd-reason {
    accent-color: var(--base);
}
.twd-reasons {
    margin-top: 1rem;
}

.twd-product__expired {
    background: rgba(201,154,84, 0.4);
    color: var(--base);
}
.twd-product--disabled {
    opacity: 0.7;
}