/* Customer review page — Green theme (mockups/review-page-final.html). Loaded only on /r/{code} in review state. */

.rv {
  --bg: #f4f6f3; --head-bg: #1f5a43; --head-ink: #ffffff; --head-muted: #cfe2d8;
  --surface: #ffffff; --card: #ffffff; --line: #e1e7e2; --text: #1a231f; --muted: #5f6b65;
  --brand: #23694d; --brand-ink: #ffffff; --brand-soft: #e7f2ec; --star: #e9a63a; --star-off: #d7ddd9;
  --shadow: 0 1px 2px rgb(20 40 30 / .05), 0 4px 14px rgb(20 40 30 / .05);
  --heart: #e0453a;
  --mood-5: #2e9e5b; --mood-4: #7cb342; --mood-3: #e6a823; --mood-2: #ef8a3c; --mood-1: #e0533d;
}
/* Dark colours apply only when <html data-theme="auto"> (currently off: light for everyone). */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .rv {
    --bg: #0e1612; --head-bg: #143a2c; --head-ink: #eef5f1; --head-muted: #a9c4b6;
    --surface: #111a16; --card: #18231e; --line: #26352e; --text: #e7efe9; --muted: #9db0a5;
    --brand: #6cc29a; --brand-ink: #0e1612; --brand-soft: #1d3a2e; --star: #f0b54d; --star-off: #34443c;
    --shadow: none;
  }
}

body.bare { background: #f4f6f3; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] body.bare { background: #0e1612; } }
body.bare::before { display: none; }

.rv {
  min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
}

/* ---------- Header band ---------- */
.rv-head {
  background: var(--head-bg); color: var(--head-ink);
  background: linear-gradient(135deg, #1a4d3a 0%, #23694d 55%, #2f8a6a 100%); /* G1: deep green → teal */
  padding: calc(18px + env(safe-area-inset-top)) 20px 28px;
  display: flex; align-items: center; gap: 14px;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .rv-head { background: linear-gradient(135deg, #0f2e22 0%, #17402f 55%, #1d5642 100%); }
}
.rv-head-text { flex: 1; min-width: 0; }
.rv-eyebrow { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--head-muted); }
.rv-name { margin: 4px 0 2px; font-size: 23px; line-height: 1.15; font-weight: 750; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rv-area { margin: 0; display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--head-muted); }
.rv-area svg { flex: none; }
.rv-tile { width: 54px; height: 54px; flex: none; border-radius: 16px; background: var(--card); color: var(--brand); display: grid; place-items: center; box-shadow: 0 4px 14px rgb(0 0 0 / .15); }

/* ---------- Sheet ---------- */
.rv-sheet { flex: 1; margin-top: -16px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 16px 0; display: flex; flex-direction: column; width: 100%; max-width: 520px; align-self: center; }
.rv-sheet:focus { outline: none; }
.rv-q { margin: 0; font-size: 19px; font-weight: 700; }
.rv-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }

.rv-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 8px; min-height: 30px; }
.rv-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rv-ai svg { color: var(--brand); flex: none; }
.rv-rephrase { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation; }
.rv-rephrase svg { transition: transform .35s; }
.rv-rephrase.spin svg { transform: rotate(180deg); }

/* ---------- Cards ---------- */
.rv-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; flex: 1 0 auto; align-content: space-between; max-height: 620px; } /* spare height spreads between the cards */
.rv-card {
  --mood: var(--mood-3);
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  background: var(--card); color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-left: 4px solid var(--mood); border-radius: 14px;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color .4s, box-shadow .4s, transform .1s;
}
.rv-card.mood-5 { --mood: var(--mood-5); }
.rv-card.mood-4 { --mood: var(--mood-4); }
.rv-card.mood-3 { --mood: var(--mood-3); }
.rv-card.mood-2 { --mood: var(--mood-2); }
.rv-card.mood-1 { --mood: var(--mood-1); }
.rv-card:active { transform: scale(.99); }

/* Soft colour flow on tap */
.rv-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, var(--card)), color-mix(in srgb, var(--brand) 20%, var(--card)));
  transform: scaleX(0); transform-origin: left;
  transition: transform .75s cubic-bezier(.33, 0, .15, 1) .1s;
}
.rv-card > * { position: relative; z-index: 1; }

.rv-face { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; line-height: 1; background: color-mix(in srgb, var(--mood) 16%, transparent); transition: opacity .35s .4s; }
.rv-body { flex: 1; min-width: 0; display: grid; gap: 3px; transition: opacity .35s .4s; }
.rv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.rv-stars { display: inline-flex; gap: 2px; color: var(--star); }
.rv-stars .off { color: var(--star-off); }
.rv-text { font-size: 15px; line-height: 1.38; transition: opacity .2s; }
.rv-text.fade { opacity: 0; }

.rv-send { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand); padding: 3px 4px 3px 11px; border-radius: 999px; box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 30%, transparent); }
.rv-plane { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-ink) 22%, transparent); }

.rv-done { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: 15px; opacity: 0; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease; pointer-events: none; }
.rv-done svg { padding: 3px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }

