/**
 * ═══════════════════════════════════════════════════════════════════
 * RV COMPONENTS — Shared UI Components
 * Extraídos de auth/login.php, auth/register.php e views frequentes.
 * Incluso globalmente por todos os layouts.
 * ═══════════════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────────────
   FORM INPUTS — .campo (dark racing style)
───────────────────────────────────────────────────────────────── */
.campo {
    width: 100%;
    background: var(--rv-surface-2);
    border: 1.5px solid var(--rv-border);
    border-radius: var(--rv-radius-md);
    padding: 13px 16px;
    font-size: var(--rv-text-base);
    font-weight: 600;
    font-family: var(--rv-font);
    color: var(--rv-text);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    min-height: 48px;
}
.campo::placeholder { color: var(--rv-muted); }
.campo:focus {
    border-color: var(--rv-red);
    box-shadow: 0 0 0 3px var(--rv-red-dim);
}
.campo.erro {
    border-color: #ef4444;
    background: rgba(239,68,68,.05);
}
select.campo option {
    background: var(--rv-surface);
    color: var(--rv-text);
}

/* Dark variant (for dark backgrounds like auth) */
.dark .campo, body.rv-dark-page .campo {
    background: var(--rv-dark-surface-2);
    border-color: var(--rv-dark-border);
    color: var(--rv-dark-text);
}
.dark .campo::placeholder, body.rv-dark-page .campo::placeholder { color: var(--rv-dark-muted); }
.dark .campo:focus, body.rv-dark-page .campo:focus { border-color: var(--rv-red); }

/* ─────────────────────────────────────────────────────────────────
   BUTTONS — .btn-skew (racing skewed buttons)
───────────────────────────────────────────────────────────────── */
.btn-skew {
    transform: skewX(-8deg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-skew > span {
    display: inline-block;
    transform: skewX(8deg);
}

/* Primary action button (red, glowing) */
.rv-btn-race {
    background: linear-gradient(135deg, #E63946, #D62839);
    color: #fff;
    font-weight: 900;
    padding: 14px 24px;
    border-radius: var(--rv-radius-lg);
    font-size: var(--rv-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(230,57,70,0.25);
    transition: all 0.2s;
    width: 100%;
    transform: skewX(-8deg);
    min-height: 48px;
}
.rv-btn-race > span { display: inline-block; transform: skewX(8deg); }
.rv-btn-race:hover { box-shadow: 0 0 32px rgba(230,57,70,0.40); filter: brightness(1.08); }
.rv-btn-race:active { transform: skewX(-8deg) scale(0.98); }
.rv-btn-race:focus-visible { outline: 2px solid var(--rv-red); outline-offset: 2px; }

/* ML yellow button */
.rv-btn-ml {
    background: var(--rv-ml-yellow, #FFE600);
    color: var(--rv-ml-blue, #1a2060);
    font-weight: 900;
    padding: 14px 24px;
    border-radius: var(--rv-radius-lg);
    font-size: var(--rv-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,230,0,0.15);
    transition: all 0.2s;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.rv-btn-ml:hover { background: var(--rv-ml-yellow-hover, #ffd500); box-shadow: 0 4px 20px rgba(255,230,0,0.25); }
.rv-btn-ml:active { transform: scale(0.98); }

/* ─────────────────────────────────────────────────────────────────
   CHECKBOX — .check-custom
───────────────────────────────────────────────────────────────── */
.check-custom {
    width: 18px; height: 18px;
    background: var(--rv-surface-2);
    border: 1.5px solid var(--rv-border);
    border-radius: 5px;
    appearance: none; -webkit-appearance: none;
    flex-shrink: 0; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.check-custom:checked {
    background: var(--rv-red);
    border-color: var(--rv-red);
}
.check-custom:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 6px; height: 10px;
    border: 2px solid white;
    border-top: none; border-left: none;
    transform: rotate(45deg);
}
.check-custom:focus-visible { outline: 2px solid var(--rv-red); outline-offset: 2px; }

.dark .check-custom {
    background: var(--rv-dark-surface-2);
    border-color: var(--rv-dark-border-2);
}

/* ─────────────────────────────────────────────────────────────────
   RADIO CARDS — .radio-card (plan selection, etc.)
───────────────────────────────────────────────────────────────── */
.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--rv-surface-2);
    border: 1.5px solid var(--rv-border);
    border-radius: var(--rv-radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}
.radio-card:hover { border-color: var(--rv-border-2); }
.radio-card.selected, .radio-card:has(input:checked) {
    border-color: var(--rv-red);
    background: var(--rv-red-dim);
    box-shadow: 0 0 0 3px var(--rv-red-dim);
}

/* ─────────────────────────────────────────────────────────────────
   UTILITY ANIMATIONS (deduplicadas de ~20 views)
───────────────────────────────────────────────────────────────── */
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.dot-pulse { animation: pulse-dot 1.4s ease-in-out infinite; }

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.shimmer {
    background: linear-gradient(90deg, var(--rv-surface-2) 0px, var(--rv-surface-3) 40px, var(--rv-surface-2) 80px);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease infinite;
}

/* ─────────────────────────────────────────────────────────────────
   PAGE STICKY HEADER (glassmorphism)
───────────────────────────────────────────────────────────────── */
.rv-page-sticky-header {
    background: rgba(248,249,251,0.92);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--rv-border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 30;
    transition: box-shadow 0.2s;
}
.rv-page-sticky-header.scrolled { box-shadow: var(--rv-shadow-md); }
.dark .rv-page-sticky-header {
    background: rgba(22,22,24,0.92);
}

/* ─────────────────────────────────────────────────────────────────
   UTILITY: Safe bottom padding, no-scrollbar
───────────────────────────────────────────────────────────────── */
.pb-safe {
    padding-bottom: calc(var(--rv-bottombar-h) + env(safe-area-inset-bottom, 0px) + 1.5rem);
}

@media (min-width: 768px) {
    .pb-safe {
        padding-bottom: 1.5rem;
    }
}

/* ─────────────────────────────────────────────────────────────────
   SEPARATOR — Gradient divider (less border, more fluid)
───────────────────────────────────────────────────────────────── */
.rv-sep {
    height: 1px;
    border: none;
    background: linear-gradient(90deg, transparent, var(--rv-border), transparent);
}

/* ─────────────────────────────────────────────────────────────────
   EMPTY STATE (placeholder for no data)
───────────────────────────────────────────────────────────────── */
.rv-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--rv-muted);
}
.rv-empty-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}
.rv-empty-text {
    font-size: var(--rv-text-sm);
    font-weight: 700;
}
