/* FastReturn – Odstąpienie od umowy */

/* ===== PRZYCISK TRIGGER ===== */
.fastreturn-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
}

.fastreturn-wrapper--align-left   { justify-content: flex-start; }
.fastreturn-wrapper--align-center { justify-content: center; }
.fastreturn-wrapper--align-right  { justify-content: flex-end; }

.fastreturn-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--fr-btn-color, #FF6600);
    color: var(--fr-btn-text-color, #fff);
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    line-height: 1;
}

.fastreturn-trigger-btn:hover,
.fastreturn-trigger-btn:focus {
    opacity: 0.88;
    color: var(--fr-btn-text-color, #fff);
    outline: none;
    text-decoration: none;
    transform: translateY(-1px);
}

.fastreturn-trigger-btn:active {
    transform: translateY(0);
}

.fastreturn-trigger-btn svg {
    flex-shrink: 0;
}

/* ===== SEKCJA NA STRONIE ZAMÓWIENIA ===== */
.fastreturn-order-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.fr-order-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.fr-days-left-info {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
}

.fr-expired-notice {
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    color: #6c757d;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}

/* ===== MODAL – własna implementacja, niezależna od Bootstrap ===== */

.fr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.fr-modal--open {
    display: flex;
}

.fr-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 1.75rem auto;
    pointer-events: none;
    padding: 0 1rem;
    box-sizing: border-box;
}

.fr-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    pointer-events: all;
    box-sizing: border-box;
}

.fr-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.fr-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #212529;
}

.fr-modal__title-ref {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
}

.fr-modal__body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.fr-modal-close {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    color: #6c757d;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.fr-modal-close:hover,
.fr-modal-close:focus {
    opacity: 1;
    background: rgba(0, 0, 0, 0.07);
    color: #212529;
    outline: none;
}

/* ===== STEP INDICATOR ===== */
.fr-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.fr-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.fr-step-active {
    background: var(--fr-btn-color, #FF6600);
    color: var(--fr-btn-text-color, #fff);
}

.fr-step-done {
    background: #28a745;
    color: #fff;
}

.fr-step-line {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    max-width: 60px;
    margin: 0 4px;
}

.fr-step-line-done {
    background: #28a745;
}

.fr-step-label {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 1rem;
    margin-top: 0;
}

/* ===== ALERT ===== */
.fr-alert {
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    display: none;
}

.fr-alert--danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.fr-alert--success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.fr-alert--warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.fr-alert--info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.fr-alert--light {
    color: #383d41;
    background-color: #f8f9fa;
    border-color: #d6d8db;
}

/* ===== EXCLUDED PRODUCTS ===== */
.fr-product-item--excluded {
    background: #f8f9fa;
}

.fr-product-label--excluded {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: normal;
    opacity: 0.55;
    cursor: not-allowed;
}

.fr-product-check-placeholder {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #ced4da;
    border-radius: 3px;
    background: #e9ecef;
    display: inline-block;
}

.fr-excluded-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== PRODUCT LIST ===== */
.fr-product-list {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.fr-product-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.fr-product-item:last-child {
    border-bottom: none;
}

.fr-product-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.fr-product-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fr-product-name {
    flex: 1;
    font-weight: 500;
}

.fr-product-qty {
    color: #6c757d;
    font-size: 0.875rem;
    white-space: nowrap;
}

.fr-product-ref {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ===== CONFIRM SUMMARY ===== */
.fr-confirm-summary {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #d6d8db;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.fr-confirm-summary ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

/* ===== LEGAL NOTICE ===== */
.fr-legal-notice {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    color: #856404;
    margin-bottom: 1rem;
}

/* ===== FORM FIELDS ===== */
.fr-field {
    position: static;
    margin-bottom: 1rem;
}

.fr-field--mt {
    margin-top: 1rem;
}

.fr-field label {
    position: static;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.35rem;
    padding: 0;
    transform: none;
    pointer-events: auto;
    background: transparent;
    line-height: 1.4;
    text-align: left;
    float: none;
    width: auto;
}

.fr-input {
    position: static;
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    height: auto;
    transform: none;
    box-sizing: border-box;
}

.fr-input:focus {
    border-color: var(--fr-btn-color, #FF6600);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    outline: none;
}

/* ===== BUTTONS ===== */
.fr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.fr-btn:focus {
    outline: 2px solid rgba(0, 0, 0, 0.15);
    outline-offset: 2px;
}

.fr-btn--secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.fr-btn--secondary:hover,
.fr-btn--secondary:focus {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
}

.fr-btn--primary {
    background-color: var(--fr-btn-color, #FF6600);
    border-color: var(--fr-btn-color, #FF6600);
    color: var(--fr-btn-text-color, #fff);
    font-weight: 600;
}

.fr-btn--primary:hover,
.fr-btn--primary:focus {
    opacity: 0.88;
    color: var(--fr-btn-text-color, #fff);
}

.fr-btn--primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.fr-btn--sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* ===== PHASE FOOTER ===== */
.fr-phase-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* ===== SPINNER ===== */
.fr-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: fr-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-left: 4px;
}

@keyframes fr-spin {
    to { transform: rotate(360deg); }
}

/* ===== TEXT UTILITIES (własne, nie z Bootstrap) ===== */
.fr-text-muted  { color: #6c757d; }
.fr-text-center { text-align: center; }
.fr-text-danger { color: #dc3545; }
.fr-text-small  { font-size: 0.85rem; }
.fr-mt-3        { margin-top: 1rem; }
.fr-mb-0        { margin-bottom: 0; }
.fr-py-4        { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.fr-py-3        { padding-top: 1rem; padding-bottom: 1rem; }
.fr-p-3         { padding: 1rem; }

/* ===== SUCCESS ===== */
.fr-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #28a745;
    color: #fff;
    font-size: 2rem;
    margin: 0 auto;
}

/* ===== ORDER HISTORY LIST ===== */
.fr-history-btn {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 4px 10px;
    margin-top: 4px;
}

.fr-history-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 3px;
    margin-top: 4px;
    line-height: 1.4;
}

.fr-badge-submitted {
    background: #e8f4e8;
    color: #28a745;
    border: 1px solid #c3e6cb;
}

.fr-badge-expired {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* ===== ADMIN FILTER FORM ===== */
.fr-filter-form .form-group {
    margin-bottom: 0.5rem;
}

/* ===== LOADING OVERLAY ===== */
.fr-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 575px) {
    .fr-modal__dialog {
        margin: 0.5rem auto;
    }

    .fr-phase-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .fr-phase-footer .fr-btn {
        width: 100%;
    }

    .fr-order-action {
        flex-direction: column;
        align-items: flex-start;
    }
}