.rv-card.is-done { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); border-left-color: var(--mood); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 14%, transparent); }
.rv-card.is-done::before { transform: scaleX(1); }
.rv-card.is-done .rv-face, .rv-card.is-done .rv-body { opacity: 0; }
.rv-card.is-done .rv-plane svg { animation: rv-fly .55s ease-in forwards; }
.rv-card.is-done .rv-done { opacity: 1; transform: none; transition-delay: .6s; }
@keyframes rv-fly { to { transform: translate(40px, -30px) rotate(-20deg); opacity: 0; } }

/* ---------- Footer ---------- */
.rv-foot { padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); text-align: center; }
.rv-skip { display: inline-block; padding: 6px 8px; font-size: 14px; font-weight: 600; color: var(--brand); text-decoration: none; }
.rv-thanks { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rv-heart { color: var(--heart); }
.rv-powered { font-size: 11px; opacity: .85; }

.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rv :focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Shorter screens ----------
   Everything stays visible on every phone; spacing and sizes shrink step by step so the 5 cards, Skip and the
   thank-you line fit without scrolling. Heights are the *visible* area (browser bars already taken off),
   e.g. iPhone SE in Safari ≈ 548 px. Review text is capped at a few lines; the full text is always what gets copied. */
.rv-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.rv-rephrase svg { width: 15px; height: 15px; }

@media (max-height: 800px) {
  .rv-head { padding: calc(14px + env(safe-area-inset-top)) 18px 24px; }
  .rv-name { font-size: 21px; }
  .rv-tile { width: 46px; height: 46px; border-radius: 14px; }
  .rv-tile svg { width: 24px; height: 24px; }
  .rv-sheet { padding-top: 14px; }
  .rv-tools { margin: 8px 0 6px; }
  .rv-cards { gap: 7px; }
  .rv-card { padding: 8px 10px; gap: 10px; }
  .rv-face { width: 34px; height: 34px; font-size: 19px; border-radius: 10px; }
  .rv-text { font-size: 14.5px; line-height: 1.32; -webkit-line-clamp: 2; line-clamp: 2; }
  .rv-row { min-height: 22px; }
  .rv-foot { padding-top: 6px; }
}

@media (max-height: 680px) {
  .rv-head { padding: calc(10px + env(safe-area-inset-top)) 16px 20px; gap: 10px; }
  .rv-eyebrow { font-size: 10px; }
  .rv-name { font-size: 19px; margin: 2px 0 1px; }
  .rv-area { font-size: 12.5px; }
  .rv-tile { width: 40px; height: 40px; border-radius: 12px; }
  .rv-sheet { margin-top: -12px; padding: 12px 14px 0; border-radius: 18px 18px 0 0; }
  .rv-q { font-size: 17px; }
  .rv-sub { font-size: 12.5px; margin-top: 1px; }
  .rv-tools { margin: 6px 0 5px; min-height: 28px; }
  .rv-ai { font-size: 12px; }
  .rv-rephrase { min-height: 28px; padding: 3px 10px; font-size: 12px; }
  .rv-cards { gap: 6px; }
  .rv-card { padding: 6px 10px; border-radius: 12px; }
  .rv-face { width: 30px; height: 30px; font-size: 17px; }
  .rv-stars svg { width: 12px; height: 12px; }
  .rv-send { font-size: 11px; padding: 2px 3px 2px 9px; }
  .rv-plane { width: 17px; height: 17px; }
  .rv-text { font-size: 14px; line-height: 1.3; }
  .rv-row { min-height: 20px; }
  .rv-foot { padding: 4px 0 calc(6px + env(safe-area-inset-bottom)); }
  .rv-skip { padding: 3px 8px; font-size: 13.5px; }
  .rv-thanks { font-size: 12px; margin: 0; }
}

@media (max-height: 620px) {
  .rv-head { padding: calc(8px + env(safe-area-inset-top)) 16px 16px; }
  .rv-eyebrow { font-size: 9.5px; }
  .rv-name { font-size: 18px; }
  .rv-tile { width: 36px; height: 36px; border-radius: 11px; }
  .rv-tile svg { width: 20px; height: 20px; }
  .rv-sheet { padding-top: 10px; }
  .rv-q { font-size: 16px; }
  .rv-sub { font-size: 12px; }
  .rv-tools { margin: 4px 0 4px; }
  .rv-cards { gap: 4px; }
  .rv-card { padding: 3px 10px; }
  .rv-text { font-size: 13.5px; line-height: 1.25; }
  .rv-row { min-height: 19px; }
  .rv-foot { padding: 2px 0 calc(4px + env(safe-area-inset-bottom)); }
  .rv-skip { padding: 2px 8px; font-size: 13px; }
  .rv-thanks { font-size: 11.5px; }
}

@media (max-height: 520px) {
  /* Tiny / old phones (iPhone 5 class): one line per review. */
  .rv-text { -webkit-line-clamp: 1; line-clamp: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .rv-card::before, .rv-face, .rv-body, .rv-done, .rv-text { transition: none !important; }
  .rv-card.is-done .rv-plane svg { animation: none; }
}
