/*
 * لوين؟ — the GPS-verification question at the end of a ride (js/trace-verify.js), on «الخطوط» and
 * «الرحلة», and the «أكّده الركاب بالتتبع» badge of a ride step. Loaded with the gps_verify feature only.
 *
 * One card per line ridden, like a stamp waiting for its ink: a dial with how much of the ride
 * followed the line, the question, «نعم» / «لا، شكرًا», and what is kept if the answer is yes.
 */

.tv-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.tv-card {
  --p: 0;
  position: relative;
  padding: 14px;
  border: 1.5px solid #8CD9CF;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(22, 184, 166, 0.14), transparent 60%),
    var(--white);
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(20, 45, 78, 0.06), 0 8px 20px rgba(20, 45, 78, 0.08);
}
.tv-card__head { display: flex; align-items: center; gap: 14px; }
.tv-card__question { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }

/* The dial: a teal arc over the share of the ride on the line, the number in the middle. */
.tv-gauge {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--teal-50) 0);
}
.tv-gauge::before { content: ""; position: absolute; inset: 7px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1.5px rgba(20, 45, 78, 0.08); }
.tv-gauge__value {
  position: relative;
  font: 800 1.125rem/1 var(--shell-display, var(--font));
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

.tv-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tv-btn {
  display: inline-flex;
  flex: 1 1 8rem;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 18px;
  border: 1.5px solid var(--control-edge);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.tv-btn--yes { border-color: var(--navy); background: var(--navy); color: var(--white); }
.tv-btn--yes:hover { background: var(--navy-700); }
.tv-btn--no:hover { background: var(--surface); border-color: var(--border-strong); }
.tv-btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.tv-btn:disabled { opacity: 0.6; cursor: progress; }

/* What is kept: in view with the question, above «نعم»; the whole notice under «المزيد». */
.tv-privacy { margin: 10px 0 0; font-size: 0.8125rem; line-height: 1.7; color: var(--muted); }
.tv-card__privacy { position: relative; margin: 0; padding-inline-start: 22px; color: var(--navy); }
.tv-card__privacy::before {
  content: "";
  position: absolute;
  top: 0.35em;
  inset-inline-start: 2px;
  width: 12px;
  height: 14px;
  border-radius: 6px 6px 7px 7px;
  background: var(--teal);
  clip-path: polygon(50% 0, 100% 18%, 100% 55%, 50% 100%, 0 55%, 0 18%);
}
.tv-privacy__more summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--navy); text-decoration: underline; cursor: pointer; }
.tv-privacy__more summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
.tv-privacy__more ul { display: grid; gap: 4px; margin: 0; padding-inline-start: 18px; }

.tv-card__result { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-weight: 700; line-height: 1.6; }
.tv-card__result:focus { outline: none; }
.tv-card__result:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Answered: counted (teal, with a tick), waiting for the team (yellow), not counted or not sent (grey). */
.tv-card.is-accepted { border-color: var(--teal); }
.tv-card.is-accepted .tv-card__result { background: var(--teal-50); color: #0B5E55; }
.tv-card.is-accepted .tv-card__result::before { content: "✓ "; }
.tv-card.is-flagged .tv-card__result { background: var(--yellow-50); color: #6B4700; }
.tv-card.is-rejected .tv-card__result,
.tv-card.is-error .tv-card__result { background: var(--danger-50); color: var(--danger); }
.tv-card.is-declined { border-color: var(--border); background: var(--surface); box-shadow: none; }
.tv-card.is-declined .tv-card__result { padding: 0; background: none; color: var(--muted); }

/* Nothing to ask (too short a ride, an estimated way back): one quiet line. */
.tv-card.is-quiet { padding: 10px 14px; border-style: dashed; border-color: var(--border-strong); background: var(--surface); box-shadow: none; }
.tv-card.is-quiet .tv-card__question { font-size: 0.875rem; font-weight: 600; color: var(--muted); }

/* «الرحلة»: the slot in the end screen gives its own box (trip.css) to the cards. */
.trip-verify:has(.tv-list) { padding: 0; border: 0; background: none; }

/* «أكّده الركاب بالتتبع» on a ride step of «الرحلة». */
.tv-badge { display: inline-flex; align-items: center; gap: 4px; border-color: #8CD9CF; background: var(--teal-50); color: #0B5E55; }
.tv-badge .icon { width: 14px; height: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .tv-card { animation: tv-in 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .tv-card:nth-child(2) { animation-delay: 0.08s; }
  .tv-card.is-accepted .tv-gauge { animation: tv-stamp 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
}
@keyframes tv-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes tv-stamp { 40% { transform: scale(1.12) rotate(-6deg); } }

@media (forced-colors: active) {
  .tv-gauge { forced-color-adjust: none; }
  .tv-card { border: 2px solid CanvasText; }
}
