:root {
  --apple-blue: #32ade6;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: #000000;
  background-image: radial-gradient(
    circle at 30% 30%,
    #1a1a1a 0%,
    #050505 100%
  );
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  /* Let flex children handle their own positioning */
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer; /* Indicates the whole screen is clickable */
}

.bg-reflection {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background:
    radial-gradient(
      circle at 15% 50%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 50%
    );
  z-index: 0;
  pointer-events: none;
}

.top-text {
  width: 100%;
  padding: max(20px, env(safe-area-inset-top, 20px)) 5px 10px 5px;
  font-size: clamp(
    8px,
    2.8vw,
    14px
  ); /* Scales down aggressively on small screens */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  box-sizing: border-box;
  z-index: 10;
  letter-spacing: -0.2px;
  white-space: nowrap; /* Force single line as requested */
}

.top-text strong {
  font-weight: 600;
  color: #ffffff;
}

.modal-container {
  flex-grow: 1; /* Pushes footer down, takes up remaining space */
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px 0;
}

.modal {
  background: rgba(45, 45, 45, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 28px;
  padding: 25px 15px; /* Tighter padding */
  width: 94%; /* Increased width to prevent text wrapping */
  max-width: 380px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  transition: height 0.4s ease;
}

.apple-logo-svg {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  fill: rgba(
    255,
    255,
    255,
    0.25
  ); /* Lightened to be visible on dark background */
}

.sending-to {
  font-size: 13px; /* Reduced to ensure single line */
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
  font-weight: 400;
  letter-spacing: -0.2px;
}

.sending-to strong {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.amount {
  font-size: 42px; /* Slightly smaller for mobile */
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -1.2px;
}

/* State Containers */
.state-container {
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

.hidden-state {
  display: none;
  opacity: 0;
}

/* Loading State */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px; /* Reduced from 30px */
}

.face-id-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid var(--apple-blue);
  box-shadow:
    0 0 12px rgba(50, 173, 230, 0.4),
    inset 0 0 12px rgba(50, 173, 230, 0.4);
  animation: pulse 2s infinite ease-in-out;
  position: relative;
}

.face-id-circle::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.3);
  animation: spin 1.5s linear infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.97);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(0.97);
    opacity: 0.8;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.authorizing-text {
  font-size: 13px; /* Reduced to prevent wrapping */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.1px;
}

/* Success State */
.success-icon {
  width: 54px;
  height: 54px;
  background-color: #34c759; /* Apple Green */
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
}

.check-svg {
  fill: white;
  width: 36px;
  height: 36px;
}

/* Receipt State */
.payment-sent {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.receipt-desc {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
}

.receipt-details {
  font-size: 14px;
  line-height: 2;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.9);
}

.receipt-details .green-check {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: #34c759;
  border-radius: 4px;
  color: white;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  vertical-align: middle;
  margin-left: 4px;
}

.download-btn {
  background-color: #0a84ff;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.download-btn:hover {
  background-color: #007aff;
}

.download-icon {
  width: 18px;
  height: 18px;
  fill: white;
}

.warning-box {
  background-color: rgba(50, 50, 50, 0.7);
  border-left: 4px solid #ff453a;
  border-radius: 12px;
  padding: 12px 14px; /* Reduced padding for iPhone */
  text-align: left;
  font-size: 12px; /* Slightly smaller to fit better */
  line-height: 1.4;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.warning-box p {
  margin: 0 0 10px 0;
}

.warning-box p:last-child {
  margin-bottom: 0;
}

.warning-box em {
  font-style: italic;
}

/* Why payment box below modal */
.why-payment-box {
  background: rgba(45, 45, 45, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 16px;
  padding: 16px;
  width: 94%; /* Match modal width */
  max-width: 380px;
  box-sizing: border-box;
  text-align: left;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.why-payment-box strong {
  color: rgba(255, 255, 255, 0.8);
}

.bottom-text {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding-bottom: env(safe-area-inset-bottom, 20px);
  z-index: 10;
}
