/**
 * popup-chorario.css - Estilos para el popup inteligente de Chorario
 * @version 2.0.0
 */

/* ============================================================
   OVERLAY
   ============================================================ */
.chorario-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.chorario-popup-overlay.active {
    display: flex;
    opacity: 1;
}

/* ============================================================
   POPUP PRINCIPAL
   ============================================================ */
.chorario-popup {
    position: relative;
    max-width: 540px;
    width: 92%;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    padding: 48px 40px 40px;
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chorario-popup-overlay.active .chorario-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Decoración superior */
.chorario-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
}

/* ============================================================
   BOTÓN CERRAR
   ============================================================ */
.chorario-popup-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 50%;
    transition: background 0.25s, color 0.25s, transform 0.3s;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chorario-popup-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: rotate(90deg) scale(1.05);
}

.chorario-popup-close:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================================
   LOGO
   ============================================================ */
.chorario-popup-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 18px;
    margin-bottom: 20px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.chorario-popup-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* ============================================================
   CONTENIDO
   ============================================================ */
.chorario-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.chorario-popup-title .highlight {
    color: #2563eb;
}

.chorario-popup-subtitle {
    font-size: 0.85rem;
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px 0;
}

.chorario-popup-text {
    font-size: 1rem;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 28px 0;
}

.chorario-popup-text strong {
    color: #0f172a;
}

/* ============================================================
   BOTONES
   ============================================================ */
.chorario-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.chorario-popup-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    text-decoration: none;
    flex: 1 1 auto;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.chorario-popup-btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    text-decoration: none;
}

.chorario-popup-btn-primary:active {
    transform: scale(0.97);
}

.chorario-popup-btn-primary:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

.chorario-popup-btn-primary .arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.chorario-popup-btn-primary:hover .arrow {
    transform: translateX(4px);
}

.chorario-popup-btn-secondary {
    padding: 12px 20px;
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.25s;
    flex: 0 1 auto;
}

.chorario-popup-btn-secondary:hover {
    color: #1e293b;
}

.chorario-popup-btn-secondary:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================================
   BADGE DE CONFIANZA
   ============================================================ */
.chorario-popup-trust {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.chorario-popup-trust span {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chorario-popup-trust span .icon {
    font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .chorario-popup {
        padding: 36px 24px 28px;
        width: 94%;
        border-radius: 20px;
    }

    .chorario-popup-title {
        font-size: 1.25rem;
    }

    .chorario-popup-text {
        font-size: 0.95rem;
    }

    .chorario-popup-logo {
        width: 56px;
        height: 56px;
        padding: 10px;
        border-radius: 14px;
    }

    .chorario-popup-actions {
        flex-direction: column;
        gap: 10px;
    }

    .chorario-popup-btn-primary {
        width: 100%;
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .chorario-popup-btn-secondary {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .chorario-popup-trust {
        flex-wrap: wrap;
        gap: 8px 16px;
        justify-content: center;
    }

    .chorario-popup-close {
        top: 12px;
        right: 14px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    .chorario-popup {
        padding: 28px 16px 22px;
        border-radius: 16px;
    }

    .chorario-popup-title {
        font-size: 1.1rem;
    }

    .chorario-popup-text {
        font-size: 0.88rem;
    }

    .chorario-popup-logo {
        width: 48px;
        height: 48px;
        padding: 8px;
    }
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chorario-popup-overlay.active .chorario-popup {
    animation: popupFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================================
   HIGH CONTRAST
   ============================================================ */
@media (prefers-contrast: high) {
    .chorario-popup {
        border: 2px solid #0f172a;
    }

    .chorario-popup-btn-primary {
        background: #0f172a;
        border: 2px solid #0f172a;
    }

    .chorario-popup-btn-primary:hover {
        background: #1e293b;
    }

    .chorario-popup-close {
        color: #0f172a;
    }

    .chorario-popup-close:hover {
        background: #e2e8f0;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .chorario-popup-overlay,
    .chorario-popup-overlay.active .chorario-popup,
    .chorario-popup-close,
    .chorario-popup-btn-primary {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .chorario-popup-overlay.active .chorario-popup {
        opacity: 1;
        transform: none;
    }

    .chorario-popup-overlay.active {
        opacity: 1;
    }
}