/* ============================================================
       Design tokens
       ============================================================ */
:root {
  color-scheme: light;

  --bg: #edf0f4;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --input-bg: #fbfcfe;

  --text-1: #1a1e24;
  --text-2: #5b636e;
  --text-3: #7c848f;

  --border: #e2e7ec;
  --border-soft: #e8ecf1;
  --card-border: rgba(18, 26, 40, 0.06);
  --card-inset: rgba(255, 255, 255, 0.7);

  --accent: #0b5fd8;
  --accent-press: #0a4fb2;
  --accent-wash: rgba(11, 95, 216, 0.12);
  --accent-line: rgba(11, 95, 216, 0.42);
  --on-accent: #ffffff;

  --star: #f5a300;
  --star-bright: #ffb52e;
  --star-empty: #d3d8df;
  --star-glow: rgba(245, 163, 0, 0.34);
  --star-glow-2: rgba(255, 193, 84, 0.5);
  --star-shadow: rgba(120, 80, 0, 0.26);
  --star-spark: #fff4d6;

  --success: #12a150;
  --success-wash: rgba(18, 161, 80, 0.14);
  --danger: #c5221f;
  --danger-wash: rgba(197, 34, 31, 0.14);

  --mark-bg: rgba(11, 95, 216, 0.1);
  --mark-border: rgba(11, 95, 216, 0.18);

  --glow-top: rgba(11, 95, 216, 0.07);
  --glow-bottom: rgba(245, 163, 0, 0.05);

  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;

  --shadow-card:
    0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 26px -12px rgba(16, 24, 40, 0.12),
    0 40px 72px -34px rgba(16, 24, 40, 0.18);
  --btn-shadow:
    0 1px 2px rgba(10, 36, 100, 0.22), 0 8px 20px -8px rgba(11, 95, 216, 0.42);
  --btn-shadow-hover:
    0 2px 5px rgba(10, 36, 100, 0.26), 0 16px 32px -10px rgba(11, 95, 216, 0.52);

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  --font-display:
    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, sans-serif;
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    sans-serif;
}

/* ============================================================
       Base
       ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  position: relative;
  overflow-x: hidden;
}
img {
  max-width: 100%;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}

.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;
}

/* ============================================================
       Ambient background — static glow + faint grain (no motion)
       ============================================================ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(56% 42% at 50% -6%, var(--glow-top), transparent 72%),
    radial-gradient(44% 40% at 110% 114%, var(--glow-bottom), transparent 70%);
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
  mix-blend-mode: overlay;
}

/* ============================================================
       Card
       ============================================================ */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 476px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 var(--card-inset);
  padding: 42px 42px 28px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow: hidden;
  animation: card-in 0.72s var(--ease-out) both;
}
.page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-line),
    transparent
  );
  opacity: 0.7;
}

/* ============================================================
       View + entrance staggering
       ============================================================ */
.view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page > .brand {
  animation: rise-in 0.6s var(--ease-out) both 0.04s;
}
.page > #view-form .intro {
  animation: rise-in 0.6s var(--ease-out) both 0.12s;
}
.page > #view-form .form {
  animation: rise-in 0.6s var(--ease-out) both 0.2s;
}
.page > .site-footer {
  animation: rise-in 0.6s var(--ease-out) both 0.3s;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.986);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
       BrandHeader
       ============================================================ */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  color: black;
  background: var(--mark-bg);
  box-shadow: inset 0 0 0 1px var(--mark-border);
}
.brand-mark svg {
  width: 23px;
  height: 23px;
}
.brand-name {
  display: flex;
  flex-direction: column;
  text-align: center;
}
.brand-name-1 {
  font: 600 14px/1.1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-1);
}
.brand-name-2 {
  margin-top: 3px;
  font: 400 10px/1.2 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

@media (min-width: 600px) {
  .brand-name-1 {
    font-size: 15px;
  }
  .brand-name-2 {
    font-size: 11px;
  }
}

/* ============================================================
       Headline
       ============================================================ */
.intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.headline {
  margin: 0;
  font: 600 25px/1.2 var(--font-display);
  letter-spacing: -0.021em;
  color: var(--text-1);
  text-wrap: balance;
}
.subhead {
  margin: 0 auto;
  max-width: 36ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
@media (min-width: 600px) {
  .headline {
    font-size: 27px;
  }
}

/* ============================================================
       Form shell — no flex gap; the reveal region owns its spacing
       ============================================================ */
.form {
  display: flex;
  flex-direction: column;
}
.form > noscript {
  display: block;
}
.form > noscript .panel {
  margin-top: 20px;
}

/* ============================================================
       StarRating
       ============================================================ */
.rate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}
.stars-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}
.stars-row {
  --on: 0; /* lit stars — hover preview or committed rating */
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  gap: 6px;
  transition: transform 0.3s var(--ease-out);
}
@media (hover: hover) {
  .stars-row:hover {
    transform: translateY(-1px);
  }
}
.star-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.star-label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  cursor: pointer;
  color: var(--star-empty);
  border-radius: 14px;
  transition:
    transform 0.32s var(--ease-spring),
    color 0.22s ease calc(var(--i, 0) * 20ms),
    filter 0.3s ease calc(var(--i, 0) * 20ms);
  -webkit-tap-highlight-color: transparent;
}
.star-label svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}
/* Lit stars: colour warms and the glow grows with how many are lit (--on)
       and with each star's own position (--i) — higher ratings read brighter. */
