/**
 * Historial Automotor - Estilos Personalizados
 * Paleta: Rojo (#C8102E), Blanco, Grises
 * Mobile-First Design
 * =============================================
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --primary: #C8102E;
    --primary-dark: #A00D24;
    --primary-light: #E31837;
    --secondary: #1A1A1A;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(200, 16, 46, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(200, 16, 46, 0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   COMPONENTES PRINCIPALES
   ============================================ */

/* CTA Button Principal - El más importante */
.btn-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
}

.btn-cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(200, 16, 46, 0.4);
}

.btn-cta-primary:active {
    transform: translateY(-1px);
}

.btn-cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-cta-primary:hover::before {
    left: 100%;
}

/* Botón con animación pulsante para máxima atención */
.btn-pulse {
    animation: pulse-ring 2s infinite;
}

/* Formulario Hero */
.hero-form-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .hero-form-card {
        padding: 2rem;
    }
}

/* Input estilizado */
.input-styled {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-900);
    transition: all 0.2s ease;
}

.input-styled::placeholder {
    color: var(--gray-400);
}

.input-styled:hover {
    border-color: var(--gray-300);
}

.input-styled:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
}

/* Input de placa especial */
.input-placa {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Tarjetas de características */
.feature-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
}

/* Badges de confianza */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.trust-badge.success {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

/* Pasos del proceso */
.step-number {
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
}

.step-number::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px dashed rgba(200, 16, 46, 0.3);
}

/* Testimonios */
.testimonial-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--gray-100);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 4rem;
    color: rgba(200, 16, 46, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
}

/* Tabla de información */
.info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.info-table tr {
    transition: background 0.2s ease;
}

.info-table tr:hover {
    background: var(--gray-50);
}

.info-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.info-table td:first-child {
    color: var(--gray-500);
    font-weight: 500;
}

.info-table td:last-child {
    color: var(--gray-900);
    font-weight: 600;
}

/* Sección de logos de confianza */
.trust-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.trust-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.trust-logo:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.1);
}

.trust-logo img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .trust-logo img {
        height: 2.5rem;
    }
}

/* FAQ Acordeón */
.faq-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--gray-100);
}

.faq-item .faq-content {
    padding: 1.25rem;
    color: var(--gray-600);
    line-height: 1.7;
}

/* Precio destacado */
.price-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.price-original {
    font-size: 1.25rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.price-current {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

@media (min-width: 768px) {
    .price-current {
        font-size: 3.5rem;
    }
}

/* Urgencia / Escasez */
.urgency-bar {
    background: linear-gradient(90deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #FCD34D;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400E;
}

/* Mobile CTA Fijo */
.mobile-cta-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .mobile-cta-fixed {
        display: none;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Selector de banco */
.bank-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .bank-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bank-option {
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
}

.bank-option:hover {
    background: #FEE2E2;
    border-color: rgba(200, 16, 46, 0.3);
}

.bank-option.selected {
    background: #FEE2E2;
    border-color: var(--primary);
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    color: var(--gray-700);
    font-weight: 500;
}

/* Progress bar */
.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease;
}

/* Estrellas de rating */
.star-rating {
    display: flex;
    gap: 0.125rem;
}

.star-rating svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #FBBF24;
}

/* Datos bloqueados */
.blurred-data {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

/* Security badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ECFDF5;
    color: #065F46;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Contador de stats */
.stat-counter {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .stat-number {
        font-size: 3rem;
    }
}

/* Imagen del reporte */
.report-preview {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.report-preview img {
    width: 100%;
    height: auto;
}

.report-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    animation: bounceSubtle 2s infinite;
}

@keyframes bounceSubtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Espaciado para el CTA fijo móvil */
.pb-mobile-cta {
    padding-bottom: 5rem;
}

@media (min-width: 768px) {
    .pb-mobile-cta {
        padding-bottom: 0;
    }
}

/* Grid responsivo para features */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animación de entrada */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Placeholder para imágenes */
.image-placeholder {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border: 2px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 50%;
}

.image-placeholder::before {
    content: '';
    width: 40%;
    height: 40%;
    background: var(--gray-300);
    border-radius: 50%;
}
