/* Retourenportal - Frontend Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --error: #dc2626;
    --error-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fefce8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0 20px;
}

.header h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.header .subtitle {
    color: var(--gray-500);
    font-size: 1rem;
}

.logo {
    max-height: 50px;
    margin-bottom: 16px;
}

/* Card */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    margin-bottom: 20px;
}

/* Steps */
.steps {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step.completed .step-label {
    color: var(--success);
}

.step + .step::before {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--gray-300);
    margin-right: 12px;
}

.step.active + .step::before,
.step.completed + .step::before {
    /* Keep default */
}

/* Forms */
.form {
    max-width: 450px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-hint {
    display: block;
    margin-top: 4px;
    color: var(--gray-500);
    font-size: 0.8rem;
}

.required {
    color: var(--error);
}

.input-small {
    width: 80px !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--primary-light);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Order Info */
.order-info {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.order-info h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.order-info p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Select All Bar */
.select-all-bar {
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.product-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.product-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
}

.product-checkbox {
    flex-shrink: 0;
}

.product-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-model {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.product-price {
    font-weight: 600;
    color: var(--gray-900);
}

/* No-Return Artikel */
.product-noreturn {
    opacity: 0.6;
    background: var(--gray-50);
}

.product-noreturn .product-main {
    cursor: default;
}

.product-noreturn-hint {
    color: var(--error);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

.product-return-options {
    padding: 16px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.product-return-options .form-group {
    margin-bottom: 12px;
}

.product-return-options .form-group:last-child {
    margin-bottom: 0;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.char-limit-reached {
    color: var(--error);
}

.resolution-group {
    padding: 0 16px;
    background: var(--gray-50);
}

.general-comment-group {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

/* Summary */
.summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.summary h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

/* Success */
.success-message {
    text-align: center;
    padding: 24px 0;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-light);
    color: var(--success);
    font-size: 2rem;
    margin-bottom: 16px;
}

.success-message h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.return-number {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* Summary Table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.summary-table th,
.summary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

.summary-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Return Summary */
.return-summary {
    margin: 24px 0;
}

.return-summary h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Next Steps */
.next-steps {
    margin: 24px 0;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.next-steps h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.next-steps ol {
    padding-left: 20px;
}

.next-steps li {
    margin-bottom: 8px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .step + .step::before {
        display: none;
    }

    .product-main {
        flex-wrap: wrap;
        gap: 12px;
    }

    .product-image {
        width: 60px;
        height: 60px;
    }

    .product-info {
        flex-basis: calc(100% - 100px);
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .summary-table {
        font-size: 0.85rem;
    }
}

/* Status badges (shared with admin) */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #dbeafe; color: #1e40af; }
.status-rejected { background: #fef2f2; color: #991b1b; }
.status-received { background: #d1fae5; color: #065f46; }
.status-refunded { background: #dcfce7; color: #166534; }
.status-cancelled { background: #f3f4f6; color: #4b5563; }

/* Return address block */
.return-address-block {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
}

.return-address-block h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.return-address-block address {
    font-style: normal;
    color: var(--gray-800);
    line-height: 1.6;
}
