/* ==========================================================================
   F-Tech Returns Manager — Frontend Form
   All colors use CSS custom properties set dynamically by PHP.
   ========================================================================== */

.ftech-return-form-wrap {
    --ftech-rf-primary: #FD7900;
    --ftech-rf-primary-hover: #E56D00;
    --ftech-rf-success: #17A74C;
    --ftech-rf-error: #EF4444;
    --ftech-rf-text: #121317;
    --ftech-rf-text-secondary: #6B7280;
    --ftech-rf-bg-card: #FFFFFF;
    --ftech-rf-bg-light: #F4F5F7;
    --ftech-rf-border: #E5E7EB;
    --ftech-rf-bar-bg: #121317;
    --ftech-rf-bar-text: #FFFFFF;
    --ftech-rf-radius: 8px;
    --ftech-rf-font: inherit;

    max-width: 640px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: var(--ftech-rf-font);
    color: var(--ftech-rf-text);
    -webkit-font-smoothing: antialiased;
}

.ftech-return-form-wrap *,
.ftech-return-form-wrap *::before,
.ftech-return-form-wrap *::after {
    box-sizing: border-box;
}

.ftech-rf-step {
    display: none;
}

.ftech-rf-step--active {
    display: block;
    animation: ftechFadeIn 0.3s ease;
}

@keyframes ftechFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ftech-rf-card {
    background: var(--ftech-rf-bg-card);
    border: 1px solid var(--ftech-rf-border);
    border-radius: var(--ftech-rf-radius);
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ftech-rf-card--success {
    text-align: center;
    padding: 48px 32px;
}

.ftech-rf-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ftech-rf-text);
    font-family: var(--ftech-rf-font);
}

.ftech-rf-desc {
    font-size: 14px;
    color: var(--ftech-rf-text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

.ftech-rf-field {
    margin-bottom: 20px;
}

.ftech-rf-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ftech-rf-text);
    font-family: var(--ftech-rf-font);
}

.ftech-rf-field label .required {
    color: var(--ftech-rf-error);
}

.ftech-rf-field input[type="text"],
.ftech-rf-field input[type="email"],
.ftech-rf-field input[type="number"],
.ftech-rf-field select,
.ftech-rf-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ftech-rf-border);
    border-radius: var(--ftech-rf-radius);
    font-size: 14px;
    color: var(--ftech-rf-text);
    background: var(--ftech-rf-bg-card);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--ftech-rf-font);
}

.ftech-rf-field input:focus,
.ftech-rf-field select:focus,
.ftech-rf-field textarea:focus {
    border-color: var(--ftech-rf-primary);
    box-shadow: 0 0 0 3px rgba(253, 121, 0, 0.12);
}

.ftech-rf-field textarea {
    resize: vertical;
    min-height: 100px;
}

.ftech-rf-hint {
    display: block;
    font-size: 12px;
    color: var(--ftech-rf-text-secondary);
    margin-top: 4px;
}

.ftech-rf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    border: none;
    border-radius: var(--ftech-rf-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--ftech-rf-font);
}

.ftech-rf-btn--primary {
    background: var(--ftech-rf-primary);
    color: #fff;
    width: 100%;
}

.ftech-rf-btn--primary:hover {
    background: var(--ftech-rf-primary-hover);
}

.ftech-rf-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ftech-rf-btn--secondary {
    background: var(--ftech-rf-bg-light);
    color: var(--ftech-rf-text);
    border: 1px solid var(--ftech-rf-border);
}

.ftech-rf-btn--secondary:hover {
    background: var(--ftech-rf-border);
}

.ftech-rf-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.ftech-rf-actions .ftech-rf-btn--primary {
    width: auto;
    flex: 1;
}

.ftech-rf-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: var(--ftech-rf-error);
    padding: 10px 14px;
    border-radius: var(--ftech-rf-radius);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.ftech-rf-order-summary {
    background: var(--ftech-rf-bg-light);
    border: 1px solid var(--ftech-rf-border);
    border-radius: var(--ftech-rf-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.ftech-rf-order-summary strong {
    color: var(--ftech-rf-text);
}

.ftech-rf-order-summary span {
    color: var(--ftech-rf-text-secondary);
}

.ftech-rf-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.ftech-rf-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid var(--ftech-rf-border);
    border-radius: var(--ftech-rf-radius);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.ftech-rf-product:hover {
    border-color: #D1D5DB;
}

.ftech-rf-product--selected {
    border-color: var(--ftech-rf-primary);
    background: #FFF8F0;
}

.ftech-rf-product__check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ftech-rf-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ftech-rf-product--selected .ftech-rf-product__check {
    background: var(--ftech-rf-primary);
    border-color: var(--ftech-rf-primary);
}

.ftech-rf-product--selected .ftech-rf-product__check::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ftech-rf-product__img {
    width: 48px;
    height: 48px;
    border-radius: calc(var(--ftech-rf-radius) - 2px);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--ftech-rf-bg-light);
}

.ftech-rf-product__info {
    flex: 1;
    min-width: 0;
}

.ftech-rf-product__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ftech-rf-text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ftech-rf-product__meta {
    font-size: 12px;
    color: var(--ftech-rf-text-secondary);
}

.ftech-rf-product__qty {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ftech-rf-product__qty label {
    font-size: 11px;
    color: var(--ftech-rf-text-secondary);
    margin: 0;
}

.ftech-rf-product__qty input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--ftech-rf-border);
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    font-family: var(--ftech-rf-font);
}

.ftech-rf-product__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--ftech-rf-primary);
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
}

.ftech-rf-refund-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--ftech-rf-bar-bg);
    border-radius: var(--ftech-rf-radius);
    color: var(--ftech-rf-bar-text);
    font-size: 15px;
    margin-bottom: 8px;
    font-family: var(--ftech-rf-font);
}

.ftech-rf-refund-total strong {
    color: var(--ftech-rf-primary);
    font-size: 18px;
}

.ftech-rf-dropzone {
    border: 2px dashed var(--ftech-rf-border);
    border-radius: var(--ftech-rf-radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ftech-rf-dropzone:hover,
.ftech-rf-dropzone--active {
    border-color: var(--ftech-rf-primary);
    background: #FFF8F0;
}

.ftech-rf-dropzone p {
    margin: 0;
    font-size: 13px;
    color: var(--ftech-rf-text-secondary);
}

.ftech-rf-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.ftech-rf-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--ftech-rf-bg-light);
    border-radius: calc(var(--ftech-rf-radius) - 2px);
    font-size: 12px;
}

.ftech-rf-file-item__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ftech-rf-file-remove {
    background: none;
    border: none;
    color: var(--ftech-rf-error);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.ftech-rf-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ftech-rf-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.ftech-rf-btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.ftech-rf-btn--loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ftechSpin 0.6s linear infinite;
}

@keyframes ftechSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .ftech-rf-card {
        padding: 24px 18px;
    }

    .ftech-rf-product {
        flex-wrap: wrap;
    }

    .ftech-rf-product__price {
        min-width: auto;
    }

    .ftech-rf-order-summary {
        grid-template-columns: 1fr;
    }
}
