:root {
  --primary: #074982;
  --secondary: #1b4580;
  --accent: #fbd84c;
  --foreground: #1a2744;
  --muted: #6b7690;
  --border: #e3e7f0;
  --background: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--foreground);
  background: var(--background);
}

h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

.review-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.review-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

/* Slow-scrolling lattice of trapezium outlines behind the form content -
   two interleaved tiles (up-pointing gold, down-pointing blue) that weave
   into a chain, faded out toward the centre so it frames the copy instead
   of fighting it for attention. */
.review-lines {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M8 48 L24 16 L40 16 L56 48' fill='none' stroke='%23fbd84c' stroke-width='1.5' stroke-opacity='0.6'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M8 16 L24 48 L40 48 L56 16' fill='none' stroke='%23074982' stroke-width='1.5' stroke-opacity='0.22'/%3E%3C/svg%3E");
  background-size: 64px 64px, 64px 64px;
  background-position: 0 0, 32px 32px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, transparent 0%, transparent 16%, #000 62%);
          mask-image: radial-gradient(circle at 50% 45%, transparent 0%, transparent 16%, #000 62%);
  animation: review-lines-drift 34s linear infinite;
}

@keyframes review-lines-drift {
  from { background-position: 0 0, 32px 32px; }
  to   { background-position: 64px 64px, 96px 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .review-lines {
    animation: none;
  }
}

.review-panel-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - 5rem);
}

@keyframes review-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.review-logo {
  height: 4.5rem;
  width: auto;
  margin-bottom: 3rem;
  animation: review-fade-up 0.6s ease both;
}

.review-step {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Restarts each time the step stops being [hidden] (display:none -> flex),
     so this also animates the rate -> thanks handoff, not just first paint. */
  animation: review-fade-up 0.55s ease both;
}

/* An author rule setting `display` beats the UA [hidden] default at equal
   specificity, so steps with [hidden] would otherwise still render. */
.review-step[hidden] {
  display: none;
}

.review-step h1 {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 2.5rem;
  animation: review-fade-up 0.6s ease both;
  animation-delay: 0.08s;
}

.review-heading-blue,
.review-heading-yellow {
  display: block;
}

.review-heading-blue {
  color: var(--primary);
}

.review-heading-yellow {
  color: var(--accent);
}

.review-stars {
  display: flex;
  gap: 0.9rem;
  animation: review-fade-up 0.6s ease both;
  animation-delay: 0.18s;
}

.review-star {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--border);
  transition: color 0.15s ease, transform 0.2s ease;
}

.review-star svg {
  width: 3.5rem;
  height: 3.5rem;
  transition: fill 0.15s ease;
}

.review-star:hover {
  transform: translateY(-3px) scale(1.12);
}

/* Fill this star and every star before it in DOM order on hover/select
   (applied via JS - a pure-CSS ~ sibling selector can't reach backwards). */
.review-star.is-hover,
.review-star.is-active {
  color: var(--accent);
}
.review-star.is-hover svg,
.review-star.is-active svg {
  fill: var(--accent);
}

.review-star.is-active {
  animation: review-star-pop 0.4s ease;
}

@keyframes review-star-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* 1-3 star private-feedback form */
.review-low {
  gap: 0.9rem;
  justify-content: flex-start;
}

.review-low-intro {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.4rem;
  animation: review-fade-up 0.5s ease both;
}

.review-input-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.review-input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-input::placeholder {
  color: #9aa3b8;
}

.review-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 73, 130, 0.12);
}

.review-textarea {
  border-radius: 1.25rem;
  resize: vertical;
  min-height: 8rem;
}

.review-send {
  width: 100%;
  margin-top: 0.5rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.review-send:hover {
  background: var(--secondary);
}

.review-send:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.review-error {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
  text-align: center;
}

.review-link-btn {
  appearance: none;
  background: none;
  border: none;
  margin-top: 0.4rem;
  padding: 0.25rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.review-link-btn:hover {
  color: var(--primary);
}

/* 4-5 star public-channel picker */
.review-high-intro {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.6rem;
  animation: review-fade-up 0.5s ease both;
}

.review-channel-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  margin-top: 0.85rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.review-channel-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(7, 73, 130, 0.12);
}

.review-channel-icon {
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  color: var(--primary);
}

.review-video-label {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.6rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.review-video-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.review-video-actions .review-channel-btn {
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  padding: 0.6rem 0.5rem;
}

.review-video-player {
  width: 100%;
  max-height: 16rem;
  border-radius: 1rem;
  background: #000;
  margin-bottom: 1.4rem;
}

.review-thanks-icon {
  display: grid;
  place-items: center;
  height: 3.5rem;
  width: 3.5rem;
  border-radius: 999px;
  background: rgba(7, 73, 130, 0.08);
  color: var(--primary);
  margin-bottom: 1.5rem;
  animation: review-fade-up 0.5s ease both, review-star-pop 0.5s ease 0.15s both;
}

.review-thanks-icon svg {
  height: 1.75rem;
  width: 1.75rem;
}

.review-thanks h1 {
  font-size: 1.5rem;
  color: var(--foreground);
  margin: 0 0 0.5rem;
  animation: review-fade-up 0.5s ease 0.1s both;
}

.review-thanks p {
  color: var(--muted);
  margin: 0;
  animation: review-fade-up 0.5s ease 0.18s both;
}

.review-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
  animation: review-fade-up 0.6s ease both;
  animation-delay: 0.3s;
}

.review-powered-by img {
  height: 1.5rem;
  width: auto;
}

.review-photo {
  position: relative;
}

.review-photo img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  html, body {
    /* The whole page is sized to exactly one screen below, so the outer
       document itself should never scroll or rubber-band. */
    overflow: hidden;
    overscroll-behavior: none;
  }

  .review-page {
    display: block;
    position: relative;
    height: 100vh;
    height: 100dvh;
  }

  /* The photo is the second column of the desktop grid and has nowhere to go
     at this width. It used to become a full-bleed background with a dark
     gradient over it, which is why every rule in here also had to flip the
     copy to white; dropping it instead means the panel keeps the same plain
     white surface and dark text it has on desktop, and none of those
     overrides are needed any more. */
  .review-photo {
    display: none;
  }

  .review-panel {
    position: absolute;
    inset: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 2rem 1.5rem 1.5rem;
  }

  .review-panel-inner {
    /* Must actually fill the panel's height (not just auto-size to its
       content) so the step below can flex-grow and push "Powered by"
       down to the bottom instead of everything bunching in the middle. */
    min-height: 100%;
  }

  .review-logo {
    height: 5.5rem;
    margin-bottom: 1.5rem;
  }

  .review-step h1 {
    margin-bottom: 1.5rem;
  }
}
