/**
 * RVRSE Component Library — Brand Book V2
 * Buttons · Cards · Pills · Stats · Modals · Logo · Success icon
 * DEC-009
 */

/* ═══════════════════════════════════════════════════════════════════
   RVRSE LOGO COMPONENT
   ═══════════════════════════════════════════════════════════════════ */

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

.rvrse-logo-symbol {
  width: 32px;
  height: 32px;
  border-radius: 22%;
  background: linear-gradient(160deg, #10141c 0%, #070a11 55%, #03040a 100%);
  box-shadow: inset 0 1px 0 rgba(197, 206, 214, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.rvrse-logo-symbol::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22%;
  background: radial-gradient(120% 80% at 30% -10%, rgba(197, 206, 214, 0.09), transparent 55%);
  pointer-events: none;
}
.rvrse-logo-symbol svg {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.rvrse-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  height: 48px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Ivory fill (DEC-014) */
.btn-primary {
  background: var(--color-ivory);
  color: var(--color-obsidian);
  border-color: var(--color-ivory);
  font-weight: 600;
}
.btn-primary:hover { background: #ffffff; border-color: #ffffff; }

/* Secondary — Outlined */
.btn-secondary {
  background: transparent;
  color: var(--color-pearl);
  border-color: var(--border-steel);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--color-ivory); }

/* Ghost — Text only */
.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--color-ivory); background: rgba(255, 255, 255, 0.04); }

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--color-signal-red);
  border-color: rgba(196, 86, 79, 0.2);
}
.btn-danger:hover { border-color: rgba(196, 86, 79, 0.4); background: rgba(196, 86, 79, 0.06); }

/* Champagne — único botón con acento champán (Brand Book p.12) */
.btn-champagne {
  background: transparent;
  color: var(--color-champagne);
  border-color: var(--color-champagne);
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0;
}
.btn-champagne:hover {
  background: rgba(212, 175, 55, 0.07);
  border-color: var(--color-champagne);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.14);
}

/* ── Service CTAs ──────────────────────────────────────────────── */

.btn-directo {
  background: var(--color-directo);
  color: var(--color-obsidian);
  border-color: var(--color-directo);
  font-weight: 600;
}
.btn-directo:hover { background: var(--color-directo-dark); border-color: var(--color-directo-dark); color: var(--color-ivory); }

.btn-subasta {
  background: var(--color-subasta);
  color: var(--color-obsidian);
  border-color: var(--color-subasta);
  font-weight: 700;
}
.btn-subasta:hover { background: var(--color-subasta-dark); border-color: var(--color-subasta-dark); }

.btn-postor {
  background: var(--color-indigo);
  color: var(--color-ivory);
  border-color: var(--color-indigo);
  font-weight: 600;
}
.btn-postor:hover { background: var(--color-postor-dark); border-color: var(--color-postor-dark); }

/* ── Size Variants ───────────────────────────────────────────────── */

.btn-sm  { height: 36px; font-size: 12px; padding: 0 14px; letter-spacing: .03em; }
.btn-lg  { height: 56px; font-size: 16px; padding: 0 28px; font-weight: 600; }
.btn-xs  { height: 28px; font-size: 11px; padding: 0 10px; letter-spacing: .04em; }
.btn-full { width: 100%; }

/* Icon-only button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Loading state */
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════ */

.card {
  background: var(--color-graphite);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-card);
  padding: 20px;
}

.card-onyx {
  background: var(--color-onyx);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-card);
  padding: 20px;
}

.card-sm { padding: 14px; }
.card-lg { padding: 28px; }

