/* ═══════════════════════════════════════════════════
   PASSPORT PHOTO STUDIO — STYLE.CSS
   Modern dark gradient UI
═══════════════════════════════════════════════════ */

:root {
  --bg: #0a0f1e;
  --bg2: #0e1529;
  --card: #121928;
  --card2: #1a2340;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(99,163,255,0.25);
  --primary: #3b82f6;
  --primary-glow: rgba(59,130,246,0.35);
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --accent: #0ea5e9;
  --success: #22c55e;
  --danger: #ef4444;
  --text: #f0f4ff;
  --text-muted: #8899bb;
  --text-dim: #4a5878;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(59,130,246,0.15);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

/* ── BACKGROUND GRID ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99,102,241,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10,15,30,0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-brand { font-size: 1rem; font-weight: 800; color: var(--text); }
.logo-sub { font-size: .7rem; font-weight: 500; color: var(--text-muted); letter-spacing: .05em; text-transform: uppercase; }

.header-nav { display: flex; align-items: center; gap: .25rem; }

.nav-link {
  padding: .4rem .9rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

/* ════════════════════════════════════════
   HERO
════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 4rem 1.5rem 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 1rem;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: .03em;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #93c5fd 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .75rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* STEPS BAR */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
  flex-wrap: wrap;
  row-gap: 1rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  position: relative;
}

.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: var(--transition);
}

.step span {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: var(--transition);
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 18px var(--primary-glow);
}

.step.active span { color: var(--text); }

.step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step.done span { color: var(--success); }

.step-line {
  width: 60px; height: 2px;
  background: var(--border);
  margin: 0 .5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.step-line.active { background: var(--primary); }

/* ════════════════════════════════════════
   STUDIO (PANELS)
════════════════════════════════════════ */
.studio {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.step-panel { display: none; }
.step-panel.active { display: block; animation: panelIn .4s cubic-bezier(.4,0,.2,1); }

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

.hidden { display: none !important; }

/* ── PANEL CARD ── */
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) { .panel-card { padding: 1.25rem; } }

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.panel-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  opacity: .4;
  min-width: 64px;
}

.panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.panel-header p { color: var(--text-muted); font-size: .9rem; }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.3);
}
.btn-secondary:hover { transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text); border-color: var(--border2); background: var(--card2); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--card2); }

.btn-icon { width: 18px; height: 18px; object-fit: contain; }

.arrow { transition: transform var(--transition); }
.btn:hover .arrow { transform: translateX(4px); }

/* ════════════════════════════════════════
   STEP 1 — UPLOAD
════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed rgba(59,130,246,0.4);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(59,130,246,0.04);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(59,130,246,0.08);
  box-shadow: var(--shadow-glow);
}

.upload-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  position: relative;
}

.upload-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(40%) sepia(80%) saturate(400%) hue-rotate(190deg);
}

.upload-svg-fallback {
  font-size: 3rem;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}

.upload-zone h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .35rem; }
.upload-zone p { color: var(--text-muted); font-size: .875rem; margin-bottom: 1rem; }
.upload-hint { font-size: .75rem !important; color: var(--text-dim) !important; margin-top: .75rem !important; }

.preview-box { margin-top: 1.5rem; }

.preview-img-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.preview-img-wrap img {
  max-height: 400px;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: contain;
  box-shadow: var(--shadow);
}

.preview-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════
   GENDER SELECTOR CARDS
════════════════════════════════════════ */
.gender-selector-wrap {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 20px 0 24px;
}

.gender-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 150px;
  padding: 18px 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  outline: none;
}

/* shimmer sweep on hover */
.gender-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.gender-card:hover::before { transform: translateX(100%); }

.gender-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}

/* ── Active states with gender-specific colors ── */
#genderMale.active {
  background: rgba(99,102,241,0.15);
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 0 22px rgba(99,102,241,0.3), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

#genderFemale.active {
  background: rgba(244,63,94,0.15);
  border-color: #f43f5e;
  color: #fff;
  box-shadow: 0 0 22px rgba(244,63,94,0.3), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

/* SVG icon wrapper */
.gender-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: grid;
  place-items: center;
  transition: all 0.3s;
  padding: 10px;
}

.gender-card-icon svg {
  width: 100%;
  height: 100%;
}

#genderMale .gender-card-icon   { color: #818cf8; }
#genderFemale .gender-card-icon { color: #fb7185; }

#genderMale.active .gender-card-icon {
  background: rgba(99,102,241,0.2);
  box-shadow: 0 0 14px rgba(99,102,241,0.35);
}
#genderFemale.active .gender-card-icon {
  background: rgba(244,63,94,0.2);
  box-shadow: 0 0 14px rgba(244,63,94,0.35);
}

