/* =====================================================
   remuvebg — Clean AI Workspace
   Design system: light, modern SaaS
   ===================================================== */

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

:root {
  --bg-page:      #F7F9FC;
  --bg-card:      #FFFFFF;
  --text:         #1E293B;
  --text-dark:    #0F172A;
  --text-muted:   #64748B;
  --border:       #E2E8F0;
  --border-card:  #DCE3F0;
  --accent:       #2563EB;
  --accent-hover: #1D4ED8;
  --accent-press: #1E40AF;
  --accent-light: #EFF6FF;
  --accent-glow:  rgba(37,99,235,0.12);
  --success:      #10B981;
  --danger:       #EF4444;
  --shadow-sm:    0 1px 4px rgba(15,23,42,0.07);
  --shadow-md:    0 4px 20px rgba(15,23,42,0.07);
  --shadow-lg:    0 8px 32px rgba(15,23,42,0.11);
  --shadow-blue:  0 0 0 4px rgba(37,99,235,0.12);
  --r-sm:         8px;
  --r-md:         14px;
  --r-lg:         24px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ─────────────────────────────────────────── */
.rb-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.rb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.rb-logo-text { display: flex; flex-direction: column; }

.rb-logo-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.rb-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.rb-header-badge {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* ── HERO ────────────────────────────────────────────── */
.rb-hero {
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF4FF 100%);
  text-align: center;
  padding: 64px 24px 52px;
  border-bottom: 1px solid var(--border);
}

.rb-hero-title {
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.rb-hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 400;
}

/* ── TOOL SECTION ───────────────────────────────────── */
.rb-tool-section {
  background: linear-gradient(180deg, #EEF4FF 0%, #F7F9FC 120px);
  padding: 40px 20px 56px;
}

.rb-tool-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* ── UPLOAD ZONE ────────────────────────────────────── */
.rb-upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border-card);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.rb-upload-zone:hover,
.rb-upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-blue), var(--shadow-md);
}

.rb-upload-zone.drag-over { border-style: solid; }

.rb-upload-inner { text-align: center; padding: 48px 32px; }

.rb-upload-icon { display: block; margin: 0 auto 20px; }

.rb-upload-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.rb-upload-or {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.rb-upload-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  font-weight: 400;
}

/* ── BUTTONS ────────────────────────────────────────── */
.rb-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  line-height: 1;
  font-family: inherit;
  min-height: 44px;
}

.rb-btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}

.rb-btn-primary:active {
  background: var(--accent-press);
  transform: translateY(1px);
}

.rb-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1;
  font-family: inherit;
  min-height: 44px;
}

.rb-btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.rb-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
  font-family: inherit;
  min-height: 44px;
}

.rb-btn-ghost:hover { color: var(--text); border-color: #94A3B8; }

.rb-btn-download {
  font-size: 16px;
  padding: 14px 36px;
}

/* ── PROCESSING ─────────────────────────────────────── */
.rb-processing {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 56px 40px;
  text-align: center;
}

.rb-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 28px;
}

.rb-spinner-ring {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rb-spin 0.75s linear infinite;
}

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

/* Shimmer bars below spinner */
.rb-shimmer-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  margin: 20px auto 0;
}

.rb-shimmer {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #F0F4F8 25%, #E2E8F0 50%, #F0F4F8 75%);
  background-size: 600px 100%;
  animation: rb-shimmer 1.4s ease-in-out infinite;
}

.rb-shimmer:nth-child(2) { width: 70%; margin: 0 auto; }

@keyframes rb-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.rb-processing-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.rb-processing-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.rb-dots::after {
  content: '';
  animation: rb-dots 1.5s steps(4, end) infinite;
}

@keyframes rb-dots {
  0%   { content: '';    }
  25%  { content: '.';   }
  50%  { content: '..';  }
  75%  { content: '...'; }
  100% { content: '';    }
}

/* ── ERROR ──────────────────────────────────────────── */
.rb-error-state {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  padding: 48px 32px;
}

.rb-error-state svg { display: block; margin: 0 auto 16px; }

.rb-error-msg {
  font-size: 15px;
  color: var(--danger);
  margin-bottom: 24px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ── RESULT ─────────────────────────────────────────── */
.rb-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── BEFORE/AFTER SLIDER ────────────────────────────── */
.rb-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-md);
  cursor: ew-resize;
  user-select: none;
  box-shadow: var(--shadow-lg);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #dde2e8 25%, transparent 25%),
    linear-gradient(-45deg, #dde2e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dde2e8 75%),
    linear-gradient(-45deg, transparent 75%, #dde2e8 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  touch-action: none;
}

.rb-before {
  position: relative;
  width: 100%;
  line-height: 0;
}

.rb-before img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  object-position: center;
}

.rb-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
  line-height: 0;
}

.rb-after img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.rb-label {
  position: absolute;
  bottom: 10px;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  text-transform: uppercase;
}

.rb-label-left  { left: 10px; }
.rb-label-right { right: 10px; }

.rb-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  pointer-events: none;
}

