@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: linear-gradient(145deg, #0a0a1a 0%, #0d1b2a 50%, #0a0a1a 100%);
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  touch-action: none;
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Animated background particles ── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(0, 200, 255, 0.15), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(0, 200, 255, 0.1), transparent),
    radial-gradient(2px 2px at 60% 20%, rgba(100, 180, 255, 0.12), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(0, 200, 255, 0.08), transparent);
  animation: drift 20s linear infinite;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

@keyframes drift {
  from { transform: rotate(0deg) translateZ(0); }
  to { transform: rotate(360deg) translateZ(0); }
}

/* ── Main container ── */
.brand-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 4vh, 2rem);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
}

/* ── Logo icon ── */
.logo-icon {
  width: clamp(56px, 18vw, 80px);
  height: clamp(56px, 18vw, 80px);
  position: relative;
  opacity: 0;
  -webkit-transform: scale(0.3);
  transform: scale(0.3);
  -webkit-animation: logoAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
  animation: logoAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
  will-change: transform, opacity;
  flex-shrink: 0;
}

.logo-icon .shield {
  width: 100%;
  height: 100%;
  display: block;
}

.shield-path {
  fill: none;
  stroke: url(#brandGradient);
  stroke-width: 2;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  -webkit-animation: drawShield 1.2s ease-out 0.3s forwards;
  animation: drawShield 1.2s ease-out 0.3s forwards;
}

.shield-fill {
  fill: url(#brandGradient);
  opacity: 0;
  -webkit-animation: shieldFill 0.6s ease-out 1.2s forwards;
  animation: shieldFill 0.6s ease-out 1.2s forwards;
}

.currency-symbol {
  fill: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 22px;
  opacity: 0;
  -webkit-animation: fadeInUp 0.5s ease-out 1.5s forwards;
  animation: fadeInUp 0.5s ease-out 1.5s forwards;
}

@keyframes drawShield {
  to { stroke-dashoffset: 0; }
}

@keyframes shieldFill {
  to { opacity: 0.15; }
}

@keyframes logoAppear {
  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

/* ── Brand name ── */
.brand-name {
  font-size: clamp(1.8rem, 10vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  opacity: 0;
  -webkit-animation: fadeInUp 0.8s ease-out 0.8s forwards;
  animation: fadeInUp 0.8s ease-out 0.8s forwards;
  will-change: transform, opacity;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}

.brand-name .highlight {
  background: linear-gradient(135deg, #00c8ff, #0080ff, #00c8ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-animation: shimmer 3s ease-in-out infinite 2s;
  animation: shimmer 3s ease-in-out infinite 2s;
}

.brand-name .regular {
  color: #ffffff;
}

/* Underline sweep */
.brand-name::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00c8ff, #0080ff, transparent);
  -webkit-transform: scaleX(0);
  transform: scaleX(0);
  -webkit-animation: sweepLine 0.8s ease-out 1.6s forwards;
  animation: sweepLine 0.8s ease-out 1.6s forwards;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes sweepLine {
  to {
    -webkit-transform: scaleX(1);
    transform: scaleX(1);
  }
}

/* ── Accent bars ── */
.accent-bars {
  display: flex;
  gap: 5px;
  opacity: 0;
  -webkit-animation: fadeInUp 0.6s ease-out 1.2s forwards;
  animation: fadeInUp 0.6s ease-out 1.2s forwards;
}

.accent-bars span {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00c8ff, #0080ff);
  will-change: transform, opacity;
}

.accent-bars span:nth-child(1) {
  -webkit-animation: barPulse 1.2s ease-in-out 1.8s infinite;
  animation: barPulse 1.2s ease-in-out 1.8s infinite;
}
.accent-bars span:nth-child(2) {
  height: 22px;
  -webkit-animation: barPulse 1.2s ease-in-out 1.9s infinite;
  animation: barPulse 1.2s ease-in-out 1.9s infinite;
}
.accent-bars span:nth-child(3) {
  -webkit-animation: barPulse 1.2s ease-in-out 2.0s infinite;
  animation: barPulse 1.2s ease-in-out 2.0s infinite;
}

@keyframes barPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.3); }
}

/* ── Checking payment section ── */
.checking-payment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(0.25rem, 2vh, 1rem);
  opacity: 0;
  -webkit-animation: fadeInUp 0.6s ease-out 2s forwards;
  animation: fadeInUp 0.6s ease-out 2s forwards;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 200, 255, 0.15);
  border-top-color: #00c8ff;
  border-radius: 50%;
  -webkit-animation: spin 0.8s linear infinite;
  animation: spin 0.8s linear infinite;
  will-change: transform;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

.checking-text {
  font-size: clamp(0.65rem, 2.8vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.checking-text .dots::after {
  content: '';
  -webkit-animation: dots 1.5s steps(4, end) infinite;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ── Progress bar ── */
.progress-track {
  width: clamp(140px, 50vw, 200px);
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
  opacity: 0;
  -webkit-animation: fadeInUp 0.5s ease-out 2.2s forwards;
  animation: fadeInUp 0.5s ease-out 2.2s forwards;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00c8ff, #0080ff);
  border-radius: 1px;
  -webkit-animation: fillProgress 4.5s ease-in-out 0.5s forwards;
  animation: fillProgress 4.5s ease-in-out 0.5s forwards;
  will-change: width;
}

@keyframes fillProgress {
  0%   { width: 0%; }
  15%  { width: 15%; }
  40%  { width: 40%; }
  60%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 100%; }
}

/* ── Glow ring behind logo ── */
.glow-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(80px, 28vw, 120px);
  height: clamp(80px, 28vw, 120px);
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 255, 0.12) 0%, transparent 70%);
  opacity: 0;
  -webkit-animation: glowPulse 2s ease-in-out 1.5s infinite;
  animation: glowPulse 2s ease-in-out 1.5s infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* ── Shared keyframes ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    -webkit-transform: translateY(12px);
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

/* ── Geolocation denied overlay ── */
.geo-denied {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.geo-denied-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  animation: fadeInUp 0.5s ease-out forwards;
}

.geo-denied-icon {
  opacity: 0.9;
}

.geo-denied-title {
  font-size: clamp(1.1rem, 5vw, 1.4rem);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.geo-denied-text {
  font-size: clamp(0.75rem, 3vw, 0.9rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  max-width: 280px;
}

.geo-retry-btn {
  margin-top: 0.5rem;
  padding: 0.7rem 2rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00c8ff, #0080ff);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.geo-retry-btn:active {
  opacity: 0.8;
  transform: scale(0.97);
}

/* ── Very small screens (iPhone SE, Galaxy S series) ── */
@media screen and (max-height: 570px) {
  .brand-container {
    gap: 0.6rem;
  }
  .logo-icon {
    width: 44px;
    height: 44px;
  }
  .brand-name {
    font-size: 1.6rem;
  }
  .accent-bars span {
    height: 12px;
  }
  .accent-bars span:nth-child(2) {
    height: 16px;
  }
  .checking-payment {
    margin-top: 0.2rem;
  }
  .glow-ring {
    width: 64px;
    height: 64px;
  }
}

/* ── Landscape mobile ── */
@media screen and (max-height: 420px) and (orientation: landscape) {
  .brand-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem 1.2rem;
    max-width: 100%;
  }
  .logo-icon {
    width: 40px;
    height: 40px;
  }
  .brand-name {
    font-size: 1.5rem;
  }
  .accent-bars {
    display: none;
  }
  .checking-payment {
    width: 100%;
    justify-content: center;
    margin-top: 0;
  }
  .progress-track {
    width: 160px;
  }
  .glow-ring {
    width: 56px;
    height: 56px;
  }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before {
    animation: none;
  }
}
