:root {
  /* Colors - Purple Theme */
  --primary-dark: #1a0b2e;
  --primary-black: #0d0517;
  --primary-purple: #4a1f8c;
  --accent-purple: #642e8b;
  --accent-purple-light: #8e5ce6;
  --accent-purple-glow: rgba(100, 46, 139, 0.4);
  --accent-purple-soft: rgba(100, 46, 139, 0.15);
  --accent-purple-very-soft: rgba(100, 46, 139, 0.1);

  /* Neutrals */
  --text-white: #ffffff;
  --text-light: #e5e5e5;
  --text-muted: #b0bec5;
  --border-dark: #2d1454;
  --bg-card-dark: rgba(26, 11, 46, 0.7);
  --bg-card-light: rgba(255, 255, 255, 0.97);

  /* Success/Error/Warning */
  --color-success: #10b981;
  --color-success-soft: rgba(16, 185, 129, 0.15);
  --color-error: #ef4444;
  --color-error-soft: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b;
  --color-warning-soft: rgba(245, 158, 11, 0.15);

  /* Gradients */
  --gradient-purple: linear-gradient(135deg, #4a1f8c 0%, #642e8b 100%);
  --gradient-dark: linear-gradient(180deg, #1a0b2e 0%, #0d0517 50%, #251042 100%);

  /* Shared values */
  --blur-amount: blur(10px);
  --border-radius-sm: 0.5rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  --border-radius-xl: 1.5rem;
  --border-radius-full: 2rem;
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================================
   BASE & RESET
   =========================================== */
html, body {
  overflow-x: hidden !important;
}

body.modal-open {
  overflow: hidden !important;
}

body {
  background: var(--primary-black) !important;
  color: var(--text-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple-light); }

/* ===========================================
   KEYFRAME ANIMATIONS
   =========================================== */
@keyframes float1 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(80px, -60px); }
  50%  { transform: translate(-40px, 80px); }
  75%  { transform: translate(-80px, -40px); }
  100% { transform: translate(0, 0); }
}

@keyframes float2 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-60px, 80px); }
  50%  { transform: translate(80px, -40px); }
  75%  { transform: translate(40px, 60px); }
  100% { transform: translate(0, 0); }
}

@keyframes float3 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(60px, 60px); }
  50%  { transform: translate(-80px, -60px); }
  75%  { transform: translate(40px, -80px); }
  100% { transform: translate(0, 0); }
}

@keyframes float4 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-50px, -70px); }
  50%  { transform: translate(70px, 50px); }
  75%  { transform: translate(-60px, 30px); }
  100% { transform: translate(0, 0); }
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes dropdownOpen {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================================
   ANIMATED BACKGROUND
   =========================================== */
.animated-bg {
  position: fixed;
  inset: 0;
  background: var(--gradient-dark);
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.blob-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent-purple-glow) 0%, transparent 70%);
  top: -80px;
  left: -60px;
  animation: float1 7s infinite ease-in-out;
}

.blob-2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(74, 31, 140, 0.45) 0%, transparent 70%);
  bottom: 80px;
  right: -60px;
  animation: float2 9s infinite ease-in-out;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(142, 92, 230, 0.3) 0%, transparent 70%);
  top: 40%;
  left: 40%;
  animation: float3 6s infinite ease-in-out;
}

.blob-4 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--accent-purple-glow) 0%, transparent 70%);
  top: 20%;
  right: 20%;
  animation: float4 8s infinite ease-in-out;
}

/* ===========================================
   LAYOUT STRUCTURE
   =========================================== */
.main.bg {
  position: relative;
  min-height: 100vh;
}

.container-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  box-sizing: border-box;
}

.main-content {
  flex: 1;
  width: 100%;
  padding: 1rem;
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

/* ===========================================
   HEADER
   =========================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-dark);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--accent-purple-light);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ===========================================
   HERO BANNER (new - like Alfin screenshot)
   =========================================== */
.hero-banner {
  position: relative;
  height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.hero-banner-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-purple);
  overflow: hidden;
}

.hero-banner-bg::before,
.hero-banner-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
}

.hero-banner-bg::before {
  width: 200px;
  height: 200px;
  background: var(--accent-purple-light);
  top: -60px;
  left: -40px;
  animation: float1 10s infinite ease-in-out;
}

.hero-banner-bg::after {
  width: 150px;
  height: 150px;
  background: var(--primary-purple);
  bottom: -50px;
  right: -30px;
  animation: float2 13s infinite ease-in-out;
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-banner-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(10);
}

.hero-banner-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 2px;
}

/* ===========================================
   UNIFIED EXCHANGE CARD (like Alfin screenshot)
   =========================================== */
.exchange-card-unified {
  background: var(--bg-card-light) !important;
  border-radius: var(--border-radius-xl) !important;
  padding: 1.25rem !important;
  margin-top: -1.5rem;
  margin-left: auto;
  margin-right: auto;
  width: calc(100% - 2rem);
  max-width: 568px;
  position: relative;
  z-index: 5;
  animation: slideInUp 0.5s ease-out;
  box-sizing: border-box !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.exchange-section-top {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 0.25rem !important;
}

.exchange-label {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #888 !important;
  letter-spacing: 0.5px;
  margin: 0 !important;
}

.exchange-method-tag {
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  color: var(--accent-purple) !important;
  background: var(--accent-purple-very-soft) !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: var(--border-radius-full) !important;
}

.exchange-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  margin-bottom: 0.25rem !important;
}

.amount-input {
  flex: 1 !important;
  font-size: 2.2rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  min-width: 0 !important;
  box-shadow: none !important;
  width: auto !important;
}

.amount-input:focus {
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
}

.amount-input::placeholder {
  color: #ccc !important;
}