/* Label text */
.gender-card-label {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
}

/* Check badge (top-right corner) */
.gender-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(.175,.885,.32,1.275);
}

#genderMale.active   .gender-card-check { opacity: 1; transform: scale(1); background: #6366f1; }
#genderFemale.active .gender-card-check { opacity: 1; transform: scale(1); background: #f43f5e; }

/* ════════════════════════════════════════
   UPLOAD + CAMERA ROW
════════════════════════════════════════ */
.upload-camera-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}

@media (max-width: 700px) {
  .upload-camera-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .upload-or-divider {
    flex-direction: row !important;
    padding: .75rem 0 !important;
  }
  .upload-or-divider .or-line {
    width: auto !important;
    height: 2px !important;
    flex: 1;
  }
}

/* Vertical OR divider */
.upload-or-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 0 1.5rem;
  color: var(--text-dim);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.upload-or-divider .or-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  border-radius: 1px;
  max-height: 80px;
}

/* ── CAMERA SECTION ── */
.camera-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(99,102,241,0.35);
  border-radius: var(--radius);
  background: rgba(99,102,241,0.04);
  transition: var(--transition);
  min-height: 260px;
  padding: 1.5rem;
  gap: 1rem;
}

.camera-section:hover {
  border-color: var(--secondary);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 30px rgba(99,102,241,0.1);
}

/* Idle state */
.camera-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.camera-idle-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  display: grid; place-items: center;
  color: var(--secondary);
}

.camera-idle p {
  color: var(--text-muted);
  font-size: .875rem;
}

.camera-open-btn {
  font-size: .8rem !important;
  padding: .5rem 1.1rem !important;
  border-color: rgba(99,102,241,0.35) !important;
  color: var(--secondary) !important;
  gap: .4rem;
}
.camera-open-btn:hover {
  background: rgba(99,102,241,0.12) !important;
  border-color: var(--secondary) !important;
  color: #fff !important;
}

/* Live & Confirm frames */
.camera-live,
.camera-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  width: 100%;
}

/* 3×4 portrait frame */
.cam-frame {
  position: relative;
  width: 100%;
  max-width: 210px;   /* ~3cm ratio reference */
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(99,102,241,0.4);
  background: #000;
  box-shadow: 0 0 24px rgba(99,102,241,0.2);
}

.cam-frame video,
.cam-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Face guide overlay */
.cam-overlay-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-face-guide {
  width: 52%;
  aspect-ratio: 3/4;
  margin-top: -10%;
  border: 2px dashed rgba(255,255,255,0.35);
  border-radius: 50% 50% 42% 42% / 60% 60% 40% 40%;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.22);
}

/* Action buttons row */
.cam-live-actions,
.cam-confirm-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
}

/* Small cam button base */
.cam-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .85rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

/* Capture (main CTA) */
.cam-btn-capture {
  background: linear-gradient(135deg, var(--secondary), #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(99,102,241,0.35);
  padding: .45rem 1.1rem;
  font-size: .82rem;
}
.cam-btn-capture:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(99,102,241,0.45); }

/* Close X button */
.cam-btn-close {
  width: 30px; height: 30px;
  padding: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  justify-content: center;
}
.cam-btn-close:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); color: #f87171; }

/* Retake */
.cam-btn-retake {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border-color: var(--border);
}
.cam-btn-retake:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: rgba(255,255,255,0.2); }

/* Confirm / Tayyor */
.cam-btn-confirm {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(34,197,94,0.3);
}
.cam-btn-confirm:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,197,94,0.4); }

/* ════════════════════════════════════════
   STEP 2 — REMOVE BG
════════════════════════════════════════ */
.compare-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.compare-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--card2);
  padding: .25rem .75rem;
  border-radius: 999px;
}

.compare-item img {
  width: 240px;
  height: 320px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #1a2340;
}

.result-placeholder {
  width: 240px;
  height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.checkerboard {
  position: absolute;
  inset: 0;
  background-image: repeating-conic-gradient(#1f2a40 0% 25%, #162035 0% 50%);
  background-size: 20px 20px;
}

.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,15,30,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

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

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

.processing-overlay p { color: var(--text-muted); font-size: .9rem; }

.compare-arrow {
  font-size: 2rem;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* BG Options */
.bg-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--card2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.bg-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.color-swatches { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}

.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

#customColor {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  padding: 2px;
  background: none;
  cursor: pointer;
}

.step-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ════════════════════════════════════════
   STEP 3 — CLOTHES
════════════════════════════════════════ */
.clothes-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .clothes-layout { grid-template-columns: 1fr; }
}

/* Photo frame */
.photo-frame {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.frame-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

#photoCanvas {
  border-radius: var(--radius-sm);
  max-width: 100%;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Hint strip shown above canvas when cloth is active */
.canvas-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  margin-bottom: .5rem;
}

/* Controls */
.photo-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 80px;
}

