/* ==========================================================================
   SCANNER QR CODE (MpGmScanner)
   Bloco a ser adicionado ao final do mp_gm.css
   ========================================================================== */

.mp-gm-scanner-card {
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 24px;
    box-shadow:
        0 20px 50px -15px rgba(43, 69, 251, 0.18),
        0 8px 20px -8px rgba(0, 176, 228, 0.12);
    margin-bottom: 20px;
}

.mp-gm-scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}

@media (min-width: 769px) {
    .mp-gm-scanner-viewport {
        aspect-ratio: 16 / 10;
        max-height: 60vh;
    }
}

.mp-gm-scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-gm-scanner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background:
        radial-gradient(ellipse 70% 70% at center, transparent 60%, rgba(0,0,0,0.55) 100%);
}

.mp-gm-scanner-frame {
    position: relative;
    width: 68%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    animation: mpGmScanPulse 2.8s ease-in-out infinite;
}

@keyframes mpGmScanPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50%      { transform: scale(1.02); filter: brightness(1.1); }
}

.mp-gm-scanner-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid #ffffff;
    filter: drop-shadow(0 0 6px rgba(0, 176, 228, 0.8));
}

.mp-gm-scanner-corner.tl { top: 0;    left: 0;    border-right: none;  border-bottom: none; border-radius: 10px 0 0 0; }
.mp-gm-scanner-corner.tr { top: 0;    right: 0;   border-left: none;   border-bottom: none; border-radius: 0 10px 0 0; }
.mp-gm-scanner-corner.bl { bottom: 0; left: 0;    border-right: none;  border-top: none;    border-radius: 0 0 0 10px; }
.mp-gm-scanner-corner.br { bottom: 0; right: 0;   border-left: none;   border-top: none;    border-radius: 0 0 10px 0; }

.mp-gm-scanner-line {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #00b0e4 25%, #018cfb 75%, transparent 100%);
    border-radius: 2px;
    box-shadow:
        0 0 12px rgba(0, 176, 228, 0.9),
        0 0 24px rgba(1, 140, 251, 0.6);
    animation: mpGmScanLine 2.4s ease-in-out infinite;
}

@keyframes mpGmScanLine {
    0%, 100% { top: 4%;  opacity: 0.3; }
    50%      { top: 94%; opacity: 1; }
}

.mp-gm-scanner-status {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 90%;
    white-space: nowrap;
    z-index: 4;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mp-gm-scanner-status.error   { background: rgba(220, 38, 38, 0.92); }
.mp-gm-scanner-status.success { background: rgba(16, 185, 129, 0.94); }
.mp-gm-scanner-status.hidden  { opacity: 0; pointer-events: none; }

.mp-gm-scanner-flash {
    position: absolute;
    inset: 0;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.mp-gm-scanner-flash.firing {
    animation: mpGmScanFlash 0.5s ease-out;
}

@keyframes mpGmScanFlash {
    0%   { opacity: 0; }
    25%  { opacity: 0.85; }
    100% { opacity: 0; }
}

.mp-gm-scanner-controls {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

@media (max-width: 480px) {
    .mp-gm-scanner-controls { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; }
}

.mp-gm-scanner-ctrl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 62px;
    font-family: inherit;
}

.mp-gm-scanner-ctrl i {
    font-size: 18px;
    color: #2b45fb;
    transition: all 0.25s ease;
    line-height: 1;
}

.mp-gm-scanner-ctrl span { line-height: 1; }

.mp-gm-scanner-ctrl:hover {
    border-color: rgba(43, 69, 251, 0.4);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(43, 69, 251, 0.3);
}

.mp-gm-scanner-ctrl:active { transform: translateY(0); }

.mp-gm-scanner-ctrl.active {
    border-color: transparent;
    background: linear-gradient(135deg, #2b45fb, #00b0e4);
    color: #ffffff;
}

.mp-gm-scanner-ctrl.active i { color: #ffffff; }

.mp-gm-scanner-ctrl.muted i { color: #94a3b8; }

/* ===== Histórico : card visualmente gêmeo do scanner card ===== */
.mp-gm-scanner-history {
    width: 100%;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 22px 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,255,255,0.80));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 24px;
    box-shadow:
        0 20px 50px -15px rgba(43, 69, 251, 0.18),
        0 8px 20px -8px rgba(0, 176, 228, 0.12);
}

.mp-gm-scanner-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.mp-gm-scanner-history-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-gm-scanner-history-header h3 i {
    color: #2b45fb;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(43, 69, 251, 0.12), rgba(0, 176, 228, 0.12));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mp-gm-scanner-history-clear {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.mp-gm-scanner-history-clear:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(239, 68, 68, 0.2);
}

.mp-gm-scanner-history-clear i { font-size: 12px; }

.mp-gm-scanner-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mp-gm-scanner-history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.mp-gm-scanner-history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2b45fb, #00b0e4);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.mp-gm-scanner-history-item:hover {
    border-color: rgba(43, 69, 251, 0.35);
    transform: translateX(6px);
    box-shadow: 0 8px 20px -6px rgba(43, 69, 251, 0.28);
    background: rgba(255, 255, 255, 1);
}

.mp-gm-scanner-history-item:hover::before { transform: scaleY(1); }

.mp-gm-scanner-history-item .hist-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b45fb, #00b0e4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 6px 14px -4px rgba(43, 69, 251, 0.45);
}

.mp-gm-scanner-history-item .hist-body { flex: 1; min-width: 0; }

.mp-gm-scanner-history-item .hist-code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-gm-scanner-history-item .hist-time {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mp-gm-scanner-history-item .hist-time::before {
    content: '\f017';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    font-size: 10px;
    opacity: 0.7;
}

.mp-gm-scanner-history-item .hist-go {
    color: #cbd5e1;
    flex-shrink: 0;
    font-size: 14px;
    transition: all 0.22s ease;
}

.mp-gm-scanner-history-item:hover .hist-go {
    color: #2b45fb;
    transform: translateX(3px);
}

@media (max-width: 480px) {
    .mp-gm-scanner-history { padding: 18px 16px; }
    .mp-gm-scanner-history-header h3 { font-size: 15px; }
    .mp-gm-scanner-history-header h3 i { width: 28px; height: 28px; font-size: 14px; }
    .mp-gm-scanner-history-clear { padding: 7px 11px; font-size: 12px; }
    .mp-gm-scanner-history-item { padding: 12px 14px; gap: 12px; }
    .mp-gm-scanner-history-item .hist-icon { width: 40px; height: 40px; font-size: 16px; }
    .mp-gm-scanner-history-item .hist-code { font-size: 14px; }
    .mp-gm-scanner-history-item:hover { transform: translateX(3px); }
}