/* ===== Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Colors */
  --bg-primary: #0d0d1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 55, 0.7);
  --bg-card-hover: rgba(40, 40, 70, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --text-muted: #55557a;
  --accent-gold: #e2b714;
  --accent-gold-dim: rgba(226, 183, 20, 0.15);
  --accent-blue: #3a7bd5;
  --accent-blue-dim: rgba(58, 123, 213, 0.15);
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --gradient-hero: linear-gradient(135deg, #0d0d1a 0%, #16213e 50%, #0f3460 100%);
  --gradient-gold: linear-gradient(135deg, #e2b714, #f0d060);
  --gradient-card: linear-gradient(145deg, rgba(30, 30, 55, 0.9), rgba(20, 20, 40, 0.6));
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-gold: 0 4px 20px rgba(226, 183, 20, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== Background Animation ===== */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-animation .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float 20s infinite ease-in-out;
}

.bg-animation .orb:nth-child(1) {
  width: 500px;
  height: 500px;
  background: var(--accent-blue);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.bg-animation .orb:nth-child(2) {
  width: 400px;
  height: 400px;
  background: var(--accent-gold);
  bottom: -80px;
  left: -80px;
  animation-delay: -7s;
}

.bg-animation .orb:nth-child(3) {
  width: 300px;
  height: 300px;
  background: #6c5ce7;
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -50px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(50px, 30px) scale(1.02);
  }
}

/* ===== Particle Canvas ===== */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Header ===== */
.header {
  position: relative;
  z-index: 10;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  background: rgba(13, 13, 26, 0.8);
  animation: headerSlideDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes headerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--bg-primary);
  animation: logoPulse 3s ease-in-out infinite;
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-sm);
  background: var(--gradient-gold);
  opacity: 0;
  z-index: -1;
  filter: blur(8px);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes logoGlow {

  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 0.5;
  }
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.header-tagline {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: taglineFade 1.2s 0.5s ease both;
}

@keyframes taglineFade {
  from {
    opacity: 0;
    letter-spacing: 8px;
  }

  to {
    opacity: 1;
    letter-spacing: 2px;
  }
}

/* ===== Main Container ===== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ===== Progress Steps ===== */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
  padding: 0 20px;
  animation: fadeSlideUp 0.6s 0.3s ease both;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  background: var(--bg-primary);
  transition: var(--transition-bounce);
  position: relative;
}

.step-indicator.active .step-circle {
  border-color: var(--accent-gold);
  color: var(--bg-primary);
  background: var(--gradient-gold);
  box-shadow: var(--shadow-gold);
  transform: scale(1.1);
  animation: activeStepPulse 2s ease-in-out infinite;
}

@keyframes activeStepPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(226, 183, 20, 0.25);
  }

  50% {
    box-shadow: 0 4px 30px rgba(226, 183, 20, 0.5), 0 0 60px rgba(226, 183, 20, 0.1);
  }
}

.step-indicator.completed .step-circle {
  border-color: var(--accent-green);
  color: #fff;
  background: var(--accent-green);
  animation: completedPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes completedPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

.step-indicator.active .step-label {
  color: var(--accent-gold);
  font-weight: 600;
}

.step-indicator.completed .step-label {
  color: var(--accent-green);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.3;
  margin: 0 -4px;
  margin-bottom: 24px;
  transition: var(--transition-slow);
  max-width: 140px;
  position: relative;
  overflow: hidden;
}

.step-line.completed {
  background: var(--accent-green);
  opacity: 1;
}

.step-line.completed::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: lineShimmer 1.5s ease forwards;
}

@keyframes lineShimmer {
  to {
    left: 100%;
  }
}

/* ===== Step Panels ===== */
.step-panel {
  display: none;
  animation: stepEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-panel.active {
  display: block;
}

@keyframes stepEnter {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ===== Section Title ===== */
.section-title {
  text-align: center;
  margin-bottom: 36px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  animation: titleReveal 0.8s 0.2s ease both;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 4px;
  }

  to {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: -0.5px;
  }
}

.section-title h2 .highlight {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.section-title p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  animation: subtitleFade 0.8s 0.5s ease both;
}

@keyframes subtitleFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Photo Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-glass);
  position: relative;
  overflow: hidden;
  animation: uploadAreaEntry 0.7s 0.6s ease both;
}

