:root {
    --bg-page: #0b1120;
    --bg-card: #131d32;
    --bg-card-alt: #1e293b;
    --bg-input: #0f172a;
    --border-color: #27354f;
    --border-focus: #3b82f6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --brand-blue: #2563eb;
    --brand-blue-hover: #1d4ed8;
    --brand-glow: rgba(37, 99, 235, 0.25);
    --green-success: #10b981;
    --amber-warning: #f59e0b;
    --red-danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.rma-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 24px;
}

.rma-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rma-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.rma-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.rma-badge-service {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rma-nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.rma-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.rma-nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Layout container */
.rma-container {
    max-width: 980px;
    margin: 36px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.rma-page-intro {
    text-align: center;
    margin-bottom: 32px;
}

.rma-page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 8px;
}

.rma-page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards & Sections */
.rma-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 34px;
    margin-bottom: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
}

.rma-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.rma-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--brand-blue);
    color: #ffffff;
    border-radius: 50%;
    font-size: 14.5px;
    font-weight: 700;
}

/* Form controls */
.rma-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.rma-grid-full {
    grid-column: 1 / -1;
}

.rma-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rma-label {
    font-size: 14.5px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rma-label .req {
    color: var(--amber-warning);
    font-weight: 700;
}

.rma-label .hint {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 400;
}

.rma-input,
.rma-select,
.rma-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    padding: 13px 16px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.rma-input:focus,
.rma-select:focus,
.rma-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.rma-input::placeholder,
.rma-textarea::placeholder {
    color: var(--text-dim);
}

.rma-textarea {
    min-height: 140px;
    resize: vertical;
}

/* Toggle Pill Buttons */
.rma-toggle-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
}

.rma-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rma-toggle-btn.active {
    background: var(--bg-card-alt);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Warranty Verification Box */
.rma-warranty-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.rma-warranty-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rma-warranty-question:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rma-q-text {
    font-size: 14px;
    font-weight: 500;
    color: #f1f5f9;
}

.rma-q-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.rma-choice-group {
    display: flex;
    gap: 8px;
}

.rma-choice-opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
}

.rma-choice-opt input {
    display: none;
}

.rma-choice-opt.selected-yes {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--green-success);
    color: #6ee7b7;
    font-weight: 600;
}

.rma-choice-opt.selected-no {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--red-danger);
    color: #fca5a5;
    font-weight: 600;
}

/* Status Banners */
.rma-banner {
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-top: 18px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: fadeIn 0.25s ease-out;
}

.rma-banner.warranty {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #d1fae5;
}

.rma-banner.post-warranty {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef3c7;
}

.rma-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.rma-banner-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rma-banner.warranty .rma-banner-title {
    color: #34d399;
}

.rma-banner.post-warranty .rma-banner-title {
    color: #fbbf24;
}

.rma-banner-desc {
    font-size: 14.5px;
    line-height: 1.5;
    opacity: 0.95;
}

/* File Upload Dropzone */
.rma-dropzone {
    border: 2px dashed var(--border-color);
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.rma-dropzone:hover,
.rma-dropzone.dragover {
    border-color: var(--brand-blue);
    background: rgba(37, 99, 235, 0.08);
}

.rma-dropzone-icon {
    color: var(--brand-blue);
    margin-bottom: 8px;
}

.rma-dropzone-text {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.rma-dropzone-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

.rma-file-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rma-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
}

.rma-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
}

.rma-file-remove {
    background: none;
    border: none;
    color: var(--red-danger);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* Submit Button */
.rma-submit-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: var(--radius-sm);
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 16.5px;
    font-weight: 700;
    padding: 16px 32px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 14px var(--brand-glow);
}

.rma-submit-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.rma-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal Dialog */
.rma-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.rma-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.rma-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 580px;
    width: 100%;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: var(--transition);
}

.rma-modal-overlay.open .rma-modal-box {
    transform: scale(1);
}

/* Stepper / Timeline */
.rma-stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 28px 0;
}

.rma-stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.rma-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.rma-step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card-alt);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.rma-step-item.active .rma-step-circle {
    background: var(--brand-blue);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}

.rma-step-item.completed .rma-step-circle {
    background: var(--green-success);
    border-color: #34d399;
    color: #ffffff;
}

.rma-step-label {
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-dim);
    font-weight: 500;
    text-align: center;
}

.rma-step-item.active .rma-step-label {
    color: #ffffff;
    font-weight: 600;
}

/* Timeline entries */
.rma-timeline {
    position: relative;
    padding-left: 28px;
    margin-top: 20px;
}

.rma-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

.rma-tl-item {
    position: relative;
    margin-bottom: 22px;
}

.rma-tl-item:last-child {
    margin-bottom: 0;
}

.rma-tl-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--brand-blue);
}

.rma-tl-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.rma-tl-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.rma-tl-author {
    font-weight: 600;
    color: #38bdf8;
}

.rma-tl-msg {
    font-size: 14.5px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Badges */
.badge-warranty {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-post-warranty {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Footer */
.rma-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.rma-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.rma-footer a:hover {
    color: #ffffff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .rma-grid {
        grid-template-columns: 1fr;
    }
    .rma-warranty-question {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .rma-stepper::before {
        display: none;
    }
    .rma-step-label {
        font-size: 10px;
    }
}


/* Wyraźne podświetlenie błędów walidacji formularza */
.rma-input-error {
    border: 2px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.rma-field-error-msg {
    color: #f87171;
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease-out;
}

/* Żółte oznaczenie: WYMAGA ODPOWIEDZI */
.badge-needs-reply {
    background: #fef08a;
    color: #713f12;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #facc15;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.03em;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.25);
}

.row-needs-reply {
    border-left: 4px solid #facc15 !important;
    background: rgba(234, 179, 8, 0.04) !important;
}

@keyframes yellowPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.25); }
}

.pulse-yellow-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ca8a04;
    animation: yellowPulse 1.8s infinite;
}
