/* ===== DEALZKART ONBOARDING — 2-step flow ===== */
:root {
  --onboard-bg-start: #0f172a;
  --onboard-bg-mid: #1e293b;
  --onboard-bg-end: #334155;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.5);
  --btn-primary-bg: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --white-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, var(--onboard-bg-start) 0%, var(--onboard-bg-mid) 45%, var(--onboard-bg-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
}

.onboarding-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  position: relative;
}

/* ----- Floating deal icons ----- */
.floating-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.float-icon {
  position: absolute;
  font-size: clamp(24px, 5vw, 40px);
  opacity: 0.25;
  animation: float 6s ease-in-out infinite;
}

.float-icon:nth-child(1) { left: 8%; top: 15%; animation-delay: 0s; }
.float-icon:nth-child(2) { right: 12%; top: 25%; animation-delay: 1s; }
.float-icon:nth-child(3) { left: 15%; bottom: 30%; animation-delay: 2s; }
.float-icon:nth-child(4) { right: 10%; bottom: 20%; animation-delay: 0.5s; }
.float-icon:nth-child(5) { left: 50%; top: 10%; animation-delay: 1.5s; }
.float-icon:nth-child(6) { right: 25%; bottom: 35%; animation-delay: 2.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

/* ----- Game theme layer (floating dice, coins, snakes, ladders) ----- */
.game-theme-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.game-icon {
  position: absolute;
  font-size: clamp(24px, 4vw, 32px);
  opacity: 0.15;
  animation: floatGame 10s infinite linear;
  bottom: -10%;
}

.game-icon.dice { animation-delay: 0s; }
.game-icon.coin { animation-delay: 2s; }
.game-icon.ladder { animation-delay: 4s; }
.game-icon.snake { animation-delay: 1s; }
.game-icon.star { animation-delay: 3s; }

@keyframes floatGame {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.25;
  }
  85% {
    opacity: 0.2;
  }
  100% {
    transform: translateY(-120vh) rotate(360deg);
    opacity: 0;
  }
}

/* ----- Subtle game board grid (snakes & ladders style) ----- */
.onboarding-root::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%);
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
  pointer-events: none;
  z-index: -1;
}

/* ----- Steps (pages) ----- */
.onboard-step {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: none;
  animation: fadeIn 0.5s ease forwards;
}

.onboard-step.active {
  display: block;
  animation: slideUpFade 0.5s ease forwards;
}

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

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

/* ----- Glass card base ----- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-card.white-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #1e293b;
  box-shadow: var(--white-card-shadow);
}

/* ----- Page 1 — Welcome ----- */
.onboard-welcome .welcome-logo {
  margin-bottom: 20px;
}

.onboard-welcome .logo-img {
  max-width: 120px;
  height: auto;
  border-radius: 16px;
}

.welcome-title {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.welcome-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 28px;
  line-height: 1.5;
}

.white-card .auth-subtitle {
  color: #64748b;
}

/* ----- Buttons ----- */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--btn-primary-bg);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glow:hover {
  box-shadow: 0 0 28px var(--accent-glow);
}

/* Ripple effect */
.btn-primary::after,
.btn-google::after,
.btn-secondary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:active::after,
.btn-google:active::after,
.btn-secondary:active::after {
  opacity: 1;
}

/* ----- Page 2 — Auth card ----- */
.auth-card.glass-card {
  padding: 36px 28px;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: inherit;
}

.auth-subtitle {
  font-size: 0.9rem;
  margin: 0 0 24px;
  color: var(--text-secondary);
}

/* Google button */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 133, 244, 0.25);
  border-color: #d1d5db;
}

.btn-google .google-icon {
  flex-shrink: 0;
}

.auth-divider {
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.white-card .auth-divider::before,
.white-card .auth-divider::after {
  background: #e2e8f0;
}

.auth-divider span {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
}

/* Secondary buttons (Login / Create Account) */
.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.btn-secondary:last-of-type {
  margin-bottom: 0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Auth / Login / Signup as links (same look as buttons) */
a.link-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
}
a.link-btn:last-of-type {
  margin-bottom: 0;
}

/* ----- Loader ----- */
.onboard-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}

.onboard-loader p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.onboard-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ----- Responsive ----- */
/* ----- Standalone login/signup form (auth pages) ----- */
.auth-form-page .glass-card {
  max-width: 420px;
  text-align: left;
}

.auth-form-page .auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.auth-form-page .input-group {
  position: relative;
}

.auth-form-page .input-group label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.2s ease;
  background: #fff;
  padding: 0 4px;
}

.auth-form-page .input-group input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 12px 40px 12px 12px;
  font-size: 0.95rem;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-page .input-group.input-group--password input {
  padding-right: 44px;
}

.auth-form-page .input-group input:focus,
.auth-form-page .input-group input:not(:placeholder-shown) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  background: #fff;
}

.auth-form-page .input-group input:focus + label,
.auth-form-page .input-group input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: var(--accent);
}

.auth-form-page .toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  user-select: none;
  padding: 4px;
}

.auth-form-page .auth-switch {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.auth-form-page .auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-form-page .auth-switch a:hover {
  text-decoration: underline;
}

.auth-form-page .primary-btn.auth-btn {
  width: 100%;
  margin-top: 4px;
}

.auth-form-page .auth-form.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 480px) {
  .onboarding-root {
    padding: 20px 16px 32px;
  }

  .glass-card {
    padding: 32px 20px;
  }

  .auth-card.glass-card {
    padding: 28px 20px;
  }

  .float-icon {
    font-size: 22px;
  }
}
