/**
 * AyaSend Transfer Widget - Fintech-Grade Premium Design
 * Version: 8.0 - Ultra-Premium Polish & Hierarchy
 * 
 * Features:
 * - Perfect visual hierarchy: subtle labels, dominant amounts, calm helper text
 * - 3-column flex layout for perfect optical centering
 * - Interactive focus states with subtle blue glow
 * - Smooth micro-transitions for live updates
 * - Consistent vertical spacing (14px/18px padding)
 * - Dominant amount typography (26px, weight 600)
 * - Premium light/dark themes
 * - Flawless mobile interaction
 */

/* ========================================
   TRANSFER WIDGET CARD
   Premium card design with soft shadows
   ======================================== */

.transfer-widget {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  max-width: 520px;
  margin: 0 auto;
  transition: all 0.25s ease;
}

html.dark .transfer-widget {
  background: #111827; /* Deep charcoal like Revolut */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Desktop: More generous padding */
@media (min-width: 1024px) {
  .transfer-widget {
    padding: 32px 28px;
    border-radius: 16px;
  }
}

/* ========================================
   AMOUNT INPUT CARDS (v2.0 - Zero Layout Shift)
   Premium fintech-grade card design matching Wise/Revolut
   ======================================== */

/* 2-Column Grid Layout - Equal widths prevent overflow */
.amount-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

/* Premium Card Design - World-Class Elevation & Polish */
.amount-card {
  width: 100%;
  border-radius: 24px;
  padding: 14px 18px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.9);
  min-height: 120px;
  transition:
    box-shadow 0.18s ease-out,
    transform 0.18s ease-out,
    border-color 0.18s ease-out;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Interactive Focus/Active State - Subtle Blue Glow */
.amount-card--send.is-active {
  box-shadow: 
    0 0 0 1px #0078ff, 
    0 14px 40px rgba(0, 120, 255, 0.16);
  transform: translateY(-1px);
  border-color: #0078ff;
}

.amount-card--send.is-active .amount-card__input {
  color: #0b63d1;
}

.amount-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.amount-card:hover {
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 8px 20px rgba(15, 23, 42, 0.08),
    0 16px 40px rgba(15, 23, 42, 0.10),
    inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

.amount-card:hover::before {
  opacity: 1;
}

.amount-card:focus-within {
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 
    0 2px 6px rgba(14, 165, 233, 0.12),
    0 10px 24px rgba(14, 165, 233, 0.16),
    0 20px 50px rgba(14, 165, 233, 0.20),
    0 0 0 4px rgba(14, 165, 233, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

html.dark .amount-card {
  background: linear-gradient(to bottom, #1e293b 0%, #1a2332 100%);
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 16px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(148, 163, 184, 0.05);
}

html.dark .amount-card::before {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0) 50%);
}

html.dark .amount-card:hover {
  border-color: rgba(71, 85, 105, 0.8);
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 20px 48px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

html.dark .amount-card:focus-within {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 
    0 4px 10px rgba(96, 165, 250, 0.20),
    0 12px 28px rgba(96, 165, 250, 0.25),
    0 24px 55px rgba(96, 165, 250, 0.30),
    0 0 0 4px rgba(96, 165, 250, 0.12),
    inset 0 1px 0 rgba(96, 165, 250, 0.15);
  transform: translateY(-2px);
}

/* Dark mode: Enhanced pill styling */
html.dark .amount-card__currency-pill {
  background: #0F172A;
  border-color: #374151;
  color: #60A5FA;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========================================
   LEGACY DESKTOP STYLING - COMPLETELY DISABLED
   All desktop styling (including glassmorphic calculator) moved to transfer-widget-desktop.css
   ======================================== */

/* Card Label - Ultra-Subtle Premium Hierarchy */
.amount-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color 0.18s ease-out;
}

html.dark .amount-card__label {
  color: #94A3AF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================
   DARK MODE INPUT TEXT - CRITICAL FIX
   Ensures input text is white in dark mode
   ======================================== */

html.dark .amount-card__input,
html.dark input#amount,
html.dark input#receive-amount {
  color: #FFFFFF !important;
  caret-color: #60A5FA !important;
}

html.dark .amount-card__input::placeholder,
html.dark input#amount::placeholder,
html.dark input#receive-amount::placeholder {
  color: #94A3B8 !important;
}

html.dark .amount-card__input:focus,
html.dark input#amount:focus,
html.dark input#receive-amount:focus {
  color: #FFFFFF !important;
}

/* Desktop: Larger, more refined labels with premium polish */
@media (min-width: 1024px) {
  .amount-card__label {
    font-size: 12px;
    letter-spacing: 0.14em;
    margin-bottom: 14px;
    font-weight: 700;
    color: #475569;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  }
  
  html.dark .amount-card__label {
    color: #94A3B7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

/* Desktop: Extra-large screens - Maximum refinement */
@media (min-width: 1200px) {
  .amount-card__label {
    font-size: 13px;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
  }
}

/* Card Body - 3-Column Perfect Centering Layout */
.amount-card__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  position: relative; /* For proper z-index stacking */
}

/* Left spacer - matches currency badge width for optical centering */
.amount-card__spacer {
  width: 52px; /* Mobile: matches pill width */
  flex-shrink: 0;
}

/* Center column - flexible, contains input */
.amount-card__value {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0; /* Allow flex shrink */
}

/* Right column - contains currency pill */
.amount-card__badge {
  width: 52px; /* Mobile: exact pill width */
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Input Field - Dominant Ultra-Premium Typography */
.amount-card__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 600;
  color: #111827;
  text-align: center;
  padding: 12px 10px;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: text;
  transition: color 0.18s ease-out, opacity 0.18s ease-out;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  pointer-events: auto !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  position: relative;
  z-index: 10;
}

/* Recipient Gets - Slightly darker for emphasis */
.amount-card--receive .amount-card__input {
  color: #020617;
}

.amount-card__input:focus {
  outline: none;
  color: #0b63d1;
}

html.dark .amount-card__input:focus {
  color: #60A5FA;
  text-shadow: 0 1px 3px rgba(96, 165, 250, 0.15);
}

/* Micro-transition for live updates */
.amount-card__input.is-updating {
  opacity: 0.4;
}

.amount-card__input.is-updated {
  opacity: 1;
}

/* Currency Pill - Non-shrinking badge (Mobile base styles) */
.amount-card__currency-pill {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  cursor: default;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s ease;
  pointer-events: none !important; /* NEVER intercept taps */
  position: relative;
  z-index: 1; /* Below input */
}

html.dark .amount-card__currency-pill {
  background: #111827;
  border-color: #4B5563;
  color: #60A5FA;
}

/* Desktop: LEGACY ULTRA-PROFESSIONAL POLISH - DISABLED (replaced by compact desktop styling) */
/* @media (min-width: 1024px) {
  .calculator-layout .calculator-card,
  .amount-card {
    border-radius: 18px !important;
    padding: 20px 24px !important;
    border: 2px solid rgba(226, 232, 240, 0.85) !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%) !important;
    box-shadow: 
      0 3px 10px rgba(15, 23, 42, 0.05),
      0 10px 30px rgba(15, 23, 42, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    min-height: 145px !important;
  }
  
  .calculator-layout .calculator-card:hover,
  .amount-card:hover {
    border-color: rgba(203, 213, 225, 0.95) !important;
    box-shadow: 
      0 4px 14px rgba(15, 23, 42, 0.07),
      0 14px 40px rgba(15, 23, 42, 0.10),
      inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    transform: translateY(-3px) scale(1.01) !important;
  }
  
  .calculator-layout .calculator-card::before,
  .amount-card::before {
    display: none !important;
  }
  
  .amount-card__input {
    font-size: 34px !important;
    font-weight: 700 !important;
    padding: 14px 8px;
    margin: 0;
    letter-spacing: -0.03em !important;
    color: #0f172a !important;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15 !important;
    flex: 1 1 auto;
    min-width: 150px;
    max-width: 100%;
  }
  
  .calculator-card--receive .amount-card__input,
  .amount-card--receive .amount-card__input {
    font-size: 38px !important;
    font-weight: 800 !important;
    color: #0078ff !important;
    text-shadow: 0 2px 4px rgba(0, 120, 255, 0.18) !important;
  }
  
  .amount-card__body {
    gap: 0;
    margin: 0;
    min-height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .amount-card__spacer {
    width: 68px;
  }
  
  .amount-card__badge {
    width: 68px;
  }
  
  .amount-card__currency-pill {
    flex-shrink: 0;
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    border-radius: 11px !important;
    border: 2px solid rgba(148, 163, 184, 0.30) !important;
    background: linear-gradient(to bottom, #f8fafc 0%, #eef2f6 100%) !important;
    box-shadow: 
      0 2px 4px rgba(15, 23, 42, 0.08),
      0 3px 8px rgba(15, 23, 42, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    color: #475569 !important;
  }
  
  .calculator-card-label,
  .amount-card__label {
    font-size: 11px !important;
    letter-spacing: 0.15em !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    margin-bottom: 18px !important;
    opacity: 0.85 !important;
  }
  
  html.dark .calculator-layout .calculator-card,
  html.dark .amount-card {
    background: linear-gradient(to bottom, #1e293b 0%, #1a2332 100%) !important;
    border-color: rgba(71, 85, 105, 0.7) !important;
  }
  
  html.dark .amount-card__currency-pill {
    background: linear-gradient(to bottom, #0f172a 0%, #0a0f1a 100%) !important;
    border-color: rgba(100, 116, 139, 0.5) !important;
    color: #94a3b8 !important;
    box-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(96, 165, 250, 0.1) !important;
  }
  
  html.dark .amount-card__input {
    color: #f8fafc !important;
  }
  
  html.dark .calculator-card--receive .amount-card__input,
  html.dark .amount-card--receive .amount-card__input {
    color: #60a5fa !important;
    text-shadow: 0 2px 6px rgba(96, 165, 250, 0.25) !important;
  }
} */

/* Desktop: Extra-large screens - Maximum pill refinement */
@media (min-width: 1200px) {
  .amount-card__currency-pill {
    font-size: 13px;
    padding: 7px 16px;
  }
  
  /* Extra-large: Slightly wider spacer to match larger pills */
  .amount-card__spacer {
    width: 72px; /* Extra-large: matches enhanced pill width */
  }
  
  .amount-card__badge {
    width: 72px; /* Extra-large: matches enhanced pill width */
  }
  
  /* Keep equal sizing on all screen sizes - no size difference */
  .amount-card__input {
    font-size: 28px; /* Consistent across all desktop sizes */
  }
}

.amount-card__input::placeholder {
  color: #cbd5e1;
  opacity: 0.6;
}

/* Both fields fully editable - same styling */
.amount-card__input--editable {
  cursor: text;
  pointer-events: auto !important;
  caret-color: #111827;
  z-index: 10;
}

html.dark .amount-card__input--editable {
  caret-color: #F8FAFC;
}

/* Locked state - temporary readonly while opposite field is being edited */
.amount-card__input.is-locked {
  opacity: 0.6;
  cursor: not-allowed;
  /* Still visible but readonly via JS */
}

html.dark .amount-card__input {
  color: #F8FAFC;
}

html.dark .amount-card__input::placeholder {
  color: #475569;
  opacity: 0.5;
}

/* ========================================
   PREMIUM CURRENCY PILL WITH FLAG (Desktop Only)
   Exceeds Wise/Remitly/Western Union standards
   ======================================== */

/* ========================================
   CRITICAL MOBILE FIX: FORCE HIDE FLAG SVG
   Mali flag SVG has intrinsic 900x600px dimensions
   Must use ultra-aggressive hiding on mobile
   ======================================== */

/* Base mobile: NUCLEAR OPTION - hide completely */
.currency-flag,
img.currency-flag,
#receive-currency-flag,
.amount-card__currency-pill > .currency-flag,
.amount-card__currency-pill img.currency-flag {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

/* Desktop (≥1024px): RESTORE flag display and override mobile hiding */
@media (min-width: 1024px) {
  .currency-flag,
  img.currency-flag,
  #receive-currency-flag,
  .amount-card__currency-pill > .currency-flag,
  .amount-card__currency-pill img.currency-flag {
    display: block !important;
    visibility: visible !important;
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    margin-right: 6px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    overflow: visible !important;
    position: static !important;
    left: auto !important;
    pointer-events: auto !important;
    z-index: auto !important;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
  }
  
  /* Enhanced pill styling on desktop with flag */
  .amount-card__currency-pill--with-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 14px;
    letter-spacing: 0.02em;
  }
}

/* Tablet (768px-1023px): Enhanced middle ground */
@media (min-width: 768px) and (max-width: 1023px) {
  .amount-card__input {
    font-size: 26px;
    padding: 13px 9px;
    font-weight: 600;
  }
  
  .amount-card {
    padding: 17px 19px 15px;
  }
  
  .amount-card__label {
    font-size: 12.5px;
  }
  
  .amount-card__currency-pill {
    padding: 6.5px 15px;
    font-size: 13.5px;
  }
  
  /* Slightly larger gap on tablet */
  .amount-row {
    gap: 18px;
  }
}

/* Extra large desktop (≥1200px): Maximum premium experience */
@media (min-width: 1200px) {
  .amount-card__input {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 18px 10px;
  }
  
  .currency-flag,
  img.currency-flag,
  #receive-currency-flag,
  .amount-card__currency-pill > .currency-flag,
  .amount-card__currency-pill img.currency-flag {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    margin-right: 7px !important;
  }
  
  .amount-card__currency-pill--with-flag {
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 700;
  }
}

/* ===== MOBILE-ONLY TAP-TO-FOCUS OPTIMIZATIONS ===== */
/* Only applies to touch devices (phones/tablets) - desktop untouched */
@media (hover: none) and (pointer: coarse) {
  /* Make entire card body tappable - forwards to input */
  .amount-card__body {
    cursor: text;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Inputs must be on top and instantly focusable */
  .amount-card__input {
    pointer-events: auto !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: manipulation !important; /* Instant keyboard on iOS/Android */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS minimum tap target */
    z-index: 10 !important;
  }
  
  /* All overlays, badges, pills - NEVER catch taps */
  .amount-card__currency-pill,
  .badge,
  .loader,
  .overlay,
  .gradient,
  .amount-card__label,
  .amount-card__helper {
    pointer-events: none !important;
  }
  
  /* Prevent transforms from blocking iOS focus */
  .amount-card,
  .amount-card__body {
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
  }
  
  /* Remove any focus transform on mobile */
  .amount-card__input:focus {
    transform: none !important;
  }
}

/* Helper Text - Calm and Readable */
.amount-card__helper {
  margin-top: 6px;
  margin-bottom: 0;
  font-size: 12px;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  text-align: center;
  transition: color 0.18s ease-out;
}

html.dark .amount-card__helper {
  color: #6B7280;
}

/* Desktop: Premium helper text refinement */
@media (min-width: 1024px) {
  .amount-card__helper {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    letter-spacing: -0.01em;
  }
  
  html.dark .amount-card__helper {
    color: #6B7280;
  }
}

/* Desktop: Extra-large screens */
@media (min-width: 1200px) {
  .amount-card__helper {
    font-size: 13px;
    margin-top: 8px;
  }
}

/* Input Container - Refined background with subtle border */
.amount-input-container {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F7FAFC; /* Soft gray background */
  border: 1px solid #E5E7EB; /* Subtle border */
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 72px;
  transition: all 0.25s ease;
  position: relative;
}

html.dark .amount-input-container {
  background: #1F2937; /* Soft dark background */
  border-color: #374151;
}

/* Focus State - Premium blue glow */
.amount-input-container:focus-within {
  background: #FFFFFF;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

html.dark .amount-input-container:focus-within {
  background: #111827;
  border-color: #60A5FA;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Native Number Input - Large, bold, right-aligned */
.amount-input-native {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 28px; /* Large fintech-grade numbers */
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  text-align: right; /* Right-aligned like Wise/Revolut */
  padding: 0;
  margin: 0;
  
  /* Remove browser defaults */
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
  
  /* Mobile optimizations */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop: Even larger text */
@media (min-width: 1024px) {
  .amount-input-native {
    font-size: 32px; /* Premium desktop sizing */
  }
}

/* Remove spinners */
.amount-input-native::-webkit-outer-spin-button,
.amount-input-native::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

html.dark .amount-input-native {
  color: #F9FAFB; /* High contrast white */
}

.amount-input-native::placeholder {
  color: #D1D5DB;
  font-weight: 600;
}

html.dark .amount-input-native::placeholder {
  color: #4B5563;
}

/* Currency Badge - Refined with divider */
.currency-badge-inline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EFF6FF;
  color: #1E40AF;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  border-left: 3px solid #3B82F6; /* Subtle divider accent */
}

html.dark .currency-badge-inline {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  border-left-color: #60A5FA;
}

/* Flag Icon in Badge */
.currency-badge-inline img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

/* Helper Text */
.amount-input-helper {
  font-size: 12px;
  color: #6B7280;
  margin-top: 6px;
  font-weight: 500;
}

html.dark .amount-input-helper {
  color: #9CA3AF;
}

/* ========================================
   RESPONSIVE BREAKPOINTS - MOBILE OPTIMIZED
   ======================================== */

/* Mobile/Tablet: Stack vertically */
@media (max-width: 768px) {
  .amount-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .amount-card {
    padding: 14px 16px 12px;
    min-height: 96px; /* Slightly smaller for mobile */
  }

  /* FINTECH-PRO: FORCE equal sizing on mobile - 24px for both */
  .amount-card__input,
  .amount-card--send .amount-card__input,
  .amount-card--receive .amount-card__input {
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
  }
  
  /* Subtle color emphasis still applies */
  .amount-card--send .amount-card__input {
    color: #1f2933 !important;
  }
  
  .amount-card--receive .amount-card__input {
    color: #101828 !important;
  }
  
  .amount-card__currency-pill {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* ========================================
   PRESET AMOUNT BUTTONS
   Premium button design with symmetry
   ======================================== */

.preset-buttons-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.preset-amount-btn {
  flex: 1;
  min-width: 75px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Touch target */
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.preset-amount-btn:hover {
  background: #3B82F6;
  color: #FFFFFF;
  border-color: #3B82F6;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.preset-amount-btn:active {
  transform: translateY(0);
}

html.dark .preset-amount-btn {
  background: #1F2937;
  border-color: #374151;
  color: #F3F4F6;
}

html.dark .preset-amount-btn:hover {
  background: #60A5FA;
  border-color: #60A5FA;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* Desktop Premium: Multi-layer shadows and gradient backgrounds */
@media (min-width: 1024px) {
  .preset-amount-btn {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    box-shadow: 
      0 1px 2px rgba(0, 0, 0, 0.04),
      0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .preset-amount-btn:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 
      0 4px 12px rgba(59, 130, 246, 0.25),
      0 8px 24px rgba(59, 130, 246, 0.15),
      0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
  }
  
  html.dark .preset-amount-btn {
    background: linear-gradient(135deg, #1E293B 0%, #1F2937 100%);
    box-shadow: 
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  html.dark .preset-amount-btn:hover {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    box-shadow: 
      0 4px 12px rgba(96, 165, 250, 0.3),
      0 8px 24px rgba(96, 165, 250, 0.2),
      0 1px 3px rgba(0, 0, 0, 0.15);
  }
}

/* ========================================
   SHOW BEST RATES BUTTON CONTAINER
   Ultra-premium gradient button with animations
   ======================================== */

.show-rates-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 1.25rem;
}

#show-best-rates-btn {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 240px;
  
  /* Premium Styling */
  background: linear-gradient(90deg, #0078ff, #00b4ff);
  color: #ffffff;
  border: none;
  border-radius: 999px; /* Pill shape */
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  
  /* Elevated Shadow */
  box-shadow: 0 8px 18px rgba(0, 120, 255, 0.25);
  
  /* Smooth Transitions */
  cursor: pointer;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    opacity 0.15s ease-out;
}

#show-best-rates-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 120, 255, 0.32);
}

#show-best-rates-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 120, 255, 0.2);
}

#show-best-rates-btn:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* Mobile: Slightly wider for better touch targets */
@media (max-width: 640px) {
  #show-best-rates-btn {
    min-width: 280px;
  }
}

/* ========================================
   BEST OVERALL SECTION SCROLL TARGET
   Premium centered wrapper with fade-in animation
   ======================================== */

.best-overall-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 12px 32px;
  box-sizing: border-box;
}

.best-overall-content {
  max-width: 640px; /* Tighter, more focused width */
  width: 100%;
}

/* Desktop: Slightly wider but still focused */
@media (min-width: 1024px) {
  .best-overall-content {
    max-width: 700px;
  }
}

/* ========================================
   FADE-IN / SLIDE-UP ANIMATION
   Triggered when scrolling to Best Overall
   ======================================== */

.best-overall-animate {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.35s ease-out,
    transform 0.35s ease-out;
}

.best-overall-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   BASELINE EXPLANATION NOTE
   Premium info card with icon and gradient
   ======================================== */

.baseline-explanation-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.baseline-note-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #64748B;
}

.baseline-note-content {
  flex: 1;
}

.baseline-note-title {
  font-weight: 600;
  color: #1E293B;
  font-family: 'DM Sans', sans-serif;
}

.baseline-note-text {
  color: #475569;
}

html.dark .baseline-explanation-note {
  background: #1E293B;
  border-color: #334155;
}

html.dark .baseline-note-icon {
  color: #94A3B8;
}

html.dark .baseline-note-title {
  color: #F1F5F9;
}

html.dark .baseline-note-text {
  color: #CBD5E1;
}

/* Desktop Premium: Elegant card with gradient border */
@media (min-width: 1024px) {
  .baseline-explanation-note {
    position: relative;
    padding: 18px 20px;
    background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 14px;
    margin-bottom: 28px;
    font-size: 14px;
    box-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.02),
      0 4px 8px rgba(0, 0, 0, 0.01);
  }
  
  /* Gradient border effect */
  .baseline-explanation-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 50%, #93C5FD 100%);
    -webkit-mask: 
      linear-gradient(#fff 0 0) content-box, 
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
      linear-gradient(#fff 0 0) content-box, 
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.4;
  }
  
  .baseline-note-icon {
    width: 20px;
    height: 20px;
    color: #3B82F6;
  }
  
  .baseline-note-title {
    font-size: 14px;
    letter-spacing: -0.01em;
  }
  
  html.dark .baseline-explanation-note {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    box-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.1),
      0 4px 8px rgba(0, 0, 0, 0.05);
  }
  
  /* Dark mode gradient border */
  html.dark .baseline-explanation-note::before {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #2563EB 100%);
    opacity: 0.5;
  }
  
  html.dark .baseline-note-icon {
    color: #60A5FA;
  }
}

/* ========================================
   CURRENCY SELECTOR DROPDOWN
   Premium dropdown with animations
   ======================================== */

/* Selector Button */
.currency-selector-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 56px;
}

.currency-selector-btn:hover {
  background: #FFFFFF;
  border-color: #3B82F6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

html.dark .currency-selector-btn {
  background: #1F2937;
  border-color: #374151;
  color: #F9FAFB;
}

html.dark .currency-selector-btn:hover {
  background: #111827;
  border-color: #60A5FA;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Flag and Currency Text Alignment */
.currency-selector-btn img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
}

.currency-selector-btn .divider {
  width: 1px;
  height: 20px;
  background: #E5E7EB;
  margin: 0 4px;
}

html.dark .currency-selector-btn .divider {
  background: #4B5563;
}

/* Dropdown Animation */
.currency-dropdown {
  animation: fadeScale 0.2s ease-out;
  transform-origin: top center;
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ========================================
   LOADING & DISABLED STATES
   ======================================== */

.amount-input-container.loading {
  opacity: 0.6;
  pointer-events: none;
}

.amount-input-native:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   ERROR STATE (Validation)
   ======================================== */

.amount-input-container.error {
  border-color: #EF4444;
  background: #FEF2F2;
}

html.dark .amount-input-container.error {
  border-color: #F87171;
  background: rgba(239, 68, 68, 0.08);
}

.amount-input-field .error-message {
  font-size: 12px;
  color: #EF4444;
  margin-top: 6px;
  font-weight: 500;
}

html.dark .amount-input-field .error-message {
  color: #FCA5A5;
}

/* ========================================
   ACCESSIBILITY & MOTION PREFERENCES
   ======================================== */

/* Keyboard Focus */
.amount-input-native:focus {
  outline: none; /* Container handles focus */
}

.preset-amount-btn:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

html.dark .preset-amount-btn:focus-visible {
  outline-color: #60A5FA;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .transfer-widget,
  .amount-input-container,
  .preset-amount-btn,
  .currency-selector-btn,
  .currency-dropdown {
    transition: none !important;
    animation: none !important;
  }
  
  .amount-input-container:focus-within,
  .preset-amount-btn:hover {
    transform: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .amount-input-container,
  .preset-amount-btn,
  .currency-selector-btn {
    border-width: 2px;
  }
}

/* ========================================
   EXCHANGE RATE INDICATOR
   Subtle helper text below inputs
   ======================================== */

.exchange-rate-text {
  font-size: 13px;
  color: #6B7280;
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

html.dark .exchange-rate-text {
  color: #9CA3AF;
}

.exchange-rate-text strong {
  color: #111827;
  font-weight: 600;
}

html.dark .exchange-rate-text strong {
  color: #F9FAFB;
}
