@import url("rushpay-brand.css");
@import url("rushpay-public.css");
@import url("rushpay-portal.css");
@import url("rushpay-dashboard.css");

:root {
  --rp-brand: #FF6B00;
  --rp-brand-hover: #E65100;
  --rp-brand-soft: #FF9248;
  --rp-brand-rgb: 255, 107, 0;
  --rp-success: #10B981;
  --rp-success-rgb: 16, 185, 129;
  --rp-warning: #FBBF24;
  --rp-danger: #EF4444;
  --rp-bg-deep: #1D1B1B;
  --rp-bg-elevated: #201E1E;
  --rp-surface: #1A1A1A;
  --rp-text: #FFFFFF;
  --rp-text-muted: #B8BCC8;
  --rp-font: "Inter", "Segoe UI", Arial, sans-serif;
  --admin-primary: var(--rp-brand);
  --admin-sidebar: #201E1E;
}

html {
  font-family: var(--rp-font);
}

[x-cloak] {
  display: none !important;
}

/* Portal shell stays visible while page content waits for Alpine */
body[data-rp-shell][x-cloak] {
  display: block !important;
}

body[data-rp-shell][x-cloak] .dashboard-content,
body[data-rp-shell][x-cloak] > .admin-shell > .admin-main > .admin-footer,
body[data-rp-shell][x-cloak] [data-rp-bottomnav] {
  visibility: hidden;
}

/* Public marketing + auth: keep header visible while Alpine boots (not portal shell) */
body.rp-public-body[x-cloak]:not([data-rp-shell]) {
  display: flex !important;
  flex-direction: column;
}

body.rp-public-body[x-cloak]:not([data-rp-shell]) [data-rp-public-header],
body.rp-public-body[x-cloak]:not([data-rp-shell]) .rp-public-header {
  display: block !important;
  visibility: visible !important;
}

body.rp-public-body[x-cloak]:not([data-rp-shell]) > main,
body.rp-public-body[x-cloak]:not([data-rp-shell]) > .auth-page,
body.rp-public-body[x-cloak]:not([data-rp-shell]) > footer,
body.rp-public-body[x-cloak]:not([data-rp-shell]) > .public-page-wrap {
  visibility: hidden;
}

body[data-rp-shell][x-cloak] .admin-shell,
body[data-rp-shell][x-cloak] [data-rp-topnav],
body[data-rp-shell][x-cloak] [data-rp-sidebar] {
  visibility: visible;
}

.rp-page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.rp-notify-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.rp-notify-backdrop.is-active {
  display: flex;
}

.rp-notify-backdrop.is-visible {
  opacity: 1;
}

.rp-notify-popup {
  position: relative;
  width: min(100%, 380px);
  margin: 0;
  padding: 1.35rem 1.35rem 1.15rem;
  border-radius: var(--rp-radius-lg, 18px);
  border: 1px solid var(--rp-glass-border);
  background: var(--rp-glass-bg);
  color: var(--rp-text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

html[data-theme="light"] .rp-notify-popup {
  background: var(--rp-surface, #fff);
  box-shadow: var(--rp-shadow-elevated, 0 28px 65px rgba(15, 23, 42, 0.18));
}

.rp-notify-backdrop.is-visible .rp-notify-popup {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rp-notify-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  color: var(--rp-text-muted);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.rp-notify-close:hover {
  color: var(--rp-text);
  background: rgba(var(--rp-brand-rgb), 0.1);
}

.rp-notify-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
}

.rp-notify-popup--success .rp-notify-icon {
  background: rgba(var(--rp-success-rgb), 0.16);
  color: var(--rp-success);
}

.rp-notify-popup--danger .rp-notify-icon {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
}

.rp-notify-popup--warning .rp-notify-icon {
  background: rgba(251, 191, 36, 0.18);
  color: #f59e0b;
}

.rp-notify-popup--info .rp-notify-icon {
  background: rgba(var(--rp-brand-rgb), 0.14);
  color: var(--rp-brand-soft);
}

.rp-notify-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--rp-text);
}

.rp-notify-message {
  margin: 0 0 1rem;
  color: var(--rp-text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

.rp-notify-action {
  min-width: 7rem;
  border-radius: 12px;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .rp-notify-backdrop {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .rp-notify-popup {
    width: 100%;
    border-bottom-left-radius: calc(var(--rp-radius-lg, 18px) - 2px);
    border-bottom-right-radius: calc(var(--rp-radius-lg, 18px) - 2px);
  }
}

.sidebar-section-label {
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-text-muted);
}

.sidebar-wallet {
  flex-shrink: 0;
  padding: 0.85rem 1rem 1rem;
  border-bottom: 1px solid var(--rp-glass-border);
}

.sidebar-wallet-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rp-text-muted);
  margin-bottom: 0.35rem;
}

.sidebar-wallet-balance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rp-text);
  line-height: 1.2;
}

.sidebar-balance-toggle {
  border: 0;
  background: transparent;
  color: var(--rp-text-muted);
  padding: 0;
  line-height: 1;
}

.sidebar-balance-toggle:hover {
  color: var(--rp-text);
}

.sidebar-wallet-name {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--rp-text-muted);
}

.sidebar-account {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--rp-glass-border);
}

.sidebar-account .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-account .nav-link[data-rp-logout-sidebar],
.sidebar-account .nav-link:last-child {
  color: #fca5a5;
}

.sidebar-account .nav-link[data-rp-logout-sidebar]:hover,
.sidebar-account .nav-link:last-child:hover {
  color: #fecaca;
}

.brand-mark .brand-title {
  font-weight: 700;
}

.rp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  justify-content: space-around;
  background: var(--admin-card-bg, #fff);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
}

.rp-bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.65rem;
  color: var(--rp-text-muted);
  text-decoration: none;
}

.rp-bottom-nav-link.active,
.rp-bottom-nav-link:hover {
  color: var(--rp-brand);
}

.rp-bottom-nav-link i {
  font-size: 1.2rem;
}

.rp-bottom-nav-menu {
  border: 0;
  background: transparent;
  transform: translateY(-0.35rem);
}

.rp-bottom-nav-menu i {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--admin-primary), #ff8c42);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.35);
}

@media (max-width: 991.98px) {
  body[data-rp-shell="user"] .dashboard-content {
    padding-bottom: 4.5rem;
  }
}

.auth-brand strong {
  color: var(--admin-primary);
}

.pin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pin-modal-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .pin-modal-card {
  background: #1e293b;
  color: #f8fafc;
}

.rp-coming-soon {
  border: 1px dashed rgba(100, 116, 139, 0.4);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.public-hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  color: var(--rp-text);
}

.public-stat {
  font-size: 1.75rem;
  font-weight: 700;
}

.admin-footer span a {
  text-decoration: none;
}
