:root {
  --bg: #000000;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);
  --blue: #0071e3;
  --blue-link: #2997ff;
  --green: #30d158;
  --amber: #ffd60a;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, Arial, sans-serif;
  background-color: var(--bg);
  color: #f5f5f7;
  overflow-x: hidden;
}

/* VisionOS Spatial Stage: Liquid Orbs + Brand Watermark */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, #070b16 0%, #020308 55%, #000000 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  will-change: transform;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.orb-sapphire {
  width: 680px;
  height: 680px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.42) 0%, rgba(41, 151, 255, 0.16) 45%, transparent 72%);
  animation: orbDriftA 18s ease-in-out infinite alternate;
}

.orb-indigo {
  width: 640px;
  height: 640px;
  top: 12%;
  right: -140px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.36) 0%, rgba(94, 92, 230, 0.14) 46%, transparent 72%);
  animation: orbDriftB 21s ease-in-out infinite alternate;
}

.orb-cyan {
  width: 560px;
  height: 560px;
  bottom: -180px;
  left: 34%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(0, 113, 227, 0.12) 48%, transparent 72%);
  animation: orbDriftC 24s ease-in-out infinite alternate;
}

@keyframes orbDriftA {
  0% { translate: 0 0; scale: 1; }
  50% { translate: 55px 35px; scale: 1.08; }
  100% { translate: -25px 65px; scale: 0.96; }
}
@keyframes orbDriftB {
  0% { translate: 0 0; scale: 1; }
  50% { translate: -60px 45px; scale: 1.07; }
  100% { translate: 25px -40px; scale: 0.95; }
}
@keyframes orbDriftC {
  0% { translate: 0 0; scale: 1; }
  50% { translate: 45px -45px; scale: 1.1; }
  100% { translate: -50px -20px; scale: 0.96; }
}

/* Subtle Massive WIBECODE Typographic Watermark */
.bg-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: none;
  transform: translateY(-2%);
  mask-image: radial-gradient(ellipse 88% 72% at 50% 50%, #000 35%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 88% 72% at 50% 50%, #000 35%, transparent 92%);
}
.bg-watermark > span:first-child {
  font-size: clamp(96px, 16.5vw, 250px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: rgba(255, 255, 255, 0.028);
  -webkit-text-stroke: 1px rgba(120, 180, 255, 0.075);
  white-space: nowrap;
}
.bg-watermark-sub {
  margin-top: 10px;
  font-size: clamp(14px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: rgba(120, 185, 255, 0.065);
  white-space: nowrap;
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

/* Subtle Spatial Perspective Grid */
.spatial-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 20%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 20%, transparent 88%);
}

/* Fine Organic Film Grain */
.film-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes auraFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.92; }
  50% { transform: translate3d(1.8%, -1.5%, 0) scale(1.05); opacity: 1; }
  100% { transform: translate3d(-1.6%, 1.2%, 0) scale(0.98); opacity: 0.94; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tabFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-140%) skewX(-20deg); }
  100% { transform: translateX(260%) skewX(-20deg); }
}

@keyframes popCheck {
  0% { opacity: 0; transform: scale(0.5); }
  70% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

.anim-1 { animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-2 { animation: fadeUp 0.6s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-3 { animation: fadeUp 0.65s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-4 { animation: fadeUp 0.7s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }

.live-dot {
  animation: pulseDot 2.4s ease-in-out infinite;
}

/* VisionOS Liquid Glass Card with Specular Edge & 3D Tilt */
.glass-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    155deg,
    rgba(36, 40, 52, 0.52) 0%,
    rgba(18, 20, 28, 0.68) 48%,
    rgba(10, 11, 16, 0.78) 100%
  );
  border: 1px solid var(--border);
  backdrop-filter: saturate(200%) blur(34px);
  -webkit-backdrop-filter: saturate(200%) blur(34px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.55);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: border-color 0.28s ease, box-shadow 0.3s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Mouse-tracked Liquid Spotlight */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(72, 168, 255, 0.14),
    rgba(130, 108, 255, 0.05) 35%,
    transparent 68%
  );
  transition: opacity 0.35s ease;
}

/* Specular Liquid Rim Glow */
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.26) 0%,
    rgba(41, 151, 255, 0.2) 32%,
    rgba(255, 255, 255, 0.04) 65%,
    rgba(130, 108, 255, 0.18) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 28px 68px rgba(0, 0, 0, 0.65),
    0 0 36px rgba(41, 151, 255, 0.08);
}

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

