/* ==========================================================================
   Avaliações do Google (Elfsight) + loader de marca
   ========================================================================== */
.rv-box { position: relative; min-height: 140px; }
.rv-box.is-loading { min-height: 560px; }

/* O widget fica invisível (mas no layout, para a Elfsight montar) até estar pronto */
.rv-widget { opacity: 0; transition: opacity .8s ease .15s; }
.rv-box.is-ready .rv-widget { opacity: 1; }
.rv-box.is-error .rv-widget { display: none; }
.rv-actions { display: flex; justify-content: center; margin-top: 32px; }

/* ---------- Loader ---------- */
.rv-loader {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 30px 20px; color: #fff; text-align: center; overflow: hidden;
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 16px),
        linear-gradient(135deg, #00357b 0%, #00285f 60%, #001c45 100%);
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
    transition: opacity .7s ease, transform .7s ease;
}
.rv-loader::before {                      /* faixa luminosa que varre o painel */
    content: ""; position: absolute; top: -10%; bottom: -10%; left: -30%; width: 110px;
    background: rgba(74, 163, 255, .14); transform: skewX(-22deg);
    animation: rv-sweep 3.4s ease-in-out infinite;
}
.rv-loader.is-leaving { opacity: 0; transform: scale(1.02); pointer-events: none; }
.rv-loader[hidden] { display: none; }
.rv-loader > * { position: relative; }

.rv-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 6px 16px 6px 6px; background: rgba(255, 255, 255, .1); font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; }
.rv-g { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #fff; color: #00357b; }

.rv-stars { display: flex; gap: 8px; margin-bottom: 6px; }
.rv-stars span { display: inline-flex; color: #fbbc04; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); animation: rv-star 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .16s); }
@keyframes rv-star {
    0%, 100% { transform: scale(.55) rotate(-14deg); opacity: .28; }
    25%, 70% { transform: scale(1) rotate(0); opacity: 1; }
}
.rv-title { margin: 6px 0 0; font-family: var(--font-head); font-weight: 800; font-size: 1.9rem; text-transform: uppercase; letter-spacing: .05em; }
.rv-stage { margin: 4px 0 0; min-height: 1.5em; color: #cfe0ff; animation: rv-fade .5s ease; }
@keyframes rv-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Barra de progresso com caminhão que acompanha o avanço */
.rv-progress { display: flex; align-items: center; gap: 14px; width: min(440px, 88%); margin: 18px 0 8px; }
.rv-track { position: relative; flex: 1; height: 8px; background: rgba(255, 255, 255, .16); transform: skewX(-20deg); }
.rv-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 1%); background: linear-gradient(90deg, #4aa3ff, #fff); transition: width .4s ease; }
.rv-truck { position: absolute; bottom: 8px; left: calc(var(--p, 0) * 1%); transform: translateX(-70%) skewX(20deg); color: #4aa3ff; transition: left .4s ease; }
.rv-truck .icon { animation: rv-bump .45s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.rv-percent { min-width: 3.2ch; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; text-align: right; }
@keyframes rv-bump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes rv-sweep { 0% { left: -30%; } 100% { left: 130%; } }

/* Esqueleto dos cartões */
.rv-skeleton { display: flex; gap: 16px; width: 100%; max-width: 940px; margin-top: 22px; opacity: .6; }
.rv-skel-card { flex: 1 1 0; display: flex; flex-direction: column; gap: 9px; padding: 16px; background: rgba(255, 255, 255, .07); border-top: 4px solid rgba(74, 163, 255, .65); text-align: left; }
.rv-skel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.rv-skel-who { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.rv-skel { display: block; height: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, .12) 25%, rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, .12) 75%); background-size: 200% 100%; animation: rv-shimmer 1.5s linear infinite; }
.rv-skel-avatar { width: 38px; height: 38px; flex-shrink: 0; }
.rv-skel-stars { width: 96px; height: 12px; }
.rv-skel-line.w40 { width: 40%; }
.rv-skel-line.w60 { width: 60%; }
.rv-skel-line.w80 { width: 80%; }
@keyframes rv-shimmer { to { background-position: -200% 0; } }

/* ---------- Erro ---------- */
.rv-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 24px; text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 5px solid var(--color-primary); }
.rv-error[hidden] { display: none; }
.rv-error-icon { color: #e0a800; }
.rv-error p { margin: 0 0 10px; color: var(--color-muted); }
.rv-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

@media (max-width: 760px) {
    .rv-box.is-loading { min-height: 520px; }
    .rv-skel-card:nth-child(n+2) { display: none; }
    .rv-skeleton { max-width: 340px; }
    .rv-title { font-size: 1.6rem; }
}

/* ---------- Alto contraste / reduzir animações ---------- */
.hc .rv-loader { background: #000; border: 2px solid #ffd400; }
.hc .rv-stage { color: #fff; }
.hc .rv-truck { color: #ffd400; }
.hc .rv-fill { background: #ffd400; }
.hc .rv-error { border-color: #fff; border-top-color: #ffd400; }
html.reduce-motion .rv-loader::before { display: none; }
html.reduce-motion .rv-stars span { animation: none; transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .rv-loader::before { display: none; }
    .rv-stars span { animation: none; transform: none; opacity: 1; }
}
