:root {
  --cream: #fff8ec;
  --cream-2: #fffdf8;
  --tan: #e7c8a8;
  --tan-deep: #c99670;
  --blush: #f4a4b8;
  --blush-deep: #d86f89;
  --sky: #a8d8e8;
  --sky-soft: #dff3f7;
  --cocoa: #4a2d24;
  --cocoa-soft: #76564a;
  --green: #7ca982;
  --red: #c46a5d;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(74, 45, 36, 0.16);
  --focus: 0 0 0 4px rgba(168, 216, 232, 0.72);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
  color: var(--cocoa);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(244, 164, 184, 0.28), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(168, 216, 232, 0.42), transparent 24%),
    linear-gradient(135deg, #fff8ec 0%, #fff1df 45%, #eaf8fb 100%);
  color: var(--cocoa);
}

button,
input,
a {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

.page-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 10px 10px, rgba(74, 45, 36, 0.16) 0 4px, transparent 5px),
    radial-gradient(circle at 27px 4px, rgba(74, 45, 36, 0.12) 0 3px, transparent 4px),
    radial-gradient(circle at 37px 14px, rgba(74, 45, 36, 0.12) 0 3px, transparent 4px);
  background-size: 92px 92px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

.app-shell {
  width: min(1080px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.quiz-frame,
.confirmation {
  width: 100%;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(201, 150, 112, 0.32);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  position: relative;
}

.quiz-frame::before,
.confirmation::before {
  content: "";
  position: absolute;
  top: -48px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(168, 216, 232, 0.28);
}

.step-enter {
  animation: fadeUp 280ms ease-out;
}

.progress-wrap {
  margin-bottom: 26px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--cocoa-soft);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.progress-track {
  height: 12px;
  margin-top: 9px;
  background: #f3dfc9;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blush), var(--sky));
  transition: width 220ms ease;
}

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blush-deep);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  max-width: 760px;
  color: var(--cocoa);
  font-size: clamp(2.15rem, 6vw, 4.65rem);
  line-height: 0.97;
  letter-spacing: 0;
}

.step-header h1,
.confirmation h1 {
  font-size: clamp(2rem, 4.8vw, 3.45rem);
}

.lead,
.step-help {
  margin: 18px 0 0;
  color: var(--cocoa-soft);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.62;
}

.knot-scene {
  min-height: 390px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(168, 216, 232, 0.52), rgba(255, 248, 236, 0.72)),
    repeating-linear-gradient(-24deg, rgba(255, 255, 255, 0.32) 0 8px, transparent 8px 20px);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 150, 112, 0.32);
}

.knot-scene::after {
  content: "";
  position: absolute;
  left: -20px;
  right: -20px;
  bottom: -22px;
  height: 96px;
  background: #9fcf91;
  border-radius: 50% 50% 0 0;
}

.sun {
  position: absolute;
  width: 72px;
  height: 72px;
  right: 32px;
  top: 34px;
  background: #ffd978;
  border-radius: 50%;
  box-shadow: 0 0 0 16px rgba(255, 217, 120, 0.24);
}

.knot-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 230px;
  height: 210px;
  transform: translate(-50%, -48%);
  z-index: 2;
}

.leash-loop {
  position: absolute;
  top: 34px;
  width: 112px;
  height: 122px;
  border: 17px solid var(--cocoa);
  border-radius: 64px 64px 58px 58px;
  background: rgba(255, 253, 248, 0.42);
  box-shadow: inset 0 0 0 8px rgba(244, 164, 184, 0.28);
}

.loop-left {
  left: 18px;
  transform: rotate(-38deg);
}

.loop-right {
  right: 18px;
  transform: rotate(38deg);
}

.knot-center {
  position: absolute;
  left: 50%;
  top: 96px;
  width: 72px;
  height: 58px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, var(--blush-deep), #e99074);
  border: 8px solid var(--cocoa);
  border-radius: 24px 18px 24px 18px;
  box-shadow: 0 16px 26px rgba(74, 45, 36, 0.14);
}

.leash-tail {
  position: absolute;
  bottom: 12px;
  width: 106px;
  height: 20px;
  background: var(--cocoa);
  border-radius: 999px;
}

.tail-left {
  left: 24px;
  transform: rotate(28deg);
}

.tail-right {
  right: 24px;
  transform: rotate(-28deg);
}

.paw-accent {
  position: absolute;
  width: 60px;
  height: 54px;
  right: 3px;
  bottom: 4px;
  transform: rotate(10deg);
}

.paw-accent span,
.paw-accent strong {
  position: absolute;
  display: block;
  background: #fff8ec;
  border-radius: 50%;
  border: 4px solid var(--cocoa);
}

.paw-accent span {
  width: 16px;
  height: 18px;
  top: 4px;
}

.paw-accent span:nth-child(1) {
  left: 5px;
  transform: rotate(-18deg);
}

.paw-accent span:nth-child(2) {
  left: 22px;
  top: 0;
}

.paw-accent span:nth-child(3) {
  right: 5px;
  transform: rotate(18deg);
}

.paw-accent strong {
  width: 34px;
  height: 28px;
  left: 13px;
  bottom: 2px;
}

.collar-card {
  position: absolute;
  left: 36px;
  bottom: 56px;
  width: 118px;
  height: 54px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(201, 150, 112, 0.42);
  z-index: 3;
  transform: rotate(-10deg);
}

.collar-band {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 22px;
  height: 12px;
  background: var(--sky);
  border-radius: 999px;
  border: 3px solid var(--cocoa);
}