@keyframes uploadAreaEntry {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Shimmer border effect on hover */
.upload-area::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
      transparent 30%,
      var(--accent-gold) 50%,
      transparent 70%);
  background-size: 300% 300%;
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.upload-area:hover::before {
  opacity: 1;
  animation: borderShimmer 2s linear infinite;
}

@keyframes borderShimmer {
  0% {
    background-position: 200% 200%;
  }

  100% {
    background-position: -200% -200%;
  }
}

.upload-area:hover {
  border-color: transparent;
  background: var(--accent-gold-dim);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(226, 183, 20, 0.1);
}

.upload-area.dragover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(226, 183, 20, 0.15);
}

.upload-area.has-image {
  padding: 20px;
  border-style: solid;
  border-color: var(--accent-green);
}

.upload-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.7;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.upload-area h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
}

.upload-area .upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.upload-preview {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.upload-preview img {
  max-width: 280px;
  max-height: 350px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-card);
  animation: imageReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-2deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.upload-preview .change-btn {
  font-size: 13px;
  color: var(--accent-gold);
  background: none;
  border: 1px solid var(--accent-gold);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-preview .change-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(226, 183, 20, 0.2), transparent);
  transition: left 0.5s ease;
}

.upload-preview .change-btn:hover::before {
  left: 100%;
}

.upload-preview .change-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  transform: scale(1.05);
}

.upload-content {
  display: block;
}

#fileInput {
  display: none;
}

/* ===== Form / Input Section ===== */
.info-form {
  background: var(--gradient-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  animation: formEntry 0.6s ease;
}

/* Subtle moving gradient on form */
.info-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      var(--accent-gold),
      transparent);
  background-size: 200% 100%;
  animation: topLineGlow 4s ease-in-out infinite;
}

@keyframes topLineGlow {

  0%,
  100% {
    background-position: 200% 0;
  }

  50% {
    background-position: -200% 0;
  }
}

@keyframes formEntry {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition);
}

.form-group:focus-within label {
  color: var(--accent-gold);
}

.form-group input {
  padding: 14px 18px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-group input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim), 0 0 20px rgba(226, 183, 20, 0.08);
  transform: translateY(-1px);
}

.form-group .unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Style Preference */
.style-preference {
  margin-bottom: 32px;
}

.style-preference>label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.style-option {
  position: relative;
}

.style-option input[type="radio"] {
  display: none;
}

.style-option .option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  cursor: pointer;
  transition: var(--transition-bounce);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.style-option .option-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent-gold-dim), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.style-option .option-card:hover::after {
  opacity: 1;
}

