:root {
  /* Common Brand Colors */
  --accent-gold: #d4af37;
  --primary-gradient: linear-gradient(135deg, #5b22e5 0%, #8f3bf8 100%);
  
  /* Light Mode Variables */
  --bg: #f9fafe;
  --bg-radial: radial-gradient(1200px 420px at 50% -60%, rgba(116, 80, 255, 0.22), transparent 60%);
  --text: #171925;
  --text-secondary: #6f7488;
  --card-bg: #ffffff;
  --card-border: rgba(90, 34, 225, 0.12);
  --panel-glass: rgba(255, 255, 255, 0.88);
  --panel-shadow: 0 30px 60px rgba(90, 34, 229, 0.08), 0 0 0 10px rgba(255, 255, 255, 0.4);
  --input-bg: #f8f9fc;
  --input-border: #eef0f7;
  --input-focus: #fff;
  --logo-bg: #fff;
  --logo-shadow: 0 12px 24px rgba(90, 34, 229, 0.15);
  --btn-shadow: 0 12px 24px rgba(90, 34, 229, 0.25);
  --btn-hover-shadow: 0 16px 32px rgba(90, 34, 229, 0.35);
  --title-glow: rgba(90, 34, 229, 0.2);
  --header-bg: rgba(246, 247, 251, 0.92);
  --stripe-bg: #f0f3f8;
}
* { box-sizing: border-box; }

body.pay-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-radial), var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.hidden { display: none !important; }

.glass {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
}

.handle-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.panel {
  width: min(440px, 100%);
  border-radius: 32px;
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  box-shadow: var(--panel-shadow);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.app-logo-wrapper {
  width: 100px;
  height: 100px;
  background: var(--logo-bg);
  border-radius: 28px;
  box-shadow: var(--logo-shadow), 0 0 0 6px rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.app-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 12px var(--title-glow);
  transition: text-shadow 0.3s ease;
}

.panel h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fcf6ba, #bf953f);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gold-shine 4s linear infinite;
  transition: all 0.3s ease;
}

@keyframes gold-shine {
  to {
    background-position: 200% center;
  }
}

.subtext {
  margin: 12px 0 32px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0 10px;
}

.handle-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  width: 100%;
}

.input-group label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  padding-right: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  right: 18px;
  font-weight: 800;
  color: var(--text-secondary);
  font-size: 1.34rem;
  pointer-events: none;
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.handle-form input {
  height: 60px;
  width: 100%;
  border-radius: 20px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0 45px 0 18px; /* Extra padding right for the @ icon */
  outline: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: monospace; /* makes handle look technical */
}

.handle-form input::placeholder {
  color: var(--text-secondary); /* Changed to use var */
  font-weight: 500;
  font-family: 'Tajawal', sans-serif;
}

.handle-form input:focus {
  box-shadow: 0 0 0 4px rgba(107, 67, 237, 0.1);
}

.handle-form input:focus ~ .input-icon {
  color: #6b43ed;
}

.hint {
  color: #8c90a6;
  font-size: 0.82rem;
  padding-right: 4px;
}

.primary-btn {
  height: 60px;
  border: 0;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.15rem;
  color: #fff;
  background: var(--primary-gradient);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--btn-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-hover-shadow);
}

