/* ============================================================================
   TGAC PDF Viewer — popup de cristal, por encima del navbar
   Prefijo: tgacpdf-
   ============================================================================ */

.tgacpdf-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 72px 18px 28px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.tgacpdf-overlay.is-open {
    display: flex !important;
}

.tgacpdf-modal {
    width: min(920px, calc(100vw - 36px));
    height: min(82vh, 820px);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 22px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tgacpdf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.42);
    color: #f8fafc;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.tgacpdf-title {
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tgacpdf-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.tgacpdf-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.tgacpdf-btn:hover,
.tgacpdf-btn:focus-visible {
    background: rgba(37, 99, 235, 0.92);
    outline: none;
}

.tgacpdf-btn:disabled {
    opacity: 0.38;
    cursor: default;
    transform: none;
}

.tgacpdf-page {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 64px;
    text-align: center;
    color: #e2e8f0;
}

.tgacpdf-close {
    background: rgba(239, 68, 68, 0.28);
}

.tgacpdf-close:hover,
.tgacpdf-close:focus-visible {
    background: #ef4444;
}

.tgacpdf-stage {
    position: relative;
    flex: 1;
    overflow: auto;
    background: rgba(248, 250, 252, 0.78);
}

.tgacpdf-canvas-wrap {
    min-height: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 16px 28px;
}

.tgacpdf-canvas-wrap {
    width: 100%;
    box-sizing: border-box;
}

.tgacpdf-canvas-wrap canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.tgacpdf-status {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-weight: 600;
    text-align: center;
    padding: 24px;
}

.tgacpdf-status.is-visible {
    display: flex;
}

.tgacpdf-mark {
    pointer-events: none;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.10);
    transform: rotate(-18deg);
}

@media (max-width: 768px) {
    .tgacpdf-mark {
        font-size: 0.95rem;
        color: rgba(15, 23, 42, 0.16);
        letter-spacing: 0.12em;
    }
}

.tgacpdf-shield {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: #05070c;
    color: #e2e8f0;
    z-index: 5;
}

.tgacpdf-shield.is-on {
    display: flex;
}

.tgacpdf-shield-card {
    text-align: center;
    max-width: 320px;
    padding: 24px;
}

.tgacpdf-shield-card i {
    font-size: 1.8rem;
    color: #93c5fd;
    margin-bottom: 10px;
}

.tgacpdf-shield-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.tgacpdf-shield-card span {
    display: block;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #94a3b8;
}

@media print {
    .tgacpdf-overlay,
    .tgacpdf-modal,
    .tgacpdf-stage,
    #tgacpdf-canvas {
        display: none !important;
        visibility: hidden !important;
    }
}

.tgacpdf-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(30, 41, 59, 0.16);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tgacpdf-spin 0.8s linear infinite;
    margin-right: 12px;
}

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

@media (max-width: 640px) {
    .tgacpdf-overlay {
        padding: 64px 10px 16px;
    }
    .tgacpdf-modal {
        height: min(84vh, 760px);
        border-radius: 16px;
    }
    .tgacpdf-title {
        font-size: 0.78rem;
        max-width: 38vw;
    }
    .tgacpdf-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }
}
