:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --surface-soft: #f6f0e7;
  --ink: #213244;
  --muted: #647180;
  --line: #deceb8;
  --brand: #1f3a50;
  --brand-strong: #162b3b;
  --accent: #c19a43;
  --accent-soft: #efe0b8;
  --liked: #c34d5d;
  --liked-positive: #2f8b57;
  --kenza-melon: #d97f74;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 24px 60px rgba(22, 43, 59, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(193, 154, 67, 0.16), transparent 22%),
    linear-gradient(180deg, #faf6ef 0%, var(--bg) 100%);
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 24px;
}

.hero {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 0.8fr;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow,
.card-kicker,
.step-kicker,
.selection-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

h1,
h2,
h3,
h4,
p,
ol {
  margin: 0;
}

h1 {
  margin-top: 10px;
  font-size: 52px;
  line-height: 0.98;
  font-weight: 600;
  max-width: 10ch;
}

h2 {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 600;
}

h3 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 600;
}

h4 {
  font-size: 22px;
  line-height: 1.12;
  font-weight: 600;
}

.hero-lead,
.hero-card li,
.step-copy p,
.upload-card p,
.request-card p {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-points {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points span {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.hero-card,
.quiz-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  background: linear-gradient(180deg, #f8f1df 0%, #fffaf1 100%);
}

.hero-steps {
  margin-top: 14px;
  padding-left: 20px;
  display: grid;
  gap: 12px;
}

.quiz-shell {
  padding: 30px;
}

.quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.progress-pill {
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.progress-bar {
  margin-top: 18px;
  height: 8px;
  border-radius: 999px;
  background: #eadfce;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #d5b165 100%);
  transition: width 180ms ease;
}

.step-panel {
  display: none;
  margin-top: 24px;
}

.step-panel.is-visible {
  display: block;
}

.field-grid {
  margin-top: 22px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 154, 67, 0.14);
}

.field-budget {
  max-width: 420px;
  margin-top: 22px;
}

.upload-card,
.request-card {
  margin-top: 22px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(193, 154, 67, 0.6);
  background: linear-gradient(180deg, #fff9ef 0%, #fffdf8 100%);
  text-align: center;
}

.upload-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 32px;
  font-weight: 300;
}

.upload-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-preview {
  margin-top: 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.preview-meta strong {
  font-size: 14px;
}

.selection-layout {
  margin-top: 22px;
  display: grid;
  gap: 24px;
}

.selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-rule {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.image-grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  touch-action: pan-y;
}

.styles-grid,
.colors-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 43, 59, 0.05);
  touch-action: pan-y;
}

.image-card.is-liked {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 58, 80, 0.14);
}

.image-card.is-disliked {
  opacity: 0.78;
  border-color: rgba(217, 127, 116, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 127, 116, 0.12);
}

.preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  touch-action: pan-y;
}

.preview-button img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.color-card .preview-button img {
  height: 230px;
}

.preview-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(18, 31, 44, 0.42) 100%);
  pointer-events: none;
}

.preview-button > * {
  position: relative;
  z-index: 1;
}

.image-choice-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.button,
.like-button,
.lightbox-close,
.lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:hover,
.like-button:hover,
.lightbox-close:hover,
.lightbox-nav:hover {
  transform: translateY(-1px);
}

.like-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-width: 110px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(31, 58, 80, 0.9);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.image-card.is-liked .like-button {
  background: var(--liked-positive);
}

.image-card.is-liked .like-button::before {
  content: "♥ ";
}

.image-card.is-disliked .like-button {
  background: var(--kenza-melon);
}

.image-card.is-disliked .like-button::before {
  content: "× ";
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 31, 44, 0.72);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(90vw, 980px);
  max-height: 88vh;
  padding: 18px;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.lightbox-stage {
  overflow: hidden;
  border-radius: 18px;
  touch-action: pan-y;
}

.lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 18px;
}

.lightbox-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lightbox-panel p {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.lightbox-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lightbox-state-button {
  min-width: 128px;
}

.lightbox-state-button.is-active {
  box-shadow: 0 0 0 3px rgba(31, 58, 80, 0.08);
}

#lightbox-like {
  background: transparent;
  color: var(--liked-positive);
  border-color: rgba(47, 139, 87, 0.38);
}

#lightbox-like.is-active {
  background: var(--liked-positive);
  color: #fff;
  border-color: var(--liked-positive);
  box-shadow: 0 0 0 3px rgba(47, 139, 87, 0.14);
}

#lightbox-dislike {
  background: transparent;
  color: var(--kenza-melon);
  border-color: rgba(217, 127, 116, 0.4);
}

#lightbox-dislike.is-active {
  background: var(--kenza-melon);
  color: #fff;
  border-color: var(--kenza-melon);
  box-shadow: 0 0 0 3px rgba(217, 127, 116, 0.14);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(31, 58, 80, 0.9);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(31, 58, 80, 0.9);
  color: #fff;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav-prev {
  left: 18px;
}

.lightbox-nav-next {
  right: 18px;
}

.request-badge {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.step-actions {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.form-error {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 127, 116, 0.55);
  border-radius: var(--radius-md);
  background: rgba(217, 127, 116, 0.1);
  color: #8a3f38;
  font-size: 14px;
  font-weight: 700;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--kenza-melon);
  box-shadow: 0 0 0 3px rgba(217, 127, 116, 0.14);
}

.button {
  padding: 15px 22px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.button-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.button-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.button-secondary,
.button-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-small {
  width: auto;
  padding: 10px 14px;
  font-size: 12px;
}

.button-ghost:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .styles-grid,
  .colors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    margin: 16px auto 24px;
  }

  .hero,
  .quiz-shell {
    padding: 22px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 24px;
  }

  .quiz-head,
  .step-actions,
  .selection-head,
  .preview-meta,
  .lightbox-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-grid,
  .styles-grid,
  .colors-grid {
    grid-template-columns: 1fr;
  }

  .preview-button img,
  .color-card .preview-button img {
    height: 240px;
  }

  .button {
    width: 100%;
  }

  .like-button,
  .lightbox-close,
  .lightbox-nav {
    width: auto;
  }

  .lightbox-actions {
    width: 100%;
  }

  .lightbox-state-button {
    flex: 1 1 0;
    min-width: 0;
  }
}