.rb-handle-line {
  width: 2px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.rb-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 16px rgba(15,23,42,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  pointer-events: auto;
  cursor: ew-resize;
  transition: transform 0.15s;
  border: 2px solid var(--border);
}

.rb-handle-circle:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 4px 20px rgba(37,99,235,0.2);
}

/* ── COLOR PANEL ────────────────────────────────────── */
.rb-bg-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.rb-bg-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rb-colors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.rb-color {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-card);
  min-height: 32px;
}

.rb-color:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.rb-color.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.rb-color-transparent { background: #fff; }

.rb-color-custom {
  color: var(--text-muted);
  background: var(--bg-page);
}

.rb-color-custom:hover { color: var(--accent); }

.rb-color-custom input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* ── ACTIONS ────────────────────────────────────────── */
.rb-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── SHARE ──────────────────────────────────────────── */
.rb-share {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.rb-share-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.rb-share .ya-share2 { line-height: 0; }

/* ── PROMO SECTION ──────────────────────────────────── */
.rb-promo {
  background: var(--bg-card);
  padding: 72px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rb-promo-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.rb-promo-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.rb-promo-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  line-height: 1.2;
}

.rb-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.rb-promo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  gap: 8px;
}

.rb-promo-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.rb-promo-card:hover .rb-promo-icon svg * {
  stroke: var(--accent);
}

.rb-promo-icon { margin-bottom: 6px; transition: all 0.2s; }

.rb-promo-icon svg * { transition: stroke 0.2s; }

.rb-promo-card strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  display: block;
}

.rb-promo-card span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rb-promo-arrow {
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
}

/* ── HOW IT WORKS ───────────────────────────────────── */
.rb-how {
  background: var(--bg-page);
  padding: 72px 24px;
}

.rb-how-inner {
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.rb-how h2 {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.rb-steps {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.rb-step {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  text-align: center;
}

.rb-step-num {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}

.rb-step strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.rb-step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.rb-step-arrow {
  font-size: 24px;
  color: var(--border);
  line-height: 1;
  margin-top: 16px;
  align-self: flex-start;
  padding-top: 20px;
  font-weight: 300;
}

/* ── FAQ ────────────────────────────────────────────── */
.rb-faq {
  background: var(--bg-card);
  padding: 72px 24px;
  border-top: 1px solid var(--border);
}

.rb-faq-inner {
  max-width: 680px;
  margin: 0 auto;
}

.rb-faq h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  text-align: center;
}

.rb-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
  background: var(--bg-card);
}

.rb-faq-item:hover { box-shadow: var(--shadow-sm); }

.rb-faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  transition: color 0.15s;
}

.rb-faq-item summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 16px;
}

.rb-faq-item[open] summary::after { content: '−'; }
.rb-faq-item[open] summary { color: var(--accent); }

.rb-faq-item p {
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ── FOOTER ─────────────────────────────────────────── */
.rb-footer {
  background: var(--text-dark);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 24px;
}

.rb-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px 32px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.rb-footer-logo {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.rb-footer-logo:hover { color: var(--accent); }

.rb-footer-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  flex: 1;
  min-width: 200px;
}

.rb-footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.rb-footer-nav a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.rb-footer-nav a:hover { color: #fff; }

/* ── PWA INSTALL BUTTON ─────────────────────────────── */
#rb-pwa-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  box-shadow: 0 2px 10px rgba(37,99,235,0.35);
  flex-shrink: 0;
}
#rb-pwa-btn:hover { background: var(--accent-hover); }
#rb-pwa-btn svg { flex-shrink: 0; }
#rb-pwa-btn .rb-pwa-main { display: block; font-size: 14px; font-weight: 700; }
#rb-pwa-btn .rb-pwa-sub  { display: block; font-size: 11px; opacity: 0.88; }

@media (min-width: 768px) {
  #rb-pwa-btn { display: none !important; }
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 640px) {
  .rb-header { padding: 0 16px; height: 60px; }
  .rb-header-badge { display: none; }
  .rb-hero { padding: 40px 16px 32px; }
  .rb-tool-section { padding: 24px 12px 40px; }

  .rb-promo-grid { grid-template-columns: 1fr; }
  .rb-promo-card { flex-direction: row; text-align: left; gap: 14px; padding: 20px; }
  .rb-promo-icon { flex-shrink: 0; }
  .rb-promo-card strong, .rb-promo-card span, .rb-promo-arrow { text-align: left; }

  .rb-steps { flex-direction: column; align-items: center; }
  .rb-step-arrow { transform: rotate(90deg); margin: 0; padding: 0; }

  .rb-bg-panel { padding: 12px 14px; gap: 10px; }
  .rb-actions { justify-content: stretch; }
  .rb-btn-primary, .rb-btn-ghost { flex: 1; justify-content: center; }

  .rb-footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .rb-promo { padding: 48px 16px; }
  .rb-how  { padding: 48px 16px; }
  .rb-faq  { padding: 48px 16px; }
}

@media (max-width: 400px) {
  .rb-color { width: 28px; height: 28px; border-radius: 6px; }
  .rb-colors { gap: 6px; }
}