.star-label.is-on {
  color: var(--star);
}
.stars-row[data-level="4"] .star-label.is-on,
.stars-row[data-level="5"] .star-label.is-on {
  color: var(--star-bright);
}
.star-label.is-on svg {
  filter: drop-shadow(0 2px calc(3px + var(--on) * 1.4px) var(--star-shadow))
    drop-shadow(
      0 0 calc(2px + var(--on) * 3.4px + var(--i) * 1px) var(--star-glow)
    )
    drop-shadow(0 0 calc(1px + var(--on) * 4px) var(--star-glow-2));
}
.star-label:active {
  transform: scale(0.9);
  transition-duration: 0.08s;
}
@media (hover: hover) {
  .star-label:hover {
    transform: scale(calc(1.12 + var(--on) * 0.016));
  }
}
.star-input:focus-visible + .star-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Commit ripple — amplitude and cascade both scale with the rating. */
.star-label.pop {
  animation: star-pop 0.52s var(--ease-spring)
    calc(var(--i, 0) * (30ms + var(--on) * 5ms));
}
@keyframes star-pop {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(calc(1.08 + var(--on) * 0.032));
  }
  70% {
    transform: scale(calc(0.97 - var(--on) * 0.006));
  }
  100% {
    transform: scale(1);
  }
}

/* ------------------------------------------------------------
       Rating celebration FX — lives inside .stars-row.
       Escalates 3 -> 4 -> 5; nothing fires for 1-2 (stays calm).
       Every layer starts invisible, so it is inert with motion off.
       ------------------------------------------------------------ */
.stars-fx {
  position: absolute;
  inset: -16px -8px;
  pointer-events: none;
}
.fx-bloom {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 244px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--star-glow-2), transparent 68%);
  filter: blur(9px);
  opacity: 0;
  z-index: -1;
}
.fx-ring,
.fx-ring2 {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 2px solid var(--star-bright);
  opacity: 0;
  z-index: -1;
}
.fx-ring2 {
  width: 42px;
  height: 42px;
  border-color: var(--star);
}
.fx-shine {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 10px;
  width: 32%;
  border-radius: 40px;
  background: linear-gradient(
    100deg,
    transparent,
    var(--star-spark),
    transparent
  );
  filter: blur(2px);
  opacity: 0;
  transform: translateX(-180%) skewX(-14deg);
  z-index: 2;
}
.fx-sparks {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.fx-sparks i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  background: radial-gradient(
    circle,
    var(--star-spark) 0 28%,
    var(--star-bright) 52%,
    transparent 72%
  );
  clip-path: polygon(
    50% 0,
    60% 40%,
    100% 50%,
    60% 60%,
    50% 100%,
    40% 60%,
    0 50%,
    40% 40%
  );
  opacity: 0;
  transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px))
    scale(0);
}

.stars-row.celebrate[data-committed="3"] {
  --ring-to: 1.7;
}
.stars-row.celebrate[data-committed="4"] {
  --ring-to: 2.15;
}
.stars-row.celebrate[data-committed="5"] {
  --ring-to: 2.8;
}

.stars-row.celebrate[data-committed="3"] .fx-shine,
.stars-row.celebrate[data-committed="4"] .fx-shine,
.stars-row.celebrate[data-committed="5"] .fx-shine {
  animation: fx-shine 0.62s var(--ease-out);
}

