/* ═══════════════════════════════════════════════════
   Returns Portal — Clean SaaS Design
   ═══════════════════════════════════════════════════ */

:root {
    --rp-bg: #f6f7f9;
    --rp-card: #ffffff;
    --rp-primary: #111827;
    --rp-primary-hover: #1f2937;
    --rp-text: #111827;
    --rp-text-secondary: #4b5563;
    --rp-text-muted: #9ca3af;
    --rp-border: #e5e7eb;
    --rp-border-light: #f3f4f6;
    --rp-accent: var(--rp-shop-accent, #111827);
    --rp-success: #16a34a;
    --rp-success-bg: #f0fdf4;
    --rp-success-border: #bbf7d0;
    --rp-warning: #d97706;
    --rp-warning-bg: #fffbeb;
    --rp-warning-border: #fde68a;
    --rp-danger: #dc2626;
    --rp-danger-bg: #fef2f2;
    --rp-danger-border: #fecaca;
    --rp-info: #2563eb;
    --rp-info-bg: #eff6ff;
    --rp-info-border: #bfdbfe;
    --rp-radius: 12px;
    --rp-radius-sm: 8px;
    --rp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rp-shadow: 0 1px 3px rgba(0,0,0,.06);
    --rp-shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --rp-transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--rp-font);
    background: var(--rp-bg);
    color: var(--rp-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────── */

.rp-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px 80px;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */

.rp-header {
    text-align: center;
    padding: 48px 0 8px;
}

.rp-logo {
    max-height: 44px;
    margin-bottom: 4px;
}

.rp-shop-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--rp-text-muted);
    margin-top: 4px;
}

/* ── Progress Bar ───────────────────────────────── */

.rp-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 32px 0 8px;
}

.rp-progress-step {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--rp-text-muted);
    white-space: nowrap;
}

.rp-progress-step.active {
    color: var(--rp-text);
    font-weight: 600;
}

.rp-progress-step.done {
    color: var(--rp-success);
}

.rp-progress-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--rp-border);
    background: var(--rp-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--rp-text-muted);
    margin-right: 8px;
    flex-shrink: 0;
    transition: all .3s ease;
}

.rp-progress-step.active .rp-progress-dot {
    border-color: var(--rp-primary);
    background: var(--rp-primary);
    color: #fff;
}

.rp-progress-step.done .rp-progress-dot {
    border-color: var(--rp-success);
    background: var(--rp-success);
    color: #fff;
}

.rp-progress-line {
    width: 40px;
    height: 2px;
    background: var(--rp-border);
    margin: 0 12px;
    flex-shrink: 0;
}

.rp-progress-step.done + .rp-progress-line,
.rp-progress-line.done {
    background: var(--rp-success);
}

/* ── Typography ─────────────────────────────────── */

.rp-page-header {
    text-align: center;
    padding: 32px 0 28px;
}

.rp-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--rp-text);
    letter-spacing: -.3px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.rp-subtitle {
    font-size: 15px;
    color: var(--rp-text-secondary);
    line-height: 1.5;
}

/* ── Cards ──────────────────────────────────────── */

.rp-card {
    background: var(--rp-card);
    border-radius: var(--rp-radius);
    border: 1px solid var(--rp-border);
    padding: 24px;
    margin-bottom: 12px;
}

.rp-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--rp-text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rp-border-light);
}

/* ── Form Elements ──────────────────────────────── */

.rp-form-group { margin-bottom: 16px; }

.rp-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--rp-text);
    margin-bottom: 6px;
}

.rp-input, .rp-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    font-size: 15px;
    font-family: var(--rp-font);
    color: var(--rp-text);
    background: var(--rp-card);
    transition: border-color var(--rp-transition), box-shadow var(--rp-transition);
    appearance: none;
    -webkit-appearance: none;
}

.rp-input:focus, .rp-select:focus {
    outline: none;
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}

.rp-input::placeholder { color: var(--rp-text-muted); }

.rp-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%239ca3af' d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Buttons ────────────────────────────────────── */

