/*
 * Estilos del Escáner QR — Petifinder
 * @version 7.6
 */

.pf-escaner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.2px;
}
.pf-escaner-btn:hover  { opacity: 0.9; }
.pf-escaner-btn:active { transform: scale(0.97); }

/* Modal */
.pf-escaner-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pf-escaner-modal-inner {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    max-width: 400px;
    position: relative;
    text-align: center;
}

.pf-escaner-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.pf-escaner-close:hover { background: rgba(255,255,255,0.2); }

.pf-escaner-titulo {
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 20px;
    padding-right: 30px;
}

/* Video + marco */
.pf-escaner-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
}

#pf-escaner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pf-escaner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Marco animado */
.pf-escaner-frame {
    width: 65%;
    aspect-ratio: 1;
    border: 3px solid #00a550;
    border-radius: 12px;
    position: relative;
    animation: pf-scan-pulse 1.8s ease-in-out infinite;
}
.pf-escaner-frame::before,
.pf-escaner-frame::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00a550, transparent);
    left: 0;
    animation: pf-scan-line 1.8s ease-in-out infinite;
}
.pf-escaner-frame::before { top: 0; }
.pf-escaner-frame::after  { bottom: 0; animation-delay: 0.9s; }

@keyframes pf-scan-pulse {
    0%, 100% { border-color: #00a550; box-shadow: 0 0 0 0 rgba(0,165,80,0); }
    50%       { border-color: #00d666; box-shadow: 0 0 0 6px rgba(0,165,80,0.2); }
}
@keyframes pf-scan-line {
    0%   { opacity: 0; transform: translateY(0); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(3px); }
}

/* Estado / feedback */
.pf-escaner-status {
    color: #9ca3af;
    font-size: 0.88em;
    min-height: 22px;
    transition: color 0.3s;
}
.pf-escaner-status.ok    { color: #00a550; font-weight: 700; }
.pf-escaner-status.error { color: #ef4444; }