.stars-row.celebrate[data-committed="3"] .fx-ring,
.stars-row.celebrate[data-committed="4"] .fx-ring,
.stars-row.celebrate[data-committed="5"] .fx-ring {
  animation: fx-ring 0.72s var(--ease-out);
}

.stars-row.celebrate[data-committed="5"] .fx-ring2 {
  animation: fx-ring 0.98s 0.1s var(--ease-out);
}

.stars-row.celebrate[data-committed="4"] .fx-bloom,
.stars-row.celebrate[data-committed="5"] .fx-bloom {
  animation: fx-bloom 1s var(--ease-out);
}
.stars-row.celebrate[data-committed="5"] .fx-bloom {
  animation-duration: 1.2s;
}

.stars-row.celebrate[data-committed="4"] .fx-sparks i:nth-child(-n + 4),
.stars-row.celebrate[data-committed="5"] .fx-sparks i {
  animation: fx-spark 0.72s var(--ease-out) var(--d, 0ms);
}

@keyframes fx-shine {
  0% {
    opacity: 0;
    transform: translateX(-180%) skewX(-14deg);
  }
  14% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(370%) skewX(-14deg);
  }
}
@keyframes fx-ring {
  0% {
    opacity: 0.55;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(var(--ring-to, 2));
  }
}
@keyframes fx-bloom {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  32% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}
@keyframes fx-spark {
  0% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px))
      scale(0) rotate(0deg);
  }
  38% {
    opacity: 1;
    transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px))
      scale(var(--s, 1)) rotate(30deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 1.25px), calc(var(--y, 0) * 1.25px))
      scale(0) rotate(72deg);
  }
}

/* ============================================================
       RatingLabel
       ============================================================ */
.rating-label {
  margin: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 600 14px/1.4 var(--font-display);
  letter-spacing: 0.005em;
  color: var(--text-1);
}
.rating-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--text-3);
  transition: background-color 0.3s ease;
}
.rating-label:not([data-tone]) .rating-dot {
  display: none;
}
.rating-label[data-tone="low"] .rating-dot {
  background: var(--danger);
}
.rating-label[data-tone="mid"] .rating-dot {
  background: var(--star);
}
.rating-label[data-tone="high"] .rating-dot {
  background: var(--success);
}
.rating-label.pop .rating-word {
  animation: word-in 0.44s var(--ease-out);
}
.rating-label.pop .rating-dot {
  animation: dot-in 0.44s var(--ease-spring);
}
/* Live label while sweeping across the stars, before committing. */
.rating-label.is-preview {
  color: var(--text-2);
}
.rating-label.is-preview .rating-dot {
  opacity: 0.5;
}
.rating-word {
  display: inline-block;
}
@media (prefers-reduced-motion: no-preference) {
  .rating-word.shimmer {
    background: linear-gradient(
      100deg,
      var(--text-1) 0 38%,
      var(--star-bright) 50%,
      var(--text-1) 62%
    );
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: word-shimmer 0.95s var(--ease-out);
  }
}
@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
@keyframes dot-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes word-shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -140% 0;
  }
}

.rating-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.rating-hint.is-shown {
  opacity: 1;
  transform: none;
}
.rating-hint a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 2px;
}
.rating-hint a:hover {
  text-decoration: underline;
}

/* ============================================================
       PrivateFeedbackForm — reveal region (low ratings, <= 3)
       Collapses to zero height; animates open from the stars down.
       ============================================================ */
.reveal-region {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.52s var(--ease-out),
    visibility 0s linear 0.52s;
}
.reveal-region.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 0.52s var(--ease-out),
    visibility 0s;
}
.reveal-track {
  overflow: hidden;
  min-height: 0;
}
.reveal-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 24px;
}
.reveal-content > * {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.reveal-region.is-open .reveal-content > * {
  opacity: 1;
  transform: none;
}
.reveal-region.is-open .reveal-content > *:nth-child(1) {
  transition-delay: 0.08s;
}
.reveal-region.is-open .reveal-content > *:nth-child(2) {
  transition-delay: 0.13s;
}
.reveal-region.is-open .reveal-content > *:nth-child(3) {
  transition-delay: 0.18s;
}
.reveal-region.is-open .reveal-content > *:nth-child(4) {
  transition-delay: 0.22s;
}
.reveal-region.is-open .reveal-content > *:nth-child(5) {
  transition-delay: 0.26s;
}

.panel {
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--text-2);
}
.field-label .opt {
  color: var(--text-3);
  font-weight: 400;
}
.textarea,
.input {
  width: 100%;
  font: 400 16px/1.5 var(--font-body);
  color: var(--text-1);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}
