*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #000;
  color: #fff;
}

.app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("bg.jpeg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

@supports (padding: max(0px)) {
  .app {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

.content-layer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.popup-layer {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.popup-layer > * {
  pointer-events: auto;
}

@keyframes popupIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.03) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes popupOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
}

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

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.04); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.animate-popup-in {
  animation: popupIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-popup-out {
  animation: popupOut 0.25s ease-in both;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease both;
}

.animate-fade-out {
  animation: fadeOut 0.25s ease both;
}

.animate-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-slide-down {
  animation: slideDown 0.3s ease-in both;
}

.animate-bounce {
  animation: bounce 0.6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
}

.popup-host {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding-left: calc(env(safe-area-inset-left, 0px) + 16px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 16px);
  pointer-events: none;
}

.popup-host > * {
  pointer-events: auto;
}

.popup {
  width: 100%;
  max-width: 340px;
  max-height: 100%;
}

.popup__content {
  width: 100%;
  max-height: 100%;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background-color: rgba(24, 24, 28, 0.96);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.sheet__handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.sheet__handle::after {
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.22);
}

.applepay {
  padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 14px);
  color: #ffffff;
}

.applepay__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.14);
}

.applepay__close {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(235, 235, 245, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.applepay__close svg {
  width: 14px;
  height: 14px;
}

.applepay__title {
  margin: 0;
  font-size: clamp(18px, 5.2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.applepay__body {
  padding: 14px 20px 10px;
}

.applepay__section-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(220, 220, 230, 0.55);
}

.applepay__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.applepay__row--card {
  padding: 10px 0 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 16px;
}

.applepay__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.applepay__card-art {
  width: 44px;
  height: 30px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ff6a4d 0%, #ff8a3d 45%, #ffb347 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 138, 61, 0.35);
}

.applepay__card-art::after {
  content: "";
  position: absolute;
  right: -10px;
  top: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), rgba(255,255,255,0) 60%);
  opacity: 0.6;
}

.applepay__card-name {
  margin: 0;
  font-size: clamp(15px, 4.4vw, 18px);
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.applepay__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.applepay__line-label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(230, 230, 240, 0.75);
  letter-spacing: -0.1px;
}

.applepay__line-value {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.1px;
}

.applepay__divider {
  height: 0.5px;
  margin: 10px 0 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.22), rgba(255,255,255,0.08));
}

.applepay__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 10px;
}

.applepay__total-label {
  font-size: 15px;
  font-weight: 500;
  color: rgba(230, 230, 240, 0.78);
  letter-spacing: -0.1px;
}

.applepay__total-value {
  font-size: clamp(36px, 10.5vw, 52px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -1.4px;
  line-height: 1;
  font-feature-settings: "tnum" 1;
}

.applepay__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px 6px;
  color: rgba(220, 220, 230, 0.7);
  font-size: 13px;
  font-weight: 500;
}

.applepay__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: applepaySpin 0.8s linear infinite;
}

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

.faceid-popup {
  width: 150px;
  height: 150px;
  border-radius: 28px;
  background-color: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.faceid-icon {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faceid-icon svg {
  width: 100%;
  height: 100%;
  color: #ffffff;
}

.faceid-scanner {
  position: absolute;
  top: 0;
  left: -5px;
  right: -5px;
  height: 2px;
  background: #34c759;
  box-shadow: 0 0 8px 2px rgba(52, 199, 89, 0.6);
  border-radius: 2px;
  /* 0.6s per direction. Total 4 directions (down, up, down, up) = 2.4s total */
  animation: faceidScan 0.6s ease-in-out 4 alternate forwards;
}

@keyframes faceidScan {
  0% { transform: translateY(0); }
  100% { transform: translateY(50px); }
}

.faceid-text {
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.2px;
  margin: 0;
}

.done-popup {
  width: 220px;
  height: 220px;
  border-radius: 28px;
  background-color: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.done-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
}

.done-icon-circle {
  stroke: #34c759;
  stroke-width: 3.5;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  fill: none;
  animation: drawCircle 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.done-icon-check {
  stroke: #34c759;
  stroke-width: 3.5;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: drawCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.done-text {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.2px;
}

.done-amount {
  font-size: 15px;
  font-weight: 500;
  color: rgba(235, 235, 245, 0.6);
  margin: 0;
  letter-spacing: 0.2px;
}

.final-alert {
  width: 100%;
  background-color: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 18px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.final-alert__text {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin: 0 0 24px;
}

.final-alert__text .link {
  color: #0a84ff;
  text-decoration: none;
}

.final-alert__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.final-alert__btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.1s ease;
}

.final-alert__btn:active {
  opacity: 0.7;
}

.final-alert__btn--primary {
  background-color: #0a84ff;
  color: #ffffff;
}

.final-alert__btn--secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.ios-notification {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  background-color: rgba(28, 28, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 14px 16px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(calc(-100% - 20px));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@supports (padding: max(0px)) {
  .ios-notification {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
  }
}

.ios-notification.show {
  transform: translateY(0);
}

.ios-notification__header {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: rgba(235, 235, 245, 0.6);
}

.ios-notification__icon {
  width: 18px;
  height: 18px;
  background: #34c759;
  border-radius: 4px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-notification__icon svg {
  width: 12px;
  height: 12px;
  color: #fff;
}

.ios-notification__app {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ios-notification__time {
  margin-left: auto;
}

.ios-notification__title {
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  margin: 2px 0 2px;
}

.ios-notification__text {
  font-size: 15px;
  color: rgba(235, 235, 245, 0.8);
  line-height: 1.35;
  margin: 0;
}

.ios-notification__link {
  color: #0a84ff;
  text-decoration: underline;
}

.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background-color: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

.premium-popup {
  width: 100%;
  max-height: 100%;
  padding: 22px 18px 20px;
  border-radius: 20px;
  background-color: rgba(14, 14, 16, 0.9);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.premium-popup__title {
  margin: 0 0 8px;
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.premium-popup__subtitle {
  margin: 0 0 18px;
  font-size: clamp(13px, 3.8vw, 15px);
  font-weight: 500;
  line-height: 1.4;
  color: rgba(230, 230, 235, 0.88);
}

.premium-popup__features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.premium-popup__feature {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.premium-popup__check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a524 0%, #e88a0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(245, 165, 36, 0.35);
}

.premium-popup__check svg {
  width: 13px;
  height: 13px;
  color: #ffffff;
}

.premium-popup__feature-text {
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.premium-popup__plan {
  margin: 0 0 4px;
  font-size: clamp(12px, 3.6vw, 14px);
  font-weight: 500;
  color: rgba(220, 220, 228, 0.78);
  text-align: left;
}

.premium-popup__amount {
  margin: 0 0 18px;
  font-size: clamp(12px, 3.6vw, 14px);
  font-weight: 500;
  color: rgba(220, 220, 228, 0.78);
  text-align: left;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.premium-popup__amount-value {
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 800;
  color: #f5a524;
  letter-spacing: -0.8px;
  line-height: 1;
  margin: 0;
}

.premium-popup__cta {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #b96a1b 0%, #8a4a10 100%);
  color: rgba(255, 240, 210, 0.9);
  font-size: clamp(14px, 4.2vw, 17px);
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  box-shadow:
    0 5px 14px rgba(185, 106, 27, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: transform 0.12s ease, opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.premium-popup__cta:active {
  transform: scale(0.97);
  opacity: 0.9;
}

@supports (padding: max(0px)) {
  .premium-popup {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
}
