:root {
  --navy: #01245e;
  --navy-deep: #011540;
  --navy-light: #123a7e;
  --orange: #F76200;
  --orange-deep: #cc5100;
  --orange-light: #ff8a3d;
  --white: #ffffff;
  --ink: #01245e;
  --muted: #5c6a9e;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(155deg, var(--navy-light) 0%, var(--navy) 55%, var(--navy-deep) 100%);
  color: var(--white);
  min-height: 100vh;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.topbar {
  text-align: center;
  margin-bottom: 22px;
}

.brand-logo {
  display: block;
  width: min(40vw, 160px);
  height: auto;
  margin: 0 auto;
}

.brand-tag {
  margin: 6px 0 0;
  font-size: 14px;
  color: #cfdcff;
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 26px;
  max-width: 480px;
}

.step {
  flex: 1;
  background: none;
  border: none;
  color: #a9bdf5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  cursor: pointer;
  font-family: inherit;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #4569d6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.step.active .step-circle {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.step.active .step-label { color: var(--white); }

.step.done .step-circle {
  background: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.9);
  color: var(--navy-deep);
}

.step.done .step-label { color: #d9e4ff; }

.step:disabled { cursor: not-allowed; opacity: 0.6; }

/* ---------- Layout ---------- */
.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  flex: 1;
}

@media (max-width: 760px) {
  .content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------- Preview ---------- */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.frame-stage {
  position: relative;
  width: min(80vw, 380px);
  aspect-ratio: 1 / 1;
}

.photo-clip {
  position: absolute;
  left: 50.4%;
  top: 50.5%;
  width: 85.6%;
  height: 85.6%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  background: #e7ecfb;
  cursor: pointer;
  touch-action: none;
}

.photo-clip.has-photo {
  cursor: grab;
}

.photo-clip.dragging {
  cursor: grabbing;
}

#userPhoto {
  position: absolute;
  left: 50%;
  top: 50%;
  user-select: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  color: var(--muted);
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.empty-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.empty-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 140px;
}

.frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.stage-hint {
  margin: 0;
  font-size: 13px;
  color: #cfdcff;
  text-align: center;
  max-width: 320px;
}

/* ---------- Step panel ---------- */
.step-panel {
  max-width: 460px;
}

.pill {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.step-content h1 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 800;
}

.hl {
  color: var(--orange-light);
}

.desc {
  font-size: 15px;
  line-height: 1.55;
  color: #dbe4ff;
  margin: 0 0 22px;
}

/* ---------- Frame options ---------- */
.frame-options {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.frame-option {
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 130px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}

.frame-option img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
}

.frame-option span {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

.frame-option:hover {
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}

.frame-option.selected {
  border-color: var(--orange);
  background: rgba(247,98,0,0.15);
}

/* ---------- Zoom control ---------- */
.zoom-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  padding: 10px 16px;
}

.zoom-icon {
  font-size: 18px;
  font-weight: 700;
  color: var(--orange-light);
  width: 16px;
  text-align: center;
}

#zoomSlider {
  flex: 1;
  accent-color: var(--orange);
  height: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  border: none;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(247,98,0,0.35);
}

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

.btn-download {
  background: linear-gradient(120deg, var(--orange-light), var(--orange-deep));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(247,98,0,0.35);
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-wide {
  width: 100%;
  margin-bottom: 8px;
}

.nav-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.page-footer {
  text-align: center;
  margin-top: 34px;
}

.page-footer p {
  font-size: 12px;
  color: #9fb1ea;
  margin: 0;
}