.primary-btn:active {
  transform: translateY(1px);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.primary-btn:hover:not(:disabled) .btn-icon {
  transform: translateX(-4px); /* Moves left in RTL */
}

.user-preview {
  margin-top: 24px;
  border: 2px solid var(--input-border);
  background: var(--card-bg);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  width: 100%;
  box-shadow: 0 8px 16px rgba(0,0,0,0.03);
  animation: slideUpFade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: all 0.3s ease;
}

.user-preview .user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-preview img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.user-preview .user-details {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-preview .user-details-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-preview .user-details-handles {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-preview strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #1a1a2e);
}

.user-preview span {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Premium / Special Handle Styling ── */
@keyframes app-handle-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.app-handle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  vertical-align: middle;
  line-height: 1.2;
}

.handle-badge-icon {
  width: 1.2em;
  height: 1.2em;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.handle-at {
  font-weight: 800;
  opacity: 0.75;
}

.handle-text {
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Rare / Gold Shimmer */
.app-handle.app-handle--gold {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(
    100deg,
    #7a5a08 0%,
    #b88912 22%,
    #e8c859 42%,
    #fffbee 50%,
    #e8c859 58%,
    #b88912 78%,
    #7a5a08 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: app-handle-shimmer 4.2s ease-in-out infinite;
}

/* Premium / Blue Shimmer */
.app-handle.app-handle--blue {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(
    100deg,
    #0047ab 0%,
    #1e90ff 22%,
    #00bfff 42%,
    #e6f2ff 50%,
    #00bfff 58%,
    #1e90ff 78%,
    #0047ab 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: app-handle-shimmer 4.2s ease-in-out infinite;
}

/* Super Admin / Red Shimmer */
.app-handle.app-handle--red {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(
    100deg,
    #8b0000 0%,
    #dc2626 24%,
    #fca5a5 46%,
    #fff5f5 50%,
    #fca5a5 54%,
    #dc2626 76%,
    #8b0000 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: app-handle-shimmer 4.2s ease-in-out infinite;
}

/* Verified / Cyan Shimmer */
.app-handle.app-handle--cyan {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(
    100deg,
    #006064 0%,
    #00acc1 24%,
    #80deea 46%,
    #e0f7fa 50%,
    #80deea 54%,
    #00acc1 76%,
    #006064 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: app-handle-shimmer 4.2s ease-in-out infinite;
}

/* Handle Pills & Cluster */
.handle-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.handle-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}

.handle-pill--rare {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(245, 158, 11, 0.22));
  color: #b45309;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}

.handle-pill--premium {
  background: linear-gradient(135deg, rgba(30, 144, 255, 0.15), rgba(0, 191, 255, 0.2));
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}

.secondary-handle, .user-secondary-handle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  opacity: 0.85;
}

.error-box {
  margin-top: 16px;
  background: #fff0f0;
  border: 2px solid #ffe1e1;
  color: #d32f2f;
  border-radius: 16px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  width: 100%;
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.recharge-page-container {
  min-height: 100vh;
  direction: rtl;
}

.recharge-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.recharge-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--text);
}

.back-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  font-family: Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--accent-gold);
  box-shadow: var(--logo-shadow);
  min-width: 95px;
  justify-content: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.balance-badge img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}

.balance-badge span {
  font-weight: 800;
  color: var(--accent-gold);
  font-size: .9rem;
}

.recharge-content {
  padding: 0.25rem 0 3rem;
  max-width: 600px;
  margin: 0 auto;
}

.banner-carousel-container {
  position: relative;
  margin: 0 1rem 1.5rem;
  height: 120px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  background: var(--card-bg);
  direction: ltr;
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform .4s ease-out;
}

.banner-slide {
  min-width: 100%;
  height: 100%;
  cursor: pointer;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pagination-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: all .2s;
}

.dot.active {
  background: #fff;
  width: 12px;
  border-radius: 4px;
}

.current-balance-bar {
  margin: 0 1rem 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
}
.current-balance-bar .user-info-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-balance-bar .user-info-side .mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.current-balance-bar .user-profile-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  min-width: 0;
}

.current-balance-bar .user-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.current-balance-bar .user-account-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #1a1a2e);
  line-height: 1.3;
}

.current-balance-bar .user-handle-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.summary-account-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.current-balance-bar .balance-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.current-balance-bar .balance-info .coin-icon {
  width: 22px;
  height: 22px;
  animation: coin-glow 2s infinite ease-in-out;
  filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.5));
}

.current-balance-bar .balance-info .balance-amount {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
}

@keyframes coin-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.5)) brightness(1); }
  50% { filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.8)) brightness(1.3); }
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  padding: 0 .75rem;
}

.package-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.25rem;
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: var(--shadow);
  position: relative;
}

.package-card.featured {
  border: 1.5px solid var(--accent-gold);
}

.popularity-tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.discount-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #16A34A;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-bottom-left-radius: 12px;
  border-top-left-radius: 12px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  z-index: 20;
  line-height: 1;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.15);
  transform-origin: top right;
  direction: ltr;
}

.pkg-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

.pkg-icon-bg {
  width: 52px;
  height: 52px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.pkg-icon-bg img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.pkg-coins {
  font-size: 1.1rem;
  font-weight: 900;
  margin: 0;
}

.coin-text {
  font-size: .75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pkg-bonus {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  border: 0.5px solid rgba(212, 175, 55, 0.2);
}
.bonus-value {
  font-size: 0.7rem;
  font-weight: 800;
  color: #D4AF37;
}

.pkg-vip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 167, 38, .1);
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 167, 38, .2);
}

.vip-badge { font-size: .55rem; font-weight: 900; color: #FFA726; }
.vip-value { font-size: .7rem; font-weight: 800; color: #F44336; }

.pay-btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  width: 100%;
  padding: 9px 8px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 2.5rem;
  color: #16a34a;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
  padding: 0 1.2rem;
}

.security-info svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #16a34a;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed #d4d7e5;
  padding: 1.2rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(13, 10, 24, .48);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 999;
}

