/* ==========================================================================
   Add-your-review page. Loaded only by review.php, so it can assume the
   tokens, base type and .tf-btn-action from the main stylesheets.
   ========================================================================== */

/* Several controls here start life hidden and are revealed by the script.
   The browser hides [hidden] with display:none, but any author rule that sets
   display - and .rv-btn, .rv-timer and .rv-progress all do - outranks it, so
   every button was showing at once. This puts the attribute back in charge. */
[hidden] { display: none !important; }

.rv-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px 96px;
}
@media (min-width: 768px) { .rv-shell { padding-top: 64px; } }

.rv-back {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
  color: var(--black-56);
  text-decoration: none;
}
.rv-back:hover { color: var(--primary); }
.rv-back .fi { font-size: 15px; transform: rotate(-90deg); }

.rv-head { margin-bottom: 28px; }
.rv-title {
  margin: 10px 0 12px;
  font-size: clamp(32px, 4vw + 10px, 46px);
  line-height: 1.1;
  color: var(--black);
}
[data-theme="dark"] .rv-title { color: var(--white); }
.rv-lead { color: var(--black-56); margin: 0; max-width: 56ch; }

/* ---- the card ----------------------------------------------------------- */
.rv-card {
  padding: 26px;
  border-radius: 24px;
  background-color: var(--white);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .rv-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
}
@media (max-width: 575px) { .rv-card { padding: 20px; } }

.rv-step + .rv-step { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--black-8); }
.rv-step-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px;
  font-size: 19px; line-height: 26px;
  color: var(--black);
}
[data-theme="dark"] .rv-step-title { color: var(--white); }
.rv-num {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  font-size: 13px;
}

/* ---- stage -------------------------------------------------------------- */
/* Upright: the review cards are 9:16 and so is a YouTube Short, so the person
   recording should be framed the way they will actually be seen. */
.rv-stage {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  border-radius: 16px;
  overflow: hidden;
  background-color: #0d0c0c;
  display: flex; align-items: center; justify-content: center;
}
/* contain, never cover. The stage is 9:16 but a laptop webcam hands over a
   16:9 frame, and covering would scale that up and slice the sides off -
   which looks like the camera has zoomed in, and worse, shows the person a
   crop that will not exist in the file they actually send. Bars against the
   near-black stage are the honest picture. */
.rv-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #0d0c0c;
}
/* The live preview is mirrored, the way every video-call app does it, because
   an unmirrored view of yourself is oddly hard to talk to. The recording is
   not affected - only this element is flipped. */
#rv-preview { transform: scaleX(-1); }

.rv-stage-empty {
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #ffffff8c;
  text-align: center;
  padding: 16px;
}
.rv-cam {
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background-color: #ffffff14;
  color: var(--primary);
}
.rv-cam svg { width: 24px; height: 24px; }