.glass-panel {
  background: rgba(20, 25, 36, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* Interactive card (DEC-015) */
.card-interactive {
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-base);
}
.card-interactive:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Service-tinted hover glow */
.card-directo:hover { border-color: rgba(16, 185, 129, 0.3); box-shadow: var(--glow-directo); }
.card-subasta:hover { border-color: rgba(217, 119,   6, 0.3); box-shadow: var(--glow-subasta); }
.card-postor:hover  { border-color: rgba(76,  79,  184, 0.3); box-shadow: var(--glow-postor);  }

/* ═══════════════════════════════════════════════════════════════════
   PILLS / BADGES
   ═══════════════════════════════════════════════════════════════════ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  padding: 3px 10px;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-emerald   { background: rgba(14,  126,  94, 0.12); color: var(--color-emerald-soft);  border: 1px solid rgba(14,  126,  94, 0.25); }
.pill-indigo    { background: rgba(76,   79, 184, 0.12); color: #8B8EE0;                    border: 1px solid rgba(76,   79, 184, 0.25); }
.pill-amber     { background: rgba(200, 154,  74, 0.12); color: var(--color-signal-amber);  border: 1px solid rgba(200, 154,  74, 0.25); }
.pill-red       { background: rgba(196,  86,  79, 0.12); color: var(--color-signal-red);    border: 1px solid rgba(196,  86,  79, 0.25); }
.pill-steel     { background: rgba(30,   36,  50, 0.4);  color: var(--color-muted);          border: 1px solid var(--border-steel);        }
.pill-champagne { background: rgba(212, 175,  55, 0.10); color: var(--color-champagne);     border: 1px solid rgba(212, 175,  55, 0.28); }
.pill-disputa   { background: rgba(196,  86,  79, 0.12); color: var(--color-signal-red);    border: 1px solid rgba(196,  86,  79, 0.35); }

/* Service pills */
.pill-directo   { background: rgba(16,  185, 129, 0.10); color: var(--color-directo);  border: 1px solid rgba(16,  185, 129, 0.25); }
.pill-subasta   { background: rgba(217, 119,   6, 0.10); color: var(--color-subasta);  border: 1px solid rgba(217, 119,   6, 0.25); }
.pill-postor    { background: rgba(76,   79, 184, 0.10); color: #8B8EE0;               border: 1px solid rgba(76,   79, 184, 0.25); }

/* Status pills */
.pill-active    { background: rgba(14, 126, 94, 0.12);  color: var(--color-emerald-soft); border: 1px solid rgba(14, 126, 94, 0.25); }
.pill-pending   { background: rgba(200,154,74, 0.12);   color: var(--color-signal-amber); border: 1px solid rgba(200,154,74, 0.25); }
.pill-completed { background: rgba(30, 36, 50, 0.4);    color: var(--color-muted);         border: 1px solid var(--border-steel); }
.pill-cancelled { background: rgba(196,86, 79, 0.10);   color: var(--color-signal-red);   border: 1px solid rgba(196,86,79,0.2); }

/* ═══════════════════════════════════════════════════════════════════
   STAT CARDS  (dashboard KPI blocks)
   ═══════════════════════════════════════════════════════════════════ */

.stat-card {
  background: var(--color-graphite);
  border: 1px solid var(--border-steel);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--color-ivory);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-delta {
  font-size: 12px;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-delta.up   { color: var(--color-emerald-soft); }
.stat-delta.down { color: var(--color-signal-red); }

/* ═══════════════════════════════════════════════════════════════════
   TIER CARDS  (membership tiers)
   ═══════════════════════════════════════════════════════════════════ */

.tier-card {
  background: var(--color-onyx);
  border-radius: var(--radius-tier);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.tier-access    { border: 1px solid var(--border-steel); }
.tier-esmeralda { border: 1px solid rgba(14, 126, 94, 0.33); }
.tier-onice     { border: 1px solid rgba(212, 175,  55, 0.33); }

/* ═══════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.active { display: flex; }

.modal-box {
  position: relative;
  background: var(--color-graphite);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-tier);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  animation: fadeInUp .2s ease;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}
.modal-close:hover { color: var(--color-ivory); background: rgba(255, 255, 255, 0.06); }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-steel);
}

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATION BADGES
   ═══════════════════════════════════════════════════════════════════ */

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-signal-red);
  position: absolute;
  top: 2px;
  right: 2px;
  pointer-events: none;
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--color-signal-red);
  color: var(--color-ivory);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   SUCCESS ICON  (exito / confirmado pages)
   ═══════════════════════════════════════════════════════════════════ */

.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
}
.success-icon-wrap::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.18;
  animation: pulseRing 2.4s ease-in-out infinite;
}

.success-directo  { background: rgba(14, 126, 94,  0.12); color: var(--color-emerald-soft); }
.success-subasta  { background: rgba(217,119,  6,  0.12); color: var(--color-subasta);      }
.success-postor   { background: rgba(76,  79, 184, 0.12); color: #8B8EE0;                   }
.success-generic  { background: rgba(14, 126,  94, 0.10); color: var(--color-emerald-soft); }

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
}
.empty-state-icon {
  color: var(--color-steel);
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   SERVICE ACCENT BARS  (top border tint on service cards)
   ═══════════════════════════════════════════════════════════════════ */

.service-bar {
  height: 2px;
  border-radius: 1px;
  width: 32px;
  margin-bottom: 12px;
}
.service-bar-directo { background: var(--color-directo); }
.service-bar-subasta { background: var(--color-subasta); }
.service-bar-postor  { background: var(--color-indigo);  }

/* ═══════════════════════════════════════════════════════════════════
   ESCROW / PRORATION TIMELINE
   ═══════════════════════════════════════════════════════════════════ */

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   DATA TABLE  (history, admin lists)
   ═══════════════════════════════════════════════════════════════════ */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-steel);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--color-pearl);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table tr:last-child td { border-bottom: none; }