.glass-card:hover::after {
  opacity: 0.95;
}

/* VisionOS Trust Pill Bar */
.trust-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Apple Input with Smart Validation State */
.apple-input {
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #f5f5f7;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.apple-input:focus {
  outline: none;
  border-color: var(--blue-link);
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.78);
}
.apple-input.is-valid {
  border-color: rgba(48, 209, 88, 0.55);
  box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.12), inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.apple-input.is-invalid {
  border-color: rgba(255, 69, 58, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.apple-input::placeholder { color: #5b5b63; }

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

.attention-ring {
  border-color: rgba(255, 159, 10, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.2);
  animation: gentleShake 0.42s ease;
}

.guide-pulse {
  box-shadow: 0 0 0 2px rgba(90, 200, 250, 0.55), 0 0 32px rgba(41, 151, 255, 0.25) !important;
}

/* Inline Valid Checkmark */
.valid-check {
  display: none;
  color: var(--green);
  pointer-events: none;
}
.valid-check.show {
  display: inline-flex;
  animation: popCheck 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Compact Paste Pill inside Input */
.paste-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c7c7cc;
  transition: all 0.18s ease;
}
.paste-btn:hover {
  background: rgba(41, 151, 255, 0.22);
  border-color: rgba(41, 151, 255, 0.45);
  color: #ffffff;
}

/* Circular Apple 2FA Countdown Ring */
.totp-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
}
.totp-ring-progress {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.35s linear, stroke 0.25s ease;
}
.totp-ring-progress.warn {
  stroke: var(--amber);
}

/* Apple Primary CTA with Liquid Shimmer */
.btn-apple {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #258cff 0%, #0066d6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 28px rgba(0, 113, 227, 0.38);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.2s ease;
}
.btn-apple::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-140%) skewX(-20deg);
}
.btn-apple:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 14px 34px rgba(0, 113, 227, 0.5);
}
.btn-apple:hover::after {
  animation: shimmerSweep 0.85s ease;
}
.btn-apple:active { transform: translateY(0) scale(0.985); }
.btn-apple:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Apple iOS Toggle Switch */
.ios-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ios-slider {
  position: absolute;
  inset: 0;
  background: #39393d;
  border-radius: 999px;
  transition: background 0.22s ease;
  cursor: pointer;
}
.ios-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.42);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.ios-switch input:checked + .ios-slider {
  background: var(--green);
}
.ios-switch input:checked + .ios-slider::before {
  transform: translateX(18px);
}

/* Sliding iOS Segmented Control */
.seg-wrap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}
.seg-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(25% - 2px);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(64, 64, 72, 0.95) 0%, rgba(44, 44, 50, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 3px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
.seg-btn {
  position: relative;
  z-index: 1;
  transition: color 0.18s ease;
}

.guide-pane { display: none; }
.guide-pane.active {
  display: block;
  animation: tabFade 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Timeline Step States */
.step-pill {
  padding: 8px 6px;
  border-radius: 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: #86868b;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}
.step-pill.active {
  color: #ffffff;
  background: rgba(0, 113, 227, 0.24);
  border-color: rgba(41, 151, 255, 0.6);
}
.step-pill.done {
  color: #7ae598;
  background: rgba(48, 209, 88, 0.14);
  border-color: rgba(48, 209, 88, 0.4);
}
.step-pill.err {
  color: #ff8a82;
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.4);
}

/* Floating Apple Dynamic Island Support/Shop Widget */
.dynamic-island {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(14, 14, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 40px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(41, 151, 255, 0.15);
  transition: all 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}
.dynamic-island-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, margin-left 0.3s ease;
}
.dynamic-island:hover .dynamic-island-actions,
.dynamic-island.expanded .dynamic-island-actions {
  max-width: 340px;
  opacity: 1;
  margin-left: 6px;
}