.modal-card {
  width: min(500px, 100%);
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  box-shadow: 0 30px 65px rgba(0,0,0,.4);
  padding: 14px;
  transition: all 0.3s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pay-summary {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  color: var(--text);
  transition: all 0.3s ease;
}

.pay-summary p {
  margin: 4px 0;
}

.stripe-card-wrapper {
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.stripe-card-wrapper:focus-within {
  border-color: #6b43ed;
  box-shadow: 0 0 0 4px rgba(107, 67, 237, 0.1);
}

.stripe-pay-btn {
  height: 52px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.stripe-pay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.success-box {
  background: #ecfdf3;
  border: 1px solid #b9f4d1;
  color: #047045;
  border-radius: 12px;
  text-align: center;
  padding: 14px;
  font-weight: 700;
}

/* ============================================================
   CARD PAY PAGE - Premium checkout
   ============================================================ */
.card-pay-body {
  background:
    radial-gradient(900px 380px at 50% -120px, rgba(91, 34, 229, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 28%),
    var(--bg);
}
.card-pay-container {
  min-height: 100vh;
  direction: rtl;
  display: flex;
  flex-direction: column;
}

.card-pay-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}

.card-pay-header h2 {
  font-size: 1.1rem;
  font-weight: 900;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--text);
}

.card-pay-content {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 16px 42px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-pay-hero {
  display: grid;
  gap: 14px;
}

.card-pay-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-pay-brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--logo-bg);
  box-shadow: 0 12px 24px rgba(90, 34, 229, 0.16);
  object-fit: contain;
}

.card-pay-brand span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.card-pay-brand strong {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.2;
}

.card-pay-visual {
  min-height: 170px;
  border-radius: 22px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(31, 24, 73, 0.24);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0) 34%),
    linear-gradient(145deg, #24165f 0%, #5b22e5 48%, #d4af37 140%);
}

.card-pay-visual::before,
.card-pay-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.card-pay-visual::before {
  width: 190px;
  height: 190px;
  left: -68px;
  top: -80px;
}

.card-pay-visual::after {
  width: 160px;
  height: 160px;
  right: -62px;
  bottom: -72px;
}

.card-chip {
  width: 42px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffe8a3, #b98b20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
  position: relative;
  z-index: 1;
}

.card-network {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.card-digits {
  position: relative;
  z-index: 1;
  direction: ltr;
  text-align: left;
  margin-top: 42px;
  font-family: Arial, sans-serif;
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-visual-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  direction: ltr;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255,255,255,0.72);
}

.card-pay-panel {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--card-border);
  padding: 24px;
  box-shadow: 0 22px 52px rgba(40, 32, 88, 0.1);
  display: flex;
  flex-direction: column;
}
.card-pay-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.card-pay-eyebrow {
  display: block;
  color: var(--accent-gold);
  font-size: 0.76rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.card-pay-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.34rem;
  font-weight: 900;
}

.card-brand-icons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  direction: ltr;
  flex-shrink: 0;
}

.card-brand-icons img {
  width: 78px;
  height: auto;
  display: block;
  object-fit: contain;
}
.card-pay-secure-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.18);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.card-pay-secure-badge svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.card-form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-form-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.card-form-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.card-form-label svg {
  display: none;
}

.card-form-input {
  width: 100%;
  min-height: 60px;
  position: relative;
  border: 1.5px solid var(--input-border);
  border-radius: 15px;
  background: var(--input-bg);
  padding: 19px 16px 15px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card-form-input.is-focused,
.card-form-input:focus-within {
  border-color: #6b43ed;
  background: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(107, 67, 237, 0.12);
}

.card-form-input.is-complete {
  border-color: rgba(16, 185, 129, 0.55);
}

.card-form-input.is-invalid {
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.card-form-input > div {
  width: 100%;
}

.card-form-input iframe {
  width: 100% !important;
  min-height: 22px !important;
  display: block !important;
}
.cardholder-name-input {
  color: var(--text);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

.cardholder-name-input::placeholder {
  color: #9aa3b2;
  font-weight: 600;
}

.card-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.76fr);
  gap: 12px;
}

.card-form-helper {
  margin: -2px 2px 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.55;
}

.card-form-divider {
  height: 1px;
  background: var(--input-border);
  margin: 22px 0 18px;
}

.card-pay-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.card-pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 2px 0;
}