.ctrl-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.move-btns { display: flex; gap: .35rem; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: grid; place-items: center;
  color: var(--text);
  font-size: 1rem;
}

.icon-btn img { width: 22px; height: 22px; object-fit: contain; filter: invert(1); }
.icon-btn:hover { background: var(--primary); border-color: var(--primary); box-shadow: 0 2px 8px var(--primary-glow); }

/* Clothes sidebar */
.clothes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.clothes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  max-height: 420px;
  overflow-y: auto;
  padding: .25rem;
}

.clothes-item {
  background: var(--card2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  aspect-ratio: 3/4;
}

.clothes-item img {
  width: 100%;
  flex: 1;
  object-fit: contain;
  border-radius: 4px;
}

.clothes-item span {
  font-size: .65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.clothes-item:hover { border-color: var(--primary); background: rgba(59,130,246,0.1); }
.clothes-item.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }

.clothes-loading { text-align: center; color: var(--text-muted); grid-column: 1/-1; padding: 2rem; }

.gender-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.gender-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.gender-btn img { width: 18px; height: 18px; object-fit: contain; filter: invert(.6); }
.gender-btn:hover, .gender-btn.active { border-color: var(--primary); color: var(--text); background: rgba(59,130,246,0.1); }

.no-clothes-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
}

/* ════════════════════════════════════════
   STEP 4 — FINAL
════════════════════════════════════════ */
.final-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 768px) { .final-layout { grid-template-columns: 1fr; } }

.final-single, .final-sheet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.final-single h3, .final-sheet h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.final-photo-wrap {
  display: flex;
  justify-content: center;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

#finalCanvas {
  border-radius: var(--radius-sm);
  max-width: 240px;
  box-shadow: var(--shadow);
}

.sheet-options { display: flex; gap: .5rem; }

.sheet-btn {
  flex: 1;
  padding: .5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sheet-btn.active { border-color: var(--primary); color: var(--text); background: rgba(59,130,246,0.1); }
.sheet-btn:hover { border-color: var(--primary); color: var(--text); }

.sheet-preview-wrap {
  display: flex;
  justify-content: center;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

#sheetCanvas {
  border-radius: 4px;
  max-width: 100%;
  box-shadow: var(--shadow);
}

/* ════════════════════════════════════════
   HOW IT WORKS
════════════════════════════════════════ */
.how-section, .features-section {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
}

.how-section { background: rgba(255,255,255,0.015); border-top: 1px solid var(--border); }
.features-section { border-top: 1px solid var(--border); }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.how-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  transition: var(--transition);
}

.how-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.how-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
}

.how-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.how-card p { color: var(--text-muted); font-size: .875rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}

.feature-item:hover { border-color: var(--border2); }

.feature-emoji { font-size: 1.75rem; flex-shrink: 0; }

.feature-item strong { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.feature-item p { color: var(--text-muted); font-size: .8rem; margin: 0; }

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .8rem;
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: .75rem 1.5rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all .3s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: rgba(34,197,94,.4); }
.toast.error { border-color: rgba(239,68,68,.4); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem; gap: 1rem; }
  .header-nav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .hero-title { font-size: 2.2rem; }
  .steps-bar { row-gap: 0.5rem; justify-content: space-around; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem; }
  .step-line { width: 16px; margin: 0 0.25rem; flex-shrink: 0; }
  .step span { font-size: 0.65rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .panel-card { padding: 1.5rem 1rem; }
  .panel-header { flex-direction: column; gap: 0.75rem; text-align: center; align-items: center; }
  .panel-num { font-size: 2.5rem; }
  .clothes-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .final-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .upload-zone { padding: 2rem 1rem; }
  .compare-wrap { flex-direction: column; gap: 1rem; }
  .compare-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
  .compare-item img, .result-placeholder { width: 200px; height: 266px; }
  .step-actions { flex-direction: column; width: 100%; align-items: stretch; gap: 0.75rem; }
  .step-actions .btn { width: 100%; justify-content: center; }
  .photo-controls { padding: 0.75rem; gap: 0.75rem; }
  .bg-options { justify-content: center; padding: 1rem; }
  .color-swatches { justify-content: center; }
  .sheet-options { flex-direction: column; }
  .how-grid, .features-grid { grid-template-columns: 1fr; }
}

