/* modern-ui.css — iPhone-Style Design System */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Colors */
  --bg-primary: #0a0a1a;
  --bg-secondary: #0d1117;
  --bg-tertiary: #16213e;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-quaternary: rgba(255, 255, 255, 0.3);
  
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-yellow: #eab308;
  --accent-cyan: #00d4ff;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --gradient-green: linear-gradient(135deg, #16a34a 0%, #06b6d4 100%);
  --gradient-dark: linear-gradient(180deg, #0a0a1a 0%, #16213e 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.3);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
}

/* ===== GLOBAL RESET ===== */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ===== SPLASH SCREEN ===== */
.fsn-splash {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fsn-splash-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
  animation: splashBgPulse 3s ease-in-out infinite;
}

@keyframes splashBgPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.fsn-splash-content {
  position: relative;
  text-align: center;
  animation: splashContentIn 800ms var(--ease-out);
}

@keyframes splashContentIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fsn-splash-logo {
  width: 140px;
  height: 140px;
  border-radius: 32px;
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-glow);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fsn-splash-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-sm);
}

.fsn-splash-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xl);
}

.fsn-splash-loader {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: loaderSpin 800ms linear infinite;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.fsn-splash-fadeout {
  animation: splashFadeOut 400ms var(--ease-out) forwards;
}

@keyframes splashFadeOut {
  to { opacity: 0; pointer-events: none; }
}

/* ===== ONBOARDING ===== */
.fsn-onboarding {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  animation: onbIn 400ms var(--ease-out);
}

@keyframes onbIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fsn-onb-skip {
  position: absolute;
  top: env(safe-area-inset-top, 16px);
  right: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  z-index: 10;
  background: none;
  border: none;
  margin-top: 16px;
}

.fsn-onb-slides {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.fsn-onb-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
  opacity: 0;
  transform: translateX(40px);
  transition: all var(--duration-base) var(--ease-out);
  pointer-events: none;
}

.fsn-onb-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.fsn-onb-slide.prev {
  transform: translateX(-40px);
}

.fsn-onb-illustration {
  width: 200px;
  height: 200px;
  border-radius: 40px;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  position: relative;
}

.fsn-onb-slide:nth-child(1) .fsn-onb-illustration {
  background: var(--gradient-primary);
}
.fsn-onb-slide:nth-child(2) .fsn-onb-illustration {
  background: var(--gradient-blue);
}
.fsn-onb-slide:nth-child(3) .fsn-onb-illustration {
  background: var(--gradient-purple);
}

.fsn-onb-illustration::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50px;
  background: inherit;
  filter: blur(40px);
  opacity: 0.5;
  z-index: -1;
}

.fsn-onb-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.fsn-onb-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
}

.fsn-onb-bottom {
  padding: var(--space-xl);
  padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0));
}

.fsn-onb-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.fsn-onb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all var(--duration-base) var(--ease-out);
}

.fsn-onb-dot.active {
  width: 24px;
  background: var(--accent-orange);
  border-radius: 4px;
}

.fsn-onb-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  letter-spacing: -0.01em;
}

.fsn-onb-btn:active {
  transform: scale(0.97);
}

.fsn-onb-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

/* ===== HAPTIC FEEDBACK ===== */
.haptic-light:active {
  transform: scale(0.97);
}

/* Hide on small screens */
@media (max-width: 380px) {
  .fsn-onb-illustration { width: 160px; height: 160px; font-size: 80px; }
  .fsn-onb-title { font-size: 26px; }
}