.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--rp-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--rp-font);
    cursor: pointer;
    transition: all var(--rp-transition);
    text-decoration: none;
}

.rp-btn-primary {
    background: var(--rp-primary);
    color: #fff;
    width: 100%;
    padding: 16px 28px;
}

.rp-btn-primary:hover {
    background: var(--rp-primary-hover);
    box-shadow: var(--rp-shadow-md);
}

.rp-btn-primary:active {
    transform: scale(.985);
}

.rp-btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

.rp-btn-outline {
    background: var(--rp-card);
    color: var(--rp-text);
    border: 1px solid var(--rp-border);
}

.rp-btn-outline:hover {
    background: var(--rp-bg);
    border-color: #d1d5db;
}

.rp-btn-success {
    background: var(--rp-success);
    color: #fff;
    width: 100%;
    padding: 16px 28px;
}

.rp-btn-success:hover {
    background: #15803d;
    box-shadow: var(--rp-shadow-md);
}

/* ── Product Items ──────────────────────────────── */

.rp-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rp-border-light);
}

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

.rp-item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--rp-radius-sm);
    object-fit: cover;
    background: var(--rp-bg);
    flex-shrink: 0;
}

.rp-item-img-placeholder {
    width: 64px;
    height: 64px;
    border-radius: var(--rp-radius-sm);
    background: var(--rp-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rp-text-muted);
    font-size: 22px;
    flex-shrink: 0;
}

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

.rp-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--rp-text);
    margin-bottom: 2px;
}

.rp-item-variant {
    font-size: 13px;
    color: var(--rp-text-muted);
}

.rp-item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-text);
    margin-top: 4px;
}

/* ── Stepper (Status Page) ──────────────────────── */

.rp-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0;
    margin: 0 0 32px;
    list-style: none;
}

.rp-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    text-align: center;
}

.rp-step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rp-card);
    border: 2px solid var(--rp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--rp-text-muted);
    position: relative;
    z-index: 1;
    transition: all .3s ease;
}

.rp-step.done .rp-step-dot {
    background: var(--rp-success);
    border-color: var(--rp-success);
    color: #fff;
}

.rp-step.active .rp-step-dot {
    background: var(--rp-primary);
    border-color: var(--rp-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(17,24,39,.1);
}

.rp-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--rp-text-muted);
    margin-top: 8px;
    line-height: 1.3;
}

.rp-step.done .rp-step-label { color: var(--rp-success); font-weight: 600; }
.rp-step.active .rp-step-label { color: var(--rp-text); font-weight: 600; }

.rp-step-line {
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--rp-border);
}

.rp-step.done .rp-step-line { background: var(--rp-success); }

/* ── Status Badges ──────────────────────────────── */

.rp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.rp-badge-success { background: var(--rp-success-bg); color: var(--rp-success); border: 1px solid var(--rp-success-border); }
.rp-badge-warning { background: var(--rp-warning-bg); color: var(--rp-warning); border: 1px solid var(--rp-warning-border); }
.rp-badge-danger  { background: var(--rp-danger-bg);  color: var(--rp-danger);  border: 1px solid var(--rp-danger-border); }
.rp-badge-info    { background: var(--rp-info-bg);    color: var(--rp-info);    border: 1px solid var(--rp-info-border); }

/* ── Flash Messages ─────────────────────────────── */