.currency-selector-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  cursor: pointer;
}

.currency-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.long-name {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.3s ease;
  vertical-align: bottom;
}

.is-typing .long-name {
  max-width: 0;
  opacity: 0;
  margin-right: 0;
}

.currency-selector-inline span {
  transition: all 0.3s ease;
}

.usdt-icon {
  background: #26a17b !important;
}

.rub-icon {
  background: var(--accent-purple) !important;
}

.currency-name,
#giveCurName,
#getCurName {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
}

.currency-chevron {
  font-size: 0.65rem;
  color: #999;
}

/* Swap Divider */
.swap-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.swap-line {
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}

.swap-btn {
  width: 40px;
  height: 40px;
  background: var(--gradient-purple);
  border: 3px solid white;
  border-radius: 50%;
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 2px 10px var(--accent-purple-glow);
  flex-shrink: 0;
}

.swap-btn:hover {
  transform: rotate(180deg);
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.swap-btn i {
  font-size: 0.65rem;
  line-height: 1;
}

/* Exchange Rate Info */
.exchange-rate-info,
.exchange-rate {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.discount-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
  font-style: italic;
  line-height: 1.3;
}

/* Exchange Continue Button */
.continue-btn,
.exchange-continue-btn {
  width: 100%;
  padding: 1rem;
  background: #e8f0fb;
  border: none;
  border-radius: var(--border-radius-full);
  color: var(--accent-purple);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: 0.75rem;
}

.continue-btn:hover,
.exchange-continue-btn:hover {
  background: var(--gradient-purple);
  color: white;
  box-shadow: 0 4px 20px var(--accent-purple-glow);
}

.continue-btn:active,
.exchange-continue-btn:active {
  transform: scale(0.98);
}

/* ===========================================
   CUSTOM SELECT & DROPDOWNS
   =========================================== */
.custom-select-wrapper,
.location-wrapper {
  position: relative;
}

.location-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--accent-purple-soft);
  border: 1px solid var(--border-dark) !important;
  border-radius: var(--border-radius-full);
  color: var(--text-white);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.location-btn:hover {
  background: rgba(100, 46, 139, 0.25);
  border-color: var(--accent-purple) !important;
}

.location-btn:focus {
  outline: none;
  border-color: var(--accent-purple-light) !important;
}

.location-btn i:first-child {
  font-size: 0.8rem;
  color: var(--accent-purple-light);
}

.chevron-small {
  font-size: 0.65rem;
  transition: transform 0.3s ease;
}

.location-btn.active .chevron-small {
  transform: rotate(180deg);
}

.location-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--primary-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  overflow: hidden;
  backdrop-filter: var(--blur-amount);
  animation: dropdownOpen 0.3s ease-out;
}

.location-dropdown.show {
  display: block;
}

.location-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-white);
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--border-dark);
}

.location-option:last-child {
  border-bottom: none;
}

.location-option:hover {
  background: var(--accent-purple-glow);
}

.location-option.selected {
  background: rgba(100, 46, 139, 0.2);
  color: var(--accent-purple-light);
  font-weight: 600;
}

.location-option i {
  font-size: 0.85rem;
  color: var(--accent-purple-light);
  min-width: 14px;
}

/* ===========================================
   SERVICES GRID
   =========================================== */
.services-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1rem !important;
  animation: slideInUp 0.8s ease-out 0.3s backwards;
}

.service-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  backdrop-filter: blur(15px) saturate(160%);
  -webkit-backdrop-filter: blur(15px) saturate(160%);
  transition: var(--transition-smooth);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.service-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  transition: transform 0.6s ease;
}

.service-card:hover::before {
  transform: translate(10%, 10%);
}

.service-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-purple-light);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
              0 0 20px var(--accent-purple-soft);
}

.service-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-purple);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 4px 15px var(--accent-purple-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-icon.referral-icon {
  background: var(--gradient-purple);
}

.service-icon.antiscam-icon {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.service-icon.policy-icon {
  background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
}

.service-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  margin: 0;
  line-height: 1.3;
}

.service-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

.service-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  background: rgba(100, 46, 139, 0.2);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius-sm);
  color: var(--text-white);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-normal);
  cursor: pointer;
}

.service-btn:hover {
  background: var(--accent-purple-glow);
  border-color: var(--accent-purple);
  color: var(--text-white);
}

.service-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.policy-card .service-title {
  font-size: 0.85rem;
}

/* ===========================================
   FOOTER
   =========================================== */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-dark);
  color: var(--text-muted);
  font-size: 0.9rem;
}

#footer {
  display: none !important;
}

/* ===========================================
   DESKTOP
   =========================================== */

/* ===========================================
   RESPONSIVE - TABLET (max-width: 600px)
   =========================================== */
@media (max-width: 600px) {
  .header {
    padding: 0.75rem 1rem;
  }

  .main-content {
    gap: 1.25rem;
    padding: 1rem;
    padding-bottom: 5rem;
  }

  .hero-banner {
    height: 120px;
  }

  .hero-banner-title {
    font-size: 1.6rem;
  }

  .hero-banner-logo {
    width: 40px;
    height: 40px;
  }

  .blob-1 {
    width: 220px;
    height: 220px;
  }

  .blob-2 {
    width: 180px;
    height: 180px;
  }

  .blob-3 {
    width: 140px;
    height: 140px;
  }

  .blob-4 {
    width: 160px;
    height: 160px;
  }
}

/* ===========================================
   RESPONSIVE - MOBILE (max-width: 400px)
   =========================================== */
@media (max-width: 400px) {
  .logo {
    font-size: 1.1rem;
  }

  .amount-input {
    font-size: 1.8rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 1rem;
  }

  .service-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}
