:root {
  --purple: #6b2383;
  --purple-dark: #511865;
  --green: #79a923;
  --green-dark: #638c1b;
  --ink: #33343a;
  --muted: #686873;
  --border: #ded9e2;
  --wash: #f5eef8;
  --white: #ffffff;
  --shadow: 0 28px 70px rgba(55, 40, 61, 0.13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(223, 193, 231, .48), transparent 30%),
    radial-gradient(circle at 94% 92%, rgba(209, 224, 165, .48), transparent 26%),
    #f8f5f1;
}

button, textarea, input { font: inherit; }
button { cursor: pointer; }

#app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 5vh 6vw 9vh;
}

.shell {
  width: min(1180px, 100%);
  min-height: 690px;
  position: relative;
}

.card {
  min-height: 690px;
  background: rgba(255,255,255,.97);
  border-radius: 64px 0 64px 0;
  box-shadow: var(--shadow);
  padding: 46px 64px 50px;
  position: relative;
  overflow: hidden;
}

.logo {
  display: block;
  width: 96px;
  height: 62px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 16px;
}

h1 {
  color: var(--purple);
  font-family: "Oswald", Impact, sans-serif;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.08;
  font-weight: 600;
  margin: 0;
  max-width: 640px;
}

.question h1 { font-size: clamp(36px, 4vw, 58px); max-width: 820px; }
.results h1 { font-size: clamp(44px, 4.5vw, 66px); max-width: 880px; }
.handoff h1 { font-size: clamp(48px, 5vw, 68px); max-width: 700px; }

.intro-copy, .help {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  max-width: 620px;
  margin: 22px 0 26px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 38px;
  min-height: 480px;
}

.shield-art {
  width: min(420px, 100%);
  aspect-ratio: 1;
  margin: auto;
  display: grid;
  place-items: center;
  position: relative;
}

.shield-art::before {
  content: "";
  position: absolute;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: #f1e6f5;
}

.shield-art::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(93, 68, 103, .25);
  border-radius: 48% 52% 44% 56%;
  transform: rotate(23deg);
}
.shield-art::after { transform: rotate(-14deg); inset: 16% 2%; }

.shield-panel {
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.34);
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 34px rgba(75,35,89,.10);
}