.rp-flash {
    padding: 12px 16px;
    border-radius: var(--rp-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: rp-slide-down .3s ease-out;
}

@keyframes rp-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rp-flash-error   { background: var(--rp-danger-bg);  color: var(--rp-danger);  border: 1px solid var(--rp-danger-border); }
.rp-flash-success { background: var(--rp-success-bg); color: var(--rp-success); border: 1px solid var(--rp-success-border); }
.rp-flash-warning { background: var(--rp-warning-bg); color: var(--rp-warning); border: 1px solid var(--rp-warning-border); }

/* ── Result Icons ───────────────────────────────── */

.rp-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    animation: rp-pop .4s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes rp-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.rp-result-icon.success { background: var(--rp-success-bg); color: var(--rp-success); }
.rp-result-icon.blocked { background: var(--rp-danger-bg); color: var(--rp-danger); }

/* ── Reason List (Blocked) ──────────────────────── */

.rp-reason-list {
    list-style: none;
    padding: 0;
}

.rp-reason-list li {
    padding: 12px 16px;
    background: var(--rp-danger-bg);
    border: 1px solid var(--rp-danger-border);
    border-radius: var(--rp-radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rp-danger);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rp-reason-list li::before {
    content: '\F623';
    font-family: 'bootstrap-icons';
    flex-shrink: 0;
}

/* ── Rule Log ───────────────────────────────────── */

.rp-rule-log { margin: 8px 0; }

.rp-rule-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--rp-border-light);
}

.rp-rule-entry:last-child { border-bottom: none; }

.rp-rule-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rp-rule-dot.approved        { background: var(--rp-success); }
.rp-rule-dot.blocked         { background: var(--rp-danger); }
.rp-rule-dot.review_required { background: var(--rp-warning); }

/* ── Info Box ───────────────────────────────────── */

.rp-info-box {
    padding: 16px;
    background: var(--rp-bg);
    border-radius: var(--rp-radius-sm);
    border: 1px solid var(--rp-border-light);
}

.rp-info-box-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--rp-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.rp-info-box-content {
    font-size: 14px;
    font-weight: 500;
    white-space: pre-line;
    line-height: 1.6;
    color: var(--rp-text);
}

/* ── Steps (Confirm page) ─────────────────────── */

.rp-next-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--rp-border-light);
}

.rp-next-step:last-child { border-bottom: none; }

.rp-next-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rp-bg);
    border: 2px solid var(--rp-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--rp-text-secondary);
}

.rp-next-step h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-text);
    margin-bottom: 2px;
}

.rp-next-step p {
    font-size: 13px;
    color: var(--rp-text-muted);
    line-height: 1.5;
}

/* ── Notice Box ─────────────────────────────────── */

.rp-notice {
    padding: 14px 16px;
    border-radius: var(--rp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.rp-notice-warning {
    background: var(--rp-warning-bg);
    color: var(--rp-warning);
    border: 1px solid var(--rp-warning-border);
}

/* ── Hint ───────────────────────────────────────── */

.rp-hint {
    text-align: center;
    padding: 16px 0;
    font-size: 13px;
    color: var(--rp-text-muted);
}

/* ── Footer ─────────────────────────────────────── */

.rp-footer {
    text-align: center;
    padding: 48px 0 24px;
    font-size: 12px;
    color: var(--rp-text-muted);
}

/* ── Animations ─────────────────────────────────── */

.rp-fade-in {
    animation: rp-fade-up .4s ease-out both;
}

.rp-fade-in:nth-child(2) { animation-delay: .05s; }
.rp-fade-in:nth-child(3) { animation-delay: .1s; }
.rp-fade-in:nth-child(4) { animation-delay: .15s; }
.rp-fade-in:nth-child(5) { animation-delay: .2s; }
.rp-fade-in:nth-child(6) { animation-delay: .25s; }

@keyframes rp-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 480px) {
    .rp-wrapper { padding: 0 16px 60px; }
    .rp-header { padding: 32px 0 4px; }
    .rp-page-header { padding: 24px 0 20px; }
    .rp-title { font-size: 22px; }
    .rp-card { padding: 20px 16px; }
    .rp-progress { padding: 24px 0 4px; }
    .rp-progress-line { width: 24px; margin: 0 8px; }
    .rp-progress-step { font-size: 12px; }
    .rp-step-dot { width: 34px; height: 34px; font-size: 14px; }
    .rp-step-label { font-size: 11px; }
    .rp-step-line { top: 17px; left: calc(50% + 17px); width: calc(100% - 34px); }
    .rp-item-img, .rp-item-img-placeholder { width: 56px; height: 56px; }
    .rp-result-icon { width: 68px; height: 68px; font-size: 30px; }
}
