:root {
  --bg: #f4f7fb;
  --paper: #ffffff;
  --ink: #101d58;
  --muted: #626a82;
  --line: #dfe4ef;
  --sage: #1eb9d0;
  --sage-soft: #e8f8fb;
  --dark: #152b78;
  --pink: #ed1747;
  --orange: #ff8124;
  --lime: #bedb21;
  --error: #c82e4e;
  --shadow: 0 24px 80px rgba(21, 43, 120, 0.10);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 3% 8%, rgba(30, 185, 208, .10), transparent 28rem),
    radial-gradient(circle at 96% 92%, rgba(190, 219, 33, .10), transparent 28rem),
    var(--bg);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { color: inherit; }

.shell {
  width: min(100% - 48px, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.brand { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand__mark { display: inline-flex; align-items: center; text-decoration: none; }
.brand__mark img { display: block; width: clamp(243px, 24vw, 292px); height: auto; object-fit: contain; }
.brand__descriptor { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-underline-offset: 4px; }

.card {
  position: relative;
  width: min(100%, 850px);
  min-height: 620px;
  margin: auto;
  padding: 0 88px 64px;
  overflow: hidden;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.progress { height: 3px; margin: 0 -88px 62px; background: #e8e8e2; }
.progress__bar { display: block; width: 10%; height: 100%; background: linear-gradient(90deg, var(--pink), var(--orange), var(--lime), var(--sage)); transition: width .35s ease; }

.screen { display: none; opacity: 0; transform: translateY(8px); }
.screen.is-active { display: block; animation: enter .32s ease forwards; }
@keyframes enter { to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 16px; color: var(--sage); font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; max-width: 650px; font-family: "Comfortaa", "Manrope", sans-serif; font-weight: 600; letter-spacing: -.045em; line-height: 1.14; }
h1 { font-size: clamp(44px, 5vw, 67px); }
h2 { font-size: clamp(36px, 4.2vw, 53px); }
.lead { max-width: 590px; margin: 18px 0 36px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.rating { margin-top: 8px; }
.rating__numbers { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.rating__numbers button {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}
.rating__numbers button:hover, .rating__numbers button:focus-visible { color: white; border-color: var(--dark); background: var(--dark); transform: translateY(-2px); outline: none; }
.rating__numbers button:nth-child(4n+1):hover { border-color: var(--pink); background: var(--pink); }
.rating__numbers button:nth-child(4n+2):hover { border-color: var(--orange); background: var(--orange); }
.rating__numbers button:nth-child(4n+3):hover { border-color: var(--lime); background: #a8c516; }
.rating__numbers button:nth-child(4n):hover { border-color: var(--sage); background: var(--sage); }
.rating__legend { display: flex; justify-content: space-between; margin-top: 13px; color: #8a918d; font-size: 11px; }

.back { display: inline-flex; align-items: center; gap: 8px; margin: -30px 0 28px; padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.back:hover { color: var(--ink); }

.field { display: block; margin: 0 0 12px; }
.field-label { margin: 0 0 11px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 112px;
  padding: 19px 20px;
  color: var(--ink);
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 14px;
  line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
}
textarea::placeholder { color: #9a9f9c; }
textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(129,149,138,.14); outline: none; }
.field__hint { display: flex; justify-content: space-between; margin-top: 8px; color: #919894; font-size: 11px; }
.field--review textarea { min-height: 186px; }
.field--issue textarea { min-height: 132px; }

.contact-request { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin: 18px 0 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.contact-request strong, .contact-request span { display: block; }
.contact-request strong { color: var(--ink); font-size: 13px; line-height: 1.4; }
.contact-request span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.contact-request button { padding: 10px 13px; border: 1px solid var(--dark); border-radius: 10px; background: white; color: var(--dark); font-size: 11px; font-weight: 600; cursor: pointer; transition: .2s ease; }
.contact-request button.is-selected { background: var(--dark); color: white; }

.writing-prompt { margin: -10px 0 18px; padding: 14px 16px; border-left: 3px solid var(--sage); background: #f7fafc; }
.writing-prompt span { display: block; margin-bottom: 5px; color: var(--dark); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.writing-prompt p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.prompt-hints { margin: -4px 0 18px; color: #7a8297; font-size: 11px; line-height: 1.65; }
.prompt-hints__label { display: block; margin-bottom: 2px; color: var(--muted); font-weight: 600; }
.prompt-hints__text { display: block; }

.explain-card {
  margin: -4px 0 18px;
  padding: 20px 22px;
  border: 1px solid #dce7f3;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5fbfd, #f7f9ff);
}
.benefit-row { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 12px; }
.benefit-row + .benefit-row { margin-top: 13px; }
.benefit-row > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: white; color: var(--dark); box-shadow: 0 2px 8px rgba(21,43,120,.08); font-size: 11px; font-weight: 600; }
.benefit-row p { margin: 3px 0 0; color: #3e4869; font-size: 13px; line-height: 1.5; }
.explain-note { margin: 0 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.chips button {
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  transition: .2s ease;
}
.chips button:hover { border-color: var(--sage); }
.chips button.is-selected { border-color: var(--dark); background: var(--dark); color: white; }
.chips--compact { margin-bottom: 22px; }
.chips--compact button { padding: 9px 14px; font-size: 12px; }
.chips--single { margin-bottom: 20px; }
.chips--single button { min-width: 126px; }

.primary, .secondary {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--dark);
  border-radius: 14px;
  background: var(--dark);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: .2s ease;
}
.primary:hover { background: #0e226b; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(21,43,120,.18); }
.primary:disabled { cursor: wait; opacity: .72; transform: none; box-shadow: none; }
.secondary { background: transparent; color: var(--ink); }
.secondary:hover { background: var(--sage-soft); }
.text-button { margin-top: 18px; padding: 8px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.text-button--center { display: block; margin: 10px auto 0; font-size: 12px; text-decoration: none; }
.text-button--center:hover { color: var(--ink); }
.error { min-height: 18px; margin: 3px 0 0; color: var(--error); font-size: 12px; }

.privacy { margin: 14px 0 0; text-align: center; color: #919894; font-size: 11px; }

.screen--center { padding-top: 38px; text-align: center; }
.screen--center h2, .screen--center .lead { margin-left: auto; margin-right: auto; }
.success { display: grid; width: 62px; height: 62px; margin: 0 auto 28px; place-items: center; border-radius: 50%; background: var(--sage-soft); color: var(--dark); font-size: 25px; }

footer { display: flex; justify-content: space-between; padding: 0 4px; color: #7d8580; font-size: 11px; }
footer a { color: inherit; text-underline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 28px; padding: 13px 18px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border-radius: 9px; background: var(--ink); color: white; font-size: 12px; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.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; }

@media (max-width: 700px) {
  body { overflow: hidden; }
  .shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 12px 14px 10px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }
  .brand { padding: 0 8px; }
  .brand__mark img { width: min(58vw, 210px); }
  .brand__descriptor { display: none; }
  .card {
    height: 100%;
    min-height: 0;
    padding: 0 22px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 22px;
  }
  .progress { margin: 0 -22px 32px; }
  h1 { font-size: 38px; }
  h2 { font-size: 30px; }
  .lead { margin: 12px 0 22px; font-size: 14px; line-height: 1.5; }
  .rating__numbers { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .rating__numbers button { min-height: 51px; }
  .rating__legend { margin-top: 11px; }
  .back { margin-top: -17px; margin-bottom: 17px; }
  .chips { gap: 8px; }
  .chips button { padding: 10px 13px; font-size: 12px; }
  .chips--single { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips--single button { width: 100%; min-width: 0; }
  .explain-card { padding: 14px 15px; }
  .benefit-row + .benefit-row { margin-top: 9px; }
  .explain-note { line-height: 1.45; }
  .contact-request { grid-template-columns: 1fr; }
  .contact-request button { width: 100%; }
  .primary { margin-top: 14px; }
  .primary, .secondary, .text-button--center { width: 100%; }
  .text-button--center {
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    text-decoration: none;
  }
  .field--review textarea { min-height: 150px; }
  .screen[data-screen="draft"] .lead { margin-bottom: 18px; }
  .screen[data-screen="feedback"] .back { margin-bottom: 12px; }
  .screen[data-screen="feedback"] .lead { margin-bottom: 14px; }
  .screen[data-screen="feedback"] .field--issue textarea { min-height: 108px; }
  .screen[data-screen="feedback"] .contact-request { gap: 9px; margin-top: 11px; padding: 12px 13px; }
  .screen[data-screen="feedback"] .primary { margin-top: 10px; }
  .screen--center { padding-top: 14px; }
  .screen[data-screen="detail"] { padding-bottom: 82px; }
  .screen[data-screen="detail"] h2 { font-size: 30px; }
  .screen[data-screen="detail"] .lead { margin: 10px 0 16px; }
  .screen[data-screen="detail"] .writing-prompt { margin: 0 0 12px; padding: 10px 12px; }
  .screen[data-screen="detail"] .writing-prompt p { line-height: 1.45; }
  .screen[data-screen="detail"] .prompt-hints { margin: 0 0 12px; }
  .screen[data-screen="detail"] textarea { min-height: 124px; padding: 14px 15px; }
  .screen[data-screen="detail"].is-active .primary {
    position: fixed;
    z-index: 20;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    margin: 0;
    box-shadow: 0 12px 32px rgba(21,43,120,.24);
  }
  footer { display: none; }
}

@media (max-width: 700px) and (max-height: 720px) {
  .shell { padding-top: 8px; gap: 7px; }
  .brand__mark img { width: min(50vw, 178px); }
  .card { padding-bottom: 18px; }
  .progress { margin-bottom: 24px; }
  .eyebrow { margin-bottom: 10px; }
  h1 { font-size: 34px; }
  h2 { font-size: 27px; }
  .lead { margin: 9px 0 16px; }
  .rating__numbers { gap: 7px; }
  .rating__numbers button { min-height: 44px; }
  .writing-prompt p { font-size: 11px; }
}

@media (max-height: 760px) and (min-width: 701px) {
  .shell { padding-top: 22px; gap: 14px; }
  .card { min-height: 560px; padding-bottom: 42px; }
  .progress { margin-bottom: 38px; }
}

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