.style-option .option-card:hover {
  border-color: rgba(226, 183, 20, 0.3);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.style-option input:checked+.option-card {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
  box-shadow: 0 0 0 1px var(--accent-gold), 0 8px 20px rgba(226, 183, 20, 0.15);
  transform: translateY(-2px);
}

.style-option input:checked+.option-card::after {
  opacity: 1;
}

.style-option .option-icon {
  font-size: 32px;
  transition: var(--transition-bounce);
  position: relative;
  z-index: 1;
}

.style-option .option-card:hover .option-icon {
  transform: scale(1.2) rotate(-5deg);
}

.style-option .option-name {
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.style-option .option-desc {
  font-size: 11px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  background: var(--gradient-gold);
  color: var(--bg-primary);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

/* Shine sweep animation */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::before {
  left: 120%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(226, 183, 20, 0.35);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(226, 183, 20, 0.25);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled::before {
  display: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.03);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.btn-secondary:hover::before {
  transform: scaleX(1);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.buttons-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.buttons-row .btn-primary {
  flex: 2;
}

.buttons-row .btn-secondary {
  flex: 1;
}

/* ===== Loading State ===== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(10px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.loading-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.4s ease;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

.loading-spinner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid transparent;
  border-bottom-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1.2s linear reverse infinite;
}

.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 2px solid transparent;
  border-left-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay h3 {
  font-size: 22px;
  font-weight: 700;
  animation: loadTextPulse 1.5s ease-in-out infinite;
}

@keyframes loadTextPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
  transform: translateX(0);
}

.loading-step.active {
  color: var(--accent-gold);
  transform: translateX(8px);
}

.loading-step.done {
  color: var(--accent-green);
}

/* ===== Results Section ===== */
.result-header {
  text-align: center;
  margin-bottom: 40px;
}

.body-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent-gold-dim);
  border: 1px solid var(--accent-gold);
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 16px;
  animation: badgePop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  overflow: hidden;
}

.body-type-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(226, 183, 20, 0.3), transparent);
  animation: badgeShimmer 3s 1s ease-in-out infinite;
}

@keyframes badgeShimmer {

  0%,
  100% {
    left: -100%;
  }

  50% {
    left: 100%;
  }
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.body-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  animation: statReveal 0.5s ease forwards;
}

.stat-item:nth-child(1) {
  animation-delay: 0.5s;
}

.stat-item:nth-child(2) {
  animation-delay: 0.7s;
}

.stat-item:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes statReveal {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

/* Counter animation class added dynamically */
.stat-value.counting {
  animation: countPulse 0.1s ease;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Recommendation Cards */
.rec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.rec-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  position: relative;
  overflow: hidden;
}

/* Animated reveal with stagger */
.rec-card.visible {
  animation: recCardReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.rec-card:nth-child(1).visible {
  animation-delay: 0.1s;
}

.rec-card:nth-child(2).visible {
  animation-delay: 0.2s;
}

.rec-card:nth-child(3).visible {
  animation-delay: 0.35s;
}

.rec-card:nth-child(4).visible {
  animation-delay: 0.5s;
}

.rec-card:nth-child(5).visible {
  animation-delay: 0.65s;
}

@keyframes recCardReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hover glow effect */
.rec-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(226, 183, 20, 0.08) 0%,
      transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.rec-card:hover {
  border-color: rgba(226, 183, 20, 0.25);
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(226, 183, 20, 0.05);
}

.rec-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.rec-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  transition: var(--transition-bounce);
}

.rec-card:hover .rec-card-icon {
  transform: scale(1.15) rotate(-5deg);
  background: rgba(226, 183, 20, 0.25);
}

.rec-card-title {
  font-size: 18px;
  font-weight: 700;
}

.rec-card-category {
  font-size: 11px;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.rec-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.rec-item-tag {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

.rec-item-tag:hover {
  background: var(--accent-gold-dim);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(226, 183, 20, 0.1);
}

.rec-reason {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 12px 16px;
  background: rgba(226, 183, 20, 0.05);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: var(--transition);
}

.rec-card:hover .rec-reason {
  background: rgba(226, 183, 20, 0.08);
}

.rec-reason strong {
  color: var(--accent-gold);
}

/* Color Palette */
.color-palette {
  background: var(--gradient-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
}

.color-palette.visible {
  animation: recCardReveal 0.6s ease forwards;
}

.color-palette h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
}

.color-swatch.visible {
  animation: swatchPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes swatchPop {
  from {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.swatch-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-bounce);
  cursor: pointer;
  position: relative;
}

.swatch-circle::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition);
}

.swatch-circle:hover {
  transform: scale(1.2) translateY(-4px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.swatch-circle:hover::after {
  opacity: 1;
  transform: scale(1);
}

.swatch-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* Tips Section */
.tips-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
}

.tips-card.visible {
  animation: recCardReveal 0.6s ease forwards;
}

.tips-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tip-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  opacity: 0;
  transform: translateX(-20px);
}

.tip-item.visible {
  animation: tipSlideIn 0.5s ease forwards;
}

@keyframes tipSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tip-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(6px);
}

.tip-item .tip-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  opacity: 0;
  animation: fadeSlideUp 0.5s 1s ease forwards;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-actions .btn-primary {
  flex: 1;
}

.result-actions .btn-secondary {
  flex: 1;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px;
  border-top: 1px solid var(--border-glass);
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Scroll-triggered Animation Base ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 8px;
  }

  .main-container {
    padding: 24px 16px 60px;
  }

  .progress-bar {
    margin-bottom: 32px;
  }

  .step-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .step-label {
    font-size: 10px;
  }

  .section-title h2 {
    font-size: 24px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .info-form {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .style-options {
    grid-template-columns: 1fr;
  }

  .buttons-row {
    flex-direction: column;
  }

  .body-stats {
    gap: 20px;
  }

  .color-swatches {
    justify-content: center;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .step-line {
    max-width: 60px;
  }

  .upload-preview img {
    max-width: 200px;
    max-height: 260px;
  }

  .rec-card {
    padding: 20px;
  }
}