.rv-timer {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding-inline: 12px;
  margin: 0;
  border-radius: 999px;
  background: #141212bf;
  color: #fff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rv-rec-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background-color: #ff4d4d;
  animation: rv-pulse 1.2s ease-in-out infinite;
}
@keyframes rv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.rv-note { margin: 12px 0 0; color: var(--black-56); min-height: 20px; }
.rv-note.is-ok  { color: var(--primary); }
.rv-note.is-warn { color: #d99b45; }
.rv-note.is-err { color: #e0654f; }
[data-theme="dark"] .rv-note.is-err { color: #ff8f7a; }

/* ---- buttons ------------------------------------------------------------ */
.rv-actions {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
}
.rv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding-inline: 20px;
  border: 1px solid var(--black-15);
  border-radius: 999px;
  background: none;
  color: var(--black);
  font: inherit; font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
[data-theme="dark"] .rv-btn { color: var(--white); border-color: #ffffff26; }
.rv-btn:hover { border-color: var(--primary); color: var(--primary); }
.rv-btn--primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.rv-btn--primary:hover { background-color: #c9603f; border-color: #c9603f; color: #fff; }
.rv-btn-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.rv-btn--rec { border-color: #e0654f; color: #e0654f; }
.rv-btn--rec:hover { background-color: #e0654f; color: #fff; }
.rv-btn--rec.is-stop { background-color: #e0654f; color: #fff; }

.rv-file { position: relative; overflow: hidden; color: var(--black-56); cursor: pointer; }
.rv-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rv-file span { text-decoration: underline; text-underline-offset: 3px; }
.rv-file:hover span { color: var(--primary); }
.rv-hint { color: var(--black-40); margin: 12px 0 0; }

/* ---- fields ------------------------------------------------------------- */
.rv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 575px) { .rv-row { grid-template-columns: 1fr; } }
.rv-field { margin-bottom: 16px; }
.rv-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px; line-height: 20px;
  color: var(--black-56);
}
.rv-opt { color: var(--black-40); }
.rv-field input,
.rv-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--black-15);
  border-radius: 12px;
  background: none;
  color: var(--black);
  font: inherit; font-size: 15px;
}
[data-theme="dark"] .rv-field input,
[data-theme="dark"] .rv-field textarea { color: var(--white); border-color: #ffffff26; }
.rv-field input:focus,
.rv-field textarea:focus { outline: none; border-color: var(--primary); }
.rv-field textarea { resize: vertical; }

.rv-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; color: var(--black-56); }
.rv-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--primary); }

.rv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- submit ------------------------------------------------------------- */
.rv-submit { margin-top: 28px; }
.rv-progress {
  height: 4px;
  margin-top: 16px;
  border-radius: 999px;
  background-color: var(--black-8);
  overflow: hidden;
}
.rv-progress-bar {
  display: block;
  height: 100%; width: 0;
  border-radius: 999px;
  background-color: var(--primary);
  transition: width .2s ease;
}
.rv-result { margin: 12px 0 0; min-height: 20px; color: var(--black-56); font-size: 15px; }
.rv-result.is-err { color: #e0654f; }
[data-theme="dark"] .rv-result.is-err { color: #ff8f7a; }

/* ---- thank you ---------------------------------------------------------- */
.rv-done {
  padding: 40px 26px;
  border-radius: 24px;
  text-align: center;
  background-color: var(--white);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .rv-done {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
}
.rv-done-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px;
  margin-bottom: 8px;
  border-radius: 50%;
  background-color: #de735624;
  color: var(--primary);
}
.rv-done-ic svg { width: 28px; height: 28px; }
.rv-done .rv-lead { margin-inline: auto; }
.rv-done .rv-btn { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  .rv-rec-dot { animation: none !important; }
}

/* ---- overlay camera controls -------------------------------------------- */
/* On the frame, not under it. A 9:16 stage is already tall; a row of buttons
   below it pushed the whole thing off a phone screen. */
.rv-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  padding: 14px 12px 16px;
  /* A gradient rather than a bar, so the picture is never cut by a hard edge. */
  background: linear-gradient(to top, #000000b8 0%, #00000059 55%, transparent 100%);
}

.rv-cbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 46px; height: 46px;
  padding: 0;
  border: 1px solid #ffffff40;
  border-radius: 999px;
  background: #16141480;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font: inherit; font-size: 14px;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease,
              border-color var(--dur-fast) ease;
}
.rv-cbtn:hover { background: #2a2626cc; }
.rv-cbtn:active { transform: scale(.94); }
.rv-cbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rv-cbtn svg { width: 20px; height: 20px; display: block; }
.rv-cbtn--wide { width: auto; padding-inline: 20px; }

/* The record button borrows the shape every camera app uses: a red disc inside
   a ring, so it needs no label to be understood. */
.rv-cbtn--rec {
  width: 58px; height: 58px;
  border: 3px solid #fff;
  background: transparent;
}
.rv-cbtn--rec:hover { background: #ffffff1f; }
.rv-rec-inner {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #e0654f;
  transition: border-radius var(--dur-fast) ease, width var(--dur-fast) ease, height var(--dur-fast) ease;
}
.rv-cbtn--stop { border-color: #e0654f80; color: #e0654f; }
.rv-cbtn--stop:hover { background: #e0654f26; }

/* One button, two faces: the icon follows the recorder's state.
   Each selector carries two classes so it outranks ".rv-cbtn svg" above,
   which sets display:block on every icon - with a bare .rv-ic-resume both
   faces showed at once, whatever the order. */
.rv-cbtn .rv-ic-resume { display: none; }
.rv-cbtn.is-paused .rv-ic-pause  { display: none; }
.rv-cbtn.is-paused .rv-ic-resume { display: block; }

/* ---- zoom --------------------------------------------------------------- */
/* Up the right edge, out of the way of the face in the middle of the frame. */
.rv-zoom {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 6px;
  border-radius: 999px;
  background: #16141480;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid #ffffff26;
}
.rv-zbtn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: #ffffff1f;
  color: #fff;
  cursor: pointer;
}
.rv-zbtn:hover { background: #ffffff33; }
.rv-zbtn svg { width: 14px; height: 14px; }
/* Upright slider. writing-mode is the modern way; the WebKit appearance keeps
   older Safari from laying it out sideways. */
.rv-zrange {
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: slider-vertical;
  width: 22px; height: 96px;
  accent-color: var(--primary);
  cursor: pointer;
}
.rv-zval { color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }

@media (max-width: 380px) {
  .rv-controls { gap: 10px; padding-inline: 8px; }
  .rv-zoom { top: 12px; right: 8px; transform: none; }
  .rv-zrange { height: 70px; }
}

/* ---- tabs ---------------------------------------------------------------- */
/* Radio buttons, not scripted state: with JavaScript off the panels still
   switch, and the checked radio is what tells the server which kind arrived. */
.rv-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
/* Off-screen rather than display:none - a hidden input cannot take focus, and
   the tabs have to be reachable from the keyboard. */
.rv-tabin { position: absolute; opacity: 0; pointer-events: none; }
.rv-tab {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--black-15);
  border-radius: 999px;
  color: var(--black-56);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease,
              background-color var(--dur-fast) ease;
}
[data-theme="dark"] .rv-tab { border-color: #ffffff26; }
.rv-tab svg { width: 18px; height: 18px; }
.rv-tab:hover { color: var(--primary); border-color: var(--primary); }
#rv-tab-video:checked ~ .rv-tabs label[for="rv-tab-video"],
#rv-tab-text:checked  ~ .rv-tabs label[for="rv-tab-text"] {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
/* The focus ring has to come from the radio, which is invisible. */
#rv-tab-video:focus-visible ~ .rv-tabs label[for="rv-tab-video"],
#rv-tab-text:focus-visible  ~ .rv-tabs label[for="rv-tab-text"] {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* Panels follow the radios, which sit at the top of .rv-shell - the only place
   from which "~" can reach both the labels and the form. */
.rv-panel { display: none; }
#rv-tab-video:checked ~ #rv-form .rv-panel--video,
#rv-tab-text:checked  ~ #rv-form .rv-panel--text { display: block; }
/* The video-only extras go with their tab. */
#rv-tab-text:checked ~ #rv-form .rv-only-video { display: none; }
/* First visible panel must not carry the divider meant for a middle one. */
#rv-tab-text:checked ~ #rv-form .rv-panel--text { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---- stars --------------------------------------------------------------- */
/* Laid out in reverse (5 first) so "this star and every one before it" is a
   plain sibling selector, with no script and no per-star classes. */
.rv-stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rv-stars input { position: absolute; opacity: 0; pointer-events: none; }
.rv-stars label {
  display: flex;
  padding: 2px;
  color: var(--black-15);
  cursor: pointer;
  transition: color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
[data-theme="dark"] .rv-stars label { color: #ffffff2e; }
.rv-stars svg { width: 34px; height: 34px; fill: currentColor; }
.rv-stars label:hover { transform: scale(1.1); }
.rv-stars input:checked ~ label,
.rv-stars label:hover,
.rv-stars label:hover ~ label { color: var(--primary); }
.rv-stars input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.rv-sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---- optional selfie ----------------------------------------------------- */
.rv-selfie {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 4px;
  padding: 16px;
  border-radius: 16px;
  background-color: var(--black-4);
}
[data-theme="dark"] .rv-selfie { background-color: #ffffff0a; }

.rv-selfie-stage {
  position: relative;
  width: 116px; height: 116px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background-color: #0d0c0c;
  display: flex; align-items: center; justify-content: center;
}
/* cover here, unlike the video stage: the frame is cropped to a circle either
   way, and the person can see exactly what the circle will keep. */
.rv-selfie-stage video,
.rv-selfie-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#sf-preview { transform: scaleX(-1); }        /* mirrored, like every camera app */
.rv-selfie-empty { color: #ffffff5c; }
.rv-selfie-empty svg { width: 40px; height: 40px; }

.rv-selfie-side { flex: 1 1 240px; min-width: 0; }
.rv-selfie-title { margin: 0 0 4px; font-weight: 500; color: var(--black); }
[data-theme="dark"] .rv-selfie-title { color: var(--white); }
.rv-selfie-text { color: var(--black-56); margin: 0 0 12px; }
.rv-selfie-text.is-err { color: #e0654f; }
[data-theme="dark"] .rv-selfie-text.is-err { color: #ff8f7a; }
.rv-selfie-btns { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rv-selfie-btns .rv-btn { height: 38px; padding-inline: 16px; font-size: 14px; }