.collar-ring {
  position: absolute;
  right: 22px;
  top: 15px;
  width: 24px;
  height: 24px;
  border: 5px solid #ffd978;
  border-radius: 50%;
  z-index: 2;
}

.big-btn {
  margin-top: 28px;
}

.quiz-form {
  margin-top: 28px;
}

.question-group {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
}

.question-group legend,
.text-field span {
  display: block;
  margin-bottom: 10px;
  color: var(--cocoa);
  font-weight: 900;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-pill {
  position: relative;
  display: block;
  min-height: 52px;
  cursor: pointer;
}

.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-pill span {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  border: 1px solid rgba(118, 86, 74, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--cocoa);
  font-weight: 800;
  line-height: 1.22;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice-pill:hover span {
  transform: translateY(-1px);
  border-color: var(--tan-deep);
  box-shadow: 0 10px 22px rgba(74, 45, 36, 0.08);
}

.choice-pill input:focus-visible + span,
.text-field input:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.choice-pill input:checked + span {
  border-color: var(--blush-deep);
  background: linear-gradient(135deg, rgba(244, 164, 184, 0.24), rgba(168, 216, 232, 0.24));
}

.text-field {
  display: block;
  margin-bottom: 20px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.text-field input {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(118, 86, 74, 0.26);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--cocoa);
  font-weight: 700;
}

.text-field input::placeholder {
  color: rgba(118, 86, 74, 0.56);
}

.nav-row,
.confirm-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--blush-deep), #e99074);
  color: #fffdf8;
  box-shadow: 0 14px 28px rgba(216, 111, 137, 0.28);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.78);
  color: var(--cocoa);
  border: 1px solid rgba(118, 86, 74, 0.22);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.submit-btn {
  flex: 1 1 290px;
}

.feedback {
  min-height: 28px;
  margin-top: 4px;
  color: var(--red);
  font-weight: 850;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.review-block {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(201, 150, 112, 0.28);
  border-radius: 20px;
  padding: 18px;
}

.review-block h2 {
  margin: 0 0 14px;
  color: var(--cocoa);
  font-size: 1rem;
}

.review-block dl,
.review-block div {
  margin: 0;
}

.review-block div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(201, 150, 112, 0.24);
}

.review-block div:first-child {
  border-top: 0;
  padding-top: 0;
}

.review-block dt {
  color: var(--cocoa-soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.review-block dd {
  margin: 0;
  color: var(--cocoa);
  font-weight: 850;
  line-height: 1.3;
}

.confirmation {
  text-align: center;
  max-width: 820px;
}

.celebration {
  min-height: 250px;
  display: grid;
  place-items: center;
  position: relative;
}

.knot-heart-wrap {
  position: relative;
  width: 210px;
  height: 196px;
  animation: knotPulse 3s ease-in-out infinite;
}

.knot-heart {
  position: absolute;
  left: 44px;
  top: 48px;
  width: 124px;
  height: 124px;
  transform: rotate(-45deg);
  background: rgba(244, 164, 184, 0.5);
  box-shadow: 0 20px 60px rgba(216, 111, 137, 0.25);
}

.knot-heart::before,
.knot-heart::after {
  content: "";
  position: absolute;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(244, 164, 184, 0.5);
}

.knot-heart::before {
  top: -62px;
  left: 0;
}

.knot-heart::after {
  left: 62px;
  top: 0;
}

.knot-heart-line {
  position: absolute;
  left: 51px;
  top: 87px;
  width: 112px;
  height: 28px;
  background: rgba(74, 45, 36, 0.82);
  border-radius: 999px;
}

.line-a {
  transform: rotate(34deg);
}

.line-b {
  transform: rotate(-34deg);
}

.knot-heart-center {
  position: absolute;
  left: 78px;
  top: 76px;
  width: 56px;
  height: 48px;
  background: linear-gradient(135deg, var(--sky), #ffffff);
  border: 7px solid var(--cocoa);
  border-radius: 18px 14px 18px 14px;
  transform: rotate(45deg);
}

.paw-confirm {
  right: 68px;
  bottom: 38px;
  transform: rotate(8deg) scale(0.8);
}

.sparkle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--sky);
  transform: rotate(45deg);
  opacity: 0.8;
  animation: sparkle 2.6s ease-in-out infinite;
}

.sparkle-one {
  left: 17%;
  top: 36%;
}

.sparkle-two {
  right: 20%;
  top: 24%;
  animation-delay: 400ms;
  background: #ffd978;
}

.sparkle-three {
  right: 26%;
  bottom: 23%;
  animation-delay: 800ms;
  background: var(--blush);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes knotPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.03);
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: rotate(45deg) scale(0.82);
    opacity: 0.55;
  }
  50% {
    transform: rotate(45deg) scale(1.18);
    opacity: 1;
  }
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 12px 0;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
  }

  .knot-scene {
    min-height: 300px;
    order: -1;
  }

  .knot-logo {
    transform: translate(-50%, -48%) scale(0.88);
  }

  .review-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .quiz-frame,
  .confirmation {
    border-radius: 24px;
    padding: 20px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .nav-row,
  .confirm-actions {
    display: grid;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .knot-scene {
    min-height: 250px;
  }

  .knot-logo {
    transform: translate(-50%, -48%) scale(0.72);
  }

  .collar-card {
    left: 20px;
    bottom: 38px;
    transform: rotate(-10deg) scale(0.86);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