.textarea {
  min-height: 112px;
  resize: vertical;
}
.input {
  height: 46px;
}
.textarea::placeholder,
.input::placeholder {
  color: var(--text-3);
}
.textarea:focus,
.input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.textarea.has-error,
.input.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-wash);
  animation: nudge 0.36s ease;
}
@keyframes nudge {
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}
.counter {
  align-self: flex-end;
  margin-top: -2px;
  font: 400 11px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.counter.show {
  opacity: 1;
  transform: none;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.contact-intro {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.field-error {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
  animation: err-in 0.28s var(--ease-out);
}
.field-error::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.form-error {
  justify-content: center;
}
@keyframes err-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
       Actions / buttons
       ============================================================ */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  font: 600 15px/1 var(--font-body);
  letter-spacing: 0.005em;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s var(--ease-spring),
    box-shadow 0.28s var(--ease-out),
    background-color 0.2s ease,
    opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0) 46%
  );
  pointer-events: none;
}
@media (hover: hover) {
  .btn:hover {
    background: var(--accent-press);
    box-shadow: var(--btn-shadow-hover);
    transform: translateY(-1px);
  }
}
.btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: var(--btn-shadow);
  transition-duration: 0.08s;
}
.btn:focus-visible {
  outline: none;
  box-shadow:
    var(--btn-shadow),
    0 0 0 4px var(--accent-wash);
}
.btn[disabled] {
  cursor: default;
  opacity: 0.7;
  transform: none;
  box-shadow: var(--btn-shadow);
}
.btn .btn-text {
  position: relative;
}
.btn .spinner {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 32%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.is-loading .spinner {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
       SuccessState
       ============================================================ */
.success {
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 6px 0 2px;
}
.check-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  animation: check-in 0.56s var(--ease-spring) both;
}
.check-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--success-wash), transparent 70%);
  animation: bloom 0.7s 0.1s var(--ease-out) both;
}
.check {
  position: relative;
  width: 58px;
  height: 58px;
}
.check .disc {
  fill: var(--success-wash);
}
.check .ring,
.check .mark {
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.check .ring {
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.55s 0.08s var(--ease-out) forwards;
}
.check .mark {
  stroke-width: 3.5;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.4s 0.5s var(--ease-out) forwards;
}
.success-heading {
  margin: 0;
  font: 600 20px/1.3 var(--font-display);
  letter-spacing: -0.012em;
  color: var(--text-1);
}
.success-heading:focus {
  outline: none;
}
.success-body {
  margin: 0;
  max-width: 32ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.view.is-entering .success-heading {
  animation: rise-in 0.5s var(--ease-out) both 0.12s;
}
.view.is-entering .success-body {
  animation: rise-in 0.5s var(--ease-out) both 0.18s;
}

.view.is-leaving {
  opacity: 0;
  transform: scale(0.985) translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  pointer-events: none;
}
.view.is-entering {
  animation: view-in 0.46s var(--ease-out) both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes check-in {
  from {
    opacity: 0;
    transform: scale(0.78);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes bloom {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ============================================================
       Footer
       ============================================================ */
.site-footer {
  margin-top: auto;
  padding-top: 14px;
  text-align: center;
  text-wrap: balance;
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

/* ============================================================
       Accessibility — reduced motion / transparency / contrast
       ============================================================ */
@media (prefers-reduced-transparency: reduce) {
  .ambient {
    display: none;
  }
  .page {
    background: var(--surface);
  }
}
@media (prefers-contrast: more) {
  :root {
    --border: #b4bcc6;
    --border-soft: #b4bcc6;
    --text-2: #3a424c;
    --text-3: #4c545e;
    --card-border: rgba(0, 0, 0, 0.5);
  }
  .page {
    border-color: var(--text-3);
  }
  .input,
  .textarea {
    border-width: 2px;
  }
  .panel {
    border-width: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .check .ring,
  .check .mark {
    stroke-dashoffset: 0 !important;
  }
  .stars-fx {
    display: none !important;
  }
  .rating-word.shimmer {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: inherit !important;
  }
}