.card-pay-summary-row .summary-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-pay-summary-row .summary-value {
  font-size: 0.94rem;
  font-weight: 900;
  color: var(--text);
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.card-pay-total-row {
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px dashed var(--input-border);
}

.card-pay-total-row .summary-value {
  color: #b8860b;
  font-size: 1.25rem;
  font-weight: 900;
}

.confirm-pay-btn {
  min-height: 58px;
  border: none;
  border-radius: 16px;
  font-weight: 900;
  font-size: 1.06rem;
  color: #fff;
  background: linear-gradient(135deg, #5b22e5 0%, #7c3aed 52%, #d4af37 150%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 28px rgba(90, 34, 229, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  font-family: 'Tajawal', sans-serif;
}

.confirm-pay-btn .pay-lock-icon {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.confirm-pay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(90, 34, 229, 0.36);
}

.confirm-pay-btn:active {
  transform: translateY(1px);
}

.confirm-pay-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.confirm-pay-btn.loading {
  opacity: 0.78;
  pointer-events: none;
}

#payBtnPrice {
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.94rem;
  direction: ltr;
}
.payment-security-note {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #16a34a;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  flex-direction: row-reverse;
}

.payment-security-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #16a34a;
}
.payment-security-badges {
  width: 82px;
  max-width: 32%;
  height: auto;
  display: block;
  margin: 6px auto 0;
  object-fit: contain;
  opacity: 0.82;
}

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 10, 24, 0.62);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 999;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.success-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  border: 1px solid var(--card-border);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
  animation: slideUpFade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.success-check {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
  box-shadow: 0 14px 28px rgba(16, 185, 129, 0.24);
}

.success-check svg {
  width: 32px;
  height: 32px;
}

.success-card h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
}

.success-card p {
  margin: 4px 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #10b981;
}

.success-vip-text {
  color: #FFA726 !important;
}

.success-breakdown {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 700;
}

.success-bonus {
  color: #D4AF37 !important;
}

.success-first {
  color: #8B5CF6 !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 480px) {
  .card-pay-content {
    padding: 16px 12px 32px;
  }

  .card-pay-panel {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .card-pay-brand strong {
    font-size: 1.12rem;
  }

  .card-pay-visual {
    min-height: 150px;
    padding: 18px;
    border-radius: 20px;
  }

  .card-digits {
    font-size: 0.98rem;
    margin-top: 34px;
  }

  .card-form-row {
    gap: 10px;
  }

  .card-form-input {
    min-height: 56px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .card-pay-panel-head h3 {
    font-size: 1.08rem;
  }
}
/* Card Pay Button in Modal */
.modal-card-pay {
  max-width: 400px;
}

.card-pay-btn {
  width: 100%;
  height: 60px;
  border: 2px solid var(--card-border);
  border-radius: 16px;
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
  direction: ltr;
}

.card-pay-btn:hover {
  border-color: #6b43ed;
  box-shadow: 0 0 0 4px rgba(107, 67, 237, 0.1);
  transform: translateY(-1px);
}

.card-pay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.card-pay-btn .card-icon {
  width: 26px;
  height: 26px;
  color: #6b43ed;
  flex-shrink: 0;
}

.card-pay-btn span {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.card-pay-btn .card-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Pay Summary Rows */
.pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.pay-summary-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.pay-summary-value {
  font-weight: 800;
  color: var(--text);
}

.vip-value-text {
  color: #FFA726;
}

.pay-summary-total {
  margin-top: 4px;
}

.pay-summary-price {
  font-size: 1.35rem;
  font-weight: 900;
  color: #b8860b;
}

.pay-summary-divider {
  height: 1px;
  background: var(--input-border);
  margin: 4px 0;
}

@media (max-width: 540px) {
  .packages-grid {
    gap: .7rem;
    padding: 0 .7rem;
  }

  .package-card {
    padding: 1.25rem 0.5rem;
  }
}

@media (max-width: 480px) {
.handle-page {
    padding: 16px 12px;
    justify-content: flex-start;
    padding-top: 5vh;
  }
  .header-section {
    margin-bottom: 16px;
  }
  .app-logo-wrapper {
    width: 85px;
    height: 85px;
    border-radius: 22px;
    margin-bottom: 8px;
  }
  .app-title {
    font-size: 1.8rem;
  }
  .panel {
    padding: 28px 20px;
    border-radius: 28px;
  }
  .panel h2 {
    font-size: 1.5rem;
  }
  .subtext {
    margin-bottom: 24px;
    font-size: 0.9rem;
  }
}

/* ========================================================
   Agency Top Bar & Badge
   ======================================================== */
.agency-top-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(107, 67, 237, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  padding: 10px 16px;
}

.agency-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agency-bar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agency-bar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6b43ed;
  box-shadow: 0 2px 8px rgba(107, 67, 237, 0.2);
}

.agency-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agency-bar-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
}

.agency-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6b43ed 0%, #8f3bf8 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(107, 67, 237, 0.25);
}

.agency-badge-pill svg {
  color: #ffeb3b;
}

.agency-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agency-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}














