:root {
  /* Lighter gradient background, closer to white */
  --sky-gradient: radial-gradient(circle at 50% -20%, #f7fcff 0%, #edf7fd 35%, #e1f1f9 65%, #cce7f5 100%);
  --glass-bg: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(255, 255, 255, 0.95);
  --glass-highlight: rgba(255, 255, 255, 0.98);
  
  --color-primary: #007aff; /* iOS Blue */
  --color-accent: #34c759; /* iOS Green */
  --color-accent-glow: rgba(52, 199, 89, 0.25);
  
  --text-main: #1c1c1e;
  --text-secondary: #48484a;
  --text-muted: #8e8e93;
  
  --border-radius: 32px;
  --transition-speed: 0.4s;
  --transition-timing: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar { display: none; }

body {
  background: var(--sky-gradient);
  color: var(--text-main);
  min-height: 100vh;
  /* Use clean system Helvetica Neue font stack exclusively */
  font-family: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(80px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* Glassy Horizon Arc Overlay */
.sky-bg::before {
  content: '';
  position: fixed;
  top: 55%;
  left: -20%;
  width: 140%;
  height: 80%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  transform: rotate(-4deg);
  pointer-events: none;
  z-index: 1;
}

/* Floating CSS Cloud Backdrop Layer */
.sky-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  filter: blur(16px);
  animation: floatCloud 45s linear infinite;
  opacity: 0.85;
}

.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.cloud-1 { width: 250px; height: 70px; top: 15%; left: -300px; animation-duration: 50s; }
.cloud-1::before { width: 100px; height: 100px; top: -50px; left: 40px; }
.cloud-1::after  { width: 130px; height: 130px; top: -75px; left: 90px; }

.cloud-2 { width: 180px; height: 50px; bottom: 25%; left: -200px; animation-duration: 38s; animation-delay: 15s; }
.cloud-2::before { width: 70px; height: 70px; top: -35px; left: 30px; }
.cloud-2::after  { width: 90px; height: 90px; top: -50px; left: 70px; }

.cloud-3 { width: 320px; height: 90px; top: 50%; left: -400px; animation-duration: 65s; animation-delay: 5s; opacity: 0.65; }
.cloud-3::before { width: 130px; height: 130px; top: -65px; left: 50px; }
.cloud-3::after  { width: 160px; height: 160px; top: -95px; left: 120px; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 450px)); }
}

/* Centered Card Wrapper */
.stripe-main-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  animation: cardEntrance 0.9s var(--transition-timing) forwards;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: scale(0.96) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Liquid Glass Card Container */
.stripe-card {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(60px) saturate(240%) brightness(1.05);
  -webkit-backdrop-filter: blur(60px) saturate(240%) brightness(1.05);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 24px 32px 32px;
  box-shadow: 
    0 50px 100px rgba(0, 0, 0, 0.05),
    0 15px 35px rgba(0, 0, 0, 0.03),
    inset 0 2.5px 0 var(--glass-highlight),
    inset 0 -1.5px 2px rgba(255, 255, 255, 0.4),
    inset 0 12px 24px rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

/* Glossy highlight reflection sweep */
.stripe-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  z-index: 1;
}

/* Custom Header with Progress Bar */
.tf-header {
  padding: 12px 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.tf-step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tf-progress-track {
  width: 130px;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 0.5px solid rgba(255, 255, 255, 0.5);
}

.tf-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #5ac8fa 100%);
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.4);
  transition: width var(--transition-speed) var(--transition-timing);
}

.tf-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.tf-slider {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-speed) var(--transition-timing);
}

.tf-card {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tf-card.active {
  opacity: 1;
}

/* Staggered load animation to match premium iOS 26 conversational style */
.tf-card > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.55s var(--transition-timing);
}

.tf-card.active > * {
  opacity: 1;
  transform: translateY(0);
}

.tf-card.active > .step-badge { transition-delay: 0.06s; }
.tf-card.active > h2 { transition-delay: 0.12s; }
.tf-card.active > .card-desc { transition-delay: 0.18s; }
.tf-card.active > .stripe-perks-container { transition-delay: 0.24s; }
.tf-card.active > .stripe-input-group { transition-delay: 0.24s; }
.tf-card.active > .interest-grid { transition-delay: 0.24s; }
.tf-card.active > .btn-stripe-primary { transition-delay: 0.3s; }
.tf-card.active > .success-check-badge { transition-delay: 0.12s; }
.tf-card.active > .mini-graph { transition-delay: 0.24s; }

/* Step content inner wrapper */
.step-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.stripe-badge, .step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 122, 255, 0.06);
  border: 1px solid rgba(0, 122, 255, 0.1);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 20px;
  align-self: center;
}

.stripe-card h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.25;
  text-align: center;
}

.stripe-card h2 strong {
  color: var(--color-primary);
}

.stripe-card .card-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
  text-align: center;
}

/* Premium Perk Capsules inside Step 0 */
.stripe-perks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 26px;
  max-width: 380px;
  width: 100%;
}

.stripe-perk-capsule {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.52);
  border: 1.2px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255,255,255,0.95);
  transition: all 0.25s var(--transition-timing);
}

.stripe-perk-capsule:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255,255,255,1);
}

.capsule-icon {
  font-size: 1.45rem;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,0.9),
    0 2px 6px rgba(0,0,0,0.02);
  flex-shrink: 0;
}