.shield-icon { overflow: visible; }
.hero-shield { width: 76%; height: 82%; filter: drop-shadow(0 10px 12px rgba(75,35,89,.10)); }
.shield-outline {
  fill: rgba(255,255,255,.18);
  stroke: var(--purple);
  stroke-width: 17;
  stroke-linejoin: round;
}
.shield-check {
  fill: none;
  stroke: var(--green);
  stroke-width: 20;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.sparkle {
  position: absolute;
  z-index: 2;
  font-size: 27px;
  line-height: 1;
}
.sparkle-green { color: var(--green); left: 4%; top: 24%; }
.sparkle-purple { color: var(--purple); right: 2%; bottom: 20%; font-size: 22px; }

.primary {
  border: 0;
  border-radius: 999px;
  padding: 18px 30px;
  background: var(--green);
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 9px 20px rgba(103, 144, 28, .18);
  transition: .18s ease;
}
.primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.primary .arrow { margin-left: 16px; }

.secondary {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 700;
  padding: 16px 6px;
}

.assurance {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 22px;
}
.mini-shield { width: 24px; height: 26px; flex: 0 0 auto; }
.mini-shield .shield-outline { stroke-width: 18; }
.mini-shield .shield-check { stroke-width: 22; }

.handoff-shield {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1e6f5;
  margin: 0 auto 20px;
}
.status-shield { width: 48px; height: 52px; }
.handoff { text-align: center; }
.handoff h1, .handoff .help { margin-left: auto; margin-right: auto; }
.handoff .help { max-width: 650px; font-size: 20px; line-height: 1.45; margin-top: 26px; }

.privacy {
  text-align: center;
  color: #7b7880;
  font-size: 12px;
  margin: 42px 0 0;
}

.progress-wrap { margin-bottom: 25px; }
.results .progress-wrap,
.handoff .progress-wrap,
.loading-screen .progress-wrap {
  position: absolute;
  top: 62px;
  right: 64px;
  width: 220px;
  text-align: right;
}
.step-label { font-size: 13px; font-weight: 700; color: var(--purple); margin-bottom: 8px; }
.progress { height: 5px; border-radius: 4px; background: #ece7ee; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--green); transition: width .25s ease; }

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  max-width: 930px;
  margin: 24px 0 28px;
}

.option {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  transition: .15s ease;
}
.option:hover { border-color: #bfa8c7; }
.option.selected { border-color: var(--purple); background: var(--wash); color: var(--purple); }
.check { width: 24px; height: 24px; border: 1px solid #c8c1cb; border-radius: 50%; display: grid; place-items: center; color: transparent; flex: 0 0 auto; }
.selected .check { background: var(--purple); border-color: var(--purple); color: white; }

.custom-input, .note {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 16px;
  color: var(--ink);
  outline: none;
}
.custom-input:focus, .note:focus, .review-text:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(107,35,131,.09); }
.custom-row { grid-column: 1 / -1; }
.note { min-height: 135px; resize: vertical; margin-top: 8px; }
.counter { text-align: right; color: var(--muted); font-size: 12px; margin-top: 6px; }

.actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; }
.actions.right { justify-content: flex-end; }

.results .help { margin: 18px 0 22px; }
.review-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 0 22px; }
.review-option { border: 2px solid #9eba70; border-radius: 18px; padding: 18px; transition: .15s ease; cursor: pointer; min-width: 0; }
.review-option.selected { border: 3px solid var(--green); padding: 17px; background: #fff; box-shadow: 0 14px 30px rgba(103,144,28,.14); }
.review-top { min-height: 34px; display: flex; justify-content: space-between; align-items: center; color: var(--purple); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 10px; }
.selected-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 9px 14px; color: #fff; background: var(--green); font-size: 12px; letter-spacing: .08em; }
.review-text { width: 100%; min-height: 176px; resize: vertical; border: 0; background: #faf8fb; color: #59606b; font-size: 16px; line-height: 1.55; padding: 17px; border-radius: 14px; outline: none; }
.results-actions { margin-top: 16px; }
.results-actions .secondary { text-decoration: underline; text-underline-offset: 4px; font-size: 16px; }
.results-actions .primary { min-width: 390px; }

.status-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.status-note.error { color: #a53333; }

.loader { min-height: 500px; display: grid; place-items: center; text-align: center; }
.loader > div { width: min(610px, 100%); }
.loader h1 { max-width: 620px; margin: 0 auto; font-size: clamp(48px, 5vw, 68px); }
.loader .help { margin: 22px auto 26px; font-size: 18px; }
.writing-icon { width: 76px; height: 76px; border-radius: 50%; background: #f1e6f5; color: var(--purple); display: grid; place-items: center; margin: 0 auto 22px; position: relative; }
.writing-icon span { color: var(--green); position: absolute; right: -3px; top: 3px; font-size: 25px; }
.pencil-icon { width: 38px; height: 38px; }
.writing-preview { border: 1px solid #dacfe0; border-radius: 18px; padding: 25px 28px; display: grid; gap: 13px; background: #fdfbfe; }
.writing-preview i { height: 11px; display: block; border-radius: 99px; background: linear-gradient(90deg, #9db975, var(--green), #e2dce5); background-size: 200% 100%; animation: write 1.6s ease-in-out infinite; }
.writing-preview i:nth-child(2) { width: 85%; animation-delay: .15s; }
.writing-preview i:nth-child(3) { width: 63%; animation-delay: .3s; }
.loading-dots { display: flex; justify-content: center; gap: 8px; margin-top: 19px; }
.loading-dots i { width: 9px; height: 9px; border-radius: 50%; background: #c7d6aa; animation: pulse 1.1s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes write { 50% { background-position: 100% 0; opacity: .7; } }
@keyframes pulse { 50% { background: var(--green); transform: translateY(-3px); } }

.handoff-shield { margin-top: 44px; margin-bottom: 18px; }
.google-box { margin: 26px 0 0; padding: 14px 22px; border: 1px solid var(--border); border-radius: 14px; display: inline-flex; align-items: center; gap: 13px; text-align: left; box-shadow: 0 9px 24px rgba(55,40,61,.08); }
.google-icon { width: 42px; height: 42px; flex: 0 0 auto; }
.google-box strong { font-size: 19px; }
.stars { color: #f6b500; letter-spacing: 1px; font-size: 19px; line-height: 1; margin-top: 2px; }
.google-link { text-decoration: none; display: block; width: fit-content; min-width: 330px; margin: 30px auto 14px; }
.back-review { display: block; margin: 0 auto; padding: 6px; text-decoration: underline; text-underline-offset: 4px; font-size: 16px; }

@media (max-width: 760px) {
  #app { padding: 0; align-items: start; }
  .shell { min-height: 100vh; }
  .card { min-height: 100vh; border-radius: 0; padding: 28px 22px 34px; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .shield-art { display: none; }
  .logo { width: 88px; margin-bottom: 30px; }
  h1, .question h1, .results h1, .handoff h1 { font-size: 42px; }
  .intro-copy, .help { font-size: 16px; }
  .options { grid-template-columns: 1fr; }
  .results .progress-wrap, .handoff .progress-wrap, .loading-screen .progress-wrap { position: static; width: 100%; margin-bottom: 28px; }
  .review-options { grid-template-columns: 1fr; }
  .results-actions { flex-direction: column-reverse; }
  .results-actions .primary, .google-link { min-width: 0; width: 100%; text-align: center; }
  .review-text { min-height: 150px; }
  .handoff-shield { margin-top: 22px; }
  .custom-row { grid-column: 1; }
  .actions { align-items: stretch; }
  .actions .primary { flex: 1; }
  .privacy { margin-top: 28px; }
}
