:root {
  --purple: #5a2a82;
  --purple-dark: #3d1a5c;
  --gold: #c39a3c;
  --red: #9e1b1f;
  --ink: #1f1a24;
  --muted: #6b6475;
  --line: #e4dfea;
  --bg: #f7f4fa;
  --card: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.hero {
  text-align: center;
  padding: 40px 16px 90px;
  background:
    linear-gradient(135deg, rgba(158, 27, 31, .06), transparent 40%),
    linear-gradient(315deg, rgba(195, 154, 60, .12), transparent 45%),
    #fff;
  border-bottom: 4px solid var(--gold);
}
.logo { width: 170px; max-width: 60%; }
.eyebrow {
  margin: 14px 0 6px;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.25rem;
}
.hero h1 {
  margin: 0 auto;
  max-width: 760px;
  color: var(--purple);
  font-size: clamp(1.25rem, 3.4vw, 2rem);
  line-height: 1.3;
}
.sub { color: var(--muted); margin: 12px 0 0; }

.container { max-width: 820px; margin: -60px auto 40px; padding: 0 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(61, 26, 92, .1);
  padding: 28px;
}

.steps { display: flex; gap: 8px; margin-bottom: 8px; }
.step {
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
}
.step.active { background: var(--purple); color: #fff; }
.step.done { background: #e9f6ee; color: #1e7a45; }

h2 { color: var(--purple-dark); font-size: 1.1rem; margin: 24px 0 12px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.full { grid-column: 1 / -1; display: block; margin-top: 14px; }
.grid .full { margin-top: 0; }

label { font-size: .9rem; font-weight: 500; }
label em { font-weight: 400; color: var(--muted); font-style: normal; font-size: .8rem; }

input, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font: inherit;
  font-size: .95rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(90, 42, 130, .15);
}
input.invalid { border-color: var(--red); }
#name { font-size: 1.05rem; font-weight: 500; }

.ratings { display: grid; gap: 10px; }
.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.rating-row.invalid { border-color: var(--red); }
.stars { display: flex; gap: 2px; }
.star {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  color: #d8d2df;
  padding: 2px;
  transition: transform .1s, color .1s;
}
.star:hover { transform: scale(1.15); }
.star.on { color: var(--gold); }
.star:focus-visible { outline: 2px solid var(--purple); border-radius: 4px; }

.recommend { border: 0; padding: 0; margin: 22px 0 0; }
.recommend legend { font-size: .9rem; font-weight: 500; margin-bottom: 8px; }
.recommend.invalid legend { color: var(--red); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 8px 0;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
}
.pill input { width: auto; margin: 0; accent-color: var(--purple); }
.pill:has(input:checked) { border-color: var(--purple); background: rgba(90, 42, 130, .07); }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 13px 22px;
  cursor: pointer;
  border: 2px solid var(--purple);
  transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--purple); color: #fff; }
.btn.primary:hover { background: var(--purple-dark); }
.btn.secondary { background: #fff; color: var(--purple); }
.btn.secondary:hover { background: rgba(90, 42, 130, .06); }
#submit-btn { width: 100%; margin-top: 22px; font-size: 1.05rem; }

.error {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdecec;
  color: var(--red);
  font-size: .9rem;
}

.thanks { font-size: 1.4rem; margin-top: 16px; margin-bottom: 4px; }
.muted { color: var(--muted); margin: 0 0 18px; }
.preview {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}
.preview canvas { display: block; width: 100%; height: auto; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.actions .btn { flex: 1; min-width: 200px; }

footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 16px 32px; }
footer a { color: var(--purple); }

@media (max-width: 600px) {
  .card { padding: 20px 16px; }
  .grid { grid-template-columns: 1fr; }
  .rating-row { flex-direction: column; align-items: flex-start; gap: 4px; }
}