.capsule-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.capsule-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.2;
}

.capsule-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Bold iOS 26 Input Fields inside Liquid Glass */
.stripe-input-group {
  position: relative;
  margin: 0 auto 18px;
  max-width: 380px;
  width: 100%;
}

.stripe-input {
  width: 100%;
  padding: 20px 14px 6px;
  font-family: inherit;
  font-size: 1.45rem; /* Large and bold */
  font-weight: 700;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-bottom: 2px solid rgba(0, 122, 255, 0.22);
  border-radius: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.25s ease;
  -webkit-appearance: none;
}

.stripe-input-group label {
  position: absolute;
  left: 14px;
  top: 15px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.2s var(--transition-timing);
  transform-origin: left top;
}

.stripe-input:focus ~ label,
.stripe-input:not(:placeholder-shown) ~ label {
  transform: translateY(-8px) scale(0.72);
  color: var(--color-primary);
  font-weight: 700;
}

.stripe-input:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--color-primary);
  box-shadow: 
    0 6px 24px rgba(0, 122, 255, 0.08), 
    0 0 0 4px rgba(0, 122, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.stripe-error {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ff3b30;
  margin-top: 6px;
  display: none;
  padding-left: 12px;
}

/* Primary Button (Glossy Apple Liquid Glass Effect) */
.btn-stripe-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 50.1%, rgba(255, 255, 255, 0.05) 100%), var(--color-primary);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  padding: 15px 32px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 
    0 6px 20px rgba(0, 122, 255, 0.28), 
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  outline: none;
  align-self: center;
  margin-top: auto;
}

.btn-stripe-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 24px rgba(0, 122, 255, 0.35), 
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.btn-stripe-primary:active {
  transform: translateY(1px);
}

.stripe-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* STEP 2: Interests Grid styling */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 auto 28px;
  max-width: 380px;
  width: 100%;
}

.interest-pill {
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255,255,255,0.9);
  transition: all 0.25s ease;
  user-select: none;
}

.interest-pill:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

.pill-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  transition: all 0.2s ease;
  background: #ffffff;
}

.interest-pill.selected {
  background: rgba(0, 122, 255, 0.08);
  border-color: rgba(0, 122, 255, 0.45);
  color: var(--color-primary);
}

.interest-pill.selected .pill-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* STEP 3: Success Screen Animations */
.success-check-badge {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle at 35% 35%, #34c759 0%, #28cd41 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 
    0 8px 24px rgba(52, 199, 89, 0.35), 
    inset 0 2px 4px rgba(255, 255, 255, 0.7), 
    0 0 0 8px rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 20px;
  animation: pulseEco 2.5s infinite;
}

@keyframes pulseEco {
  0% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(52, 199, 89, 0.18); }
  70% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 16px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7), 0 0 0 0 rgba(52, 199, 89, 0); }
}

.mini-graph {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 140px;
  height: 60px;
  margin: 10px 0 28px;
}

.graph-bar {
  width: 22px;
  background: var(--text-muted);
  border-radius: 4px;
  opacity: 0.15;
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 10px;
}

.tf-card.active .bar-1 { height: 35%; opacity: 0.6; background: var(--color-primary); }
.tf-card.active .bar-2 { height: 55%; opacity: 0.6; background: var(--color-primary); }
.tf-card.active .bar-3 { height: 70%; opacity: 0.6; background: var(--color-primary); }
.tf-card.active .bar-4 { height: 95%; opacity: 1; background: var(--color-accent); }

/* Watermark Badge (Global at page bottom) */
.stripe-watermark {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.62);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  text-decoration: none;
  font-weight: 500;
  z-index: 100;
  transition: background 0.2s ease, color 0.2s ease;
  cursor: default;
  white-space: nowrap;
  user-select: none;
  opacity: 0;
  animation: badgeEntrance 0.9s var(--transition-timing) forwards;
  animation-delay: 0.35s;
}

.stripe-watermark:hover {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(0, 0, 0, 0.85);
  transform: translate(-50%, 0);
}

.stripe-watermark strong {
  font-weight: 700;
  color: #000000;
}

@keyframes badgeEntrance {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Responsive Overrides (Mobile view) */
@media (max-width: 800px) {
  body {
    align-items: flex-start;
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(80px + env(safe-area-inset-bottom));
    overflow-y: auto;
    padding-top: calc(32px + env(safe-area-inset-top));
  }

  .stripe-main-wrapper {
    max-width: 100%;
  }

  .stripe-card {
    padding: 24px 20px 26px;
    border-radius: 26px;
    min-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stripe-card h2 {
    font-size: 1.55rem;
  }

  .stripe-card .card-desc {
    font-size: 0.98rem;
    margin-bottom: 18px;
  }

  .stripe-input {
    font-size: 1.25rem;
    padding: 18px 14px 8px;
  }

  .stripe-input-group label {
    font-size: 1rem;
    top: 14px;
  }

  .interest-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .interest-pill {
    font-size: 0.95rem;
    padding: 14px 12px;
  }

  .btn-stripe-primary {
    font-size: 1.05rem;
    padding: 16px;
    width: 100%;
    justify-content: center;
  }

  .stripe-watermark {
    bottom: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    color: rgba(0, 0, 0, 0.45);
  }

  .stripe-watermark:hover {
    background: transparent;
    transform: translate(-50%, 0);
  }
}
