:root {
  --bg: #ffffff;
  --ink: #1c1a17;
  --ink-dim: #8a847a;
  --gold: #F2811D;
  --gold-light: rgba(242,129,29,.10);
  --line: #ebe7de;
  --radius: 20px;
  --danger: #e74c3c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; }
em { color: var(--gold); font-style: normal; }

.page {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 28px 100px;
}

/* Header */
.header { text-align: center; margin-bottom: 40px; }
.header-label {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.header h1 { font-size: clamp(36px,5vw,56px); line-height: 1.12; margin-bottom: 14px; }
.header-sub { color: var(--ink-dim); font-size: 16px; max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* Progress */
.progress-bar {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .4s ease;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all .2s;
}
.step:hover { border-color: var(--gold); }
.step.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.step.done { background: var(--gold-light); border-color: var(--gold); color: var(--gold); }
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-dim);
}
.step.active .step-num { background: var(--gold); color: #fff; }
.step.done .step-num { background: var(--gold); color: #fff; }

/* Sections */
.form-section {
  display: none;
  animation: fadeUp .35s ease;
}
.form-section.active { display: block; }

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

.form-section h2 { font-size: clamp(28px,4vw,40px); margin-bottom: 8px; }
.section-hint { color: var(--ink-dim); font-size: 15px; margin-bottom: 28px; }

/* Fields */
.field { margin-bottom: 24px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .03em;
  margin-bottom: 8px;
  color: var(--ink);
}
.optional { color: var(--ink-dim); font-weight: 300; }

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field input.error, .field textarea.error, .select-wrap.error select { border-color: var(--danger); }
.field textarea { resize: vertical; min-height: 120px; }

.select-wrap { position: relative; }
.select-wrap select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.select-wrap select:focus { border-color: var(--gold); }
.select-wrap::after {
  content: '›';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--ink-dim);
  font-size: 18px;
  pointer-events: none;
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 500;
}

/* Upload */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-light);
}
.upload-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--gold);
  margin: 0 auto 12px;
}
.upload-zone p { color: var(--ink-dim); font-size: 14px; }

.upload-previews {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.upload-thumb {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb .remove-thumb {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Preset colors */
.preset-colors {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.preset-swatch {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.preset-swatch:hover { transform: scale(1.12); }
.preset-swatch.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(242,129,29,.3);
}

.preset-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
  white-space: nowrap;
  animation: popIn .15s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px) scale(.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.preset-popup button {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.preset-popup button:hover { background: var(--gold-light); color: var(--gold); }
.preset-popup button + button { border-top: 1px solid var(--line); }

/* Color pickers */
.color-section {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.color-pick { flex: 1; min-width: 200px; }
.color-pick label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s;
}
.color-input-wrap:hover { border-color: var(--gold); }
.color-input-wrap input[type="color"] {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
}
.color-hex {
  border: none;
  font-family: 'Jost', monospace;
  font-size: 15px;
  color: var(--ink);
  width: 80px;
  outline: none;
  text-transform: uppercase;
}

.palette-preview {
  display: flex;
  gap: 8px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
}
.palette-strip {
  flex: 1;
  border-radius: 8px;
  transition: background .3s;
}

/* Style cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.style-card:hover { border-color: var(--gold); }
.style-card.selected { border-color: var(--gold); background: var(--gold-light); }

.card-demo { font-size: 32px; color: var(--ink); }
.serif-demo { font-family: 'Cormorant Garamond', Georgia, serif; }
.sans-demo { font-family: 'Jost', Arial, sans-serif; }
.script-demo { font-family: 'Brush Script MT', 'Segoe Script', cursive; font-size: 36px; }
.display-demo { font-family: Impact, 'Arial Black', sans-serif; font-size: 30px; letter-spacing: .08em; }

.card-icon { font-size: 32px; }
.card-label { font-size: 12px; color: var(--ink-dim); letter-spacing: .05em; }


/* Summary box */
.summary-box {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #faf9f6;
}
.summary-box h3 { font-size: 18px; margin-bottom: 16px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-key { color: var(--ink-dim); }
.summary-val { color: var(--ink); font-weight: 500; text-align: right; max-width: 60%; }
.summary-colors { display: flex; gap: 6px; }
.summary-swatch {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* Navigation */
.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  gap: 12px;
}
.btn-back, .btn-next, .btn-submit {
  padding: 14px 32px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
  border: none;
}
.btn-back {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}
.btn-back:hover { border-color: var(--gold); color: var(--ink); }
.btn-next {
  background: var(--ink);
  color: #fff;
  margin-left: auto;
}
.btn-next:hover { background: var(--gold); }
.btn-submit {
  background: var(--gold);
  color: #fff;
  margin-left: auto;
  font-weight: 600;
}
.btn-submit:hover { background: #d9710f; }
.btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 14px 28px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background: var(--ink);
  opacity: 0;
  transition: all .35s ease;
  z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #27ae60; }
.toast.error { background: var(--danger); }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .page { padding: 28px 18px 90px; }
  .header h1 { font-size: 32px; }
  .steps { gap: 4px; }
  .step { padding: 6px 10px; font-size: 12px; }
  .step-label { display: none; }
  .step-num { width: 28px; height: 28px; font-size: 13px; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }

  .color-section { flex-direction: column; gap: 16px; }

  .form-section h2 { font-size: 26px; }
}
