/* Standalone PDF document viewer (company profiles).
   Pages are rasterised to <canvas> by pdf.js so the document reads inline
   without exposing the browser's native download / print toolbar. */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    width: 100%;
}

body {
    background: linear-gradient(-45deg, #1e3c72, #2a5298, #6b5b95, #2c3e50, #4b0082);
    background-size: 500% 500%;
    animation: tmPdfGradient 15s ease infinite;
    font-family: 'Arial', Helvetica, sans-serif;
    color: #fff;
    overflow-y: auto;
}

@keyframes tmPdfGradient {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 50% 100%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

.tm-pdf-pages {
    display: block;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    box-sizing: border-box;
}

.tm-pdf-page {
    position: relative;
    margin: 0 auto 24px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    background: #fff;
    /* Placeholder keeps the scroll height stable before the page paints. */
    aspect-ratio: var(--tm-page-ratio, 1 / 1.414);
    max-width: 100%;
}

.tm-pdf-page canvas {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity .9s ease-out, transform .9s ease-out;
}

.tm-pdf-page.is-rendered canvas {
    opacity: 1;
    transform: translateY(0);
}

/* Loading / error overlay */
.tm-pdf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    text-align: center;
    z-index: 10;
    transition: opacity .8s ease-out, visibility .8s ease-out;
}

.tm-pdf-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.tm-pdf-overlay__title {
    font-size: clamp(20px, 4vw, 28px);
    letter-spacing: .04em;
    font-weight: 700;
    margin: 0;
}

.tm-pdf-overlay__status {
    font-size: 15px;
    opacity: .85;
    margin: 0;
    min-height: 1.2em;
}

.tm-pdf-overlay__bar {
    width: min(320px, 70vw);
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .2);
    overflow: hidden;
}

.tm-pdf-overlay__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: #fff;
    transition: width .3s ease-out;
}

/* Error state — replaces the blank screen a failed load used to leave behind. */
.tm-pdf-overlay.is-error {
    background: rgba(20, 6, 6, .92);
}

.tm-pdf-overlay.is-error .tm-pdf-overlay__bar {
    display: none;
}

.tm-pdf-overlay__fallback {
    display: inline-block;
    margin-top: 4px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    transition: background .2s ease-out;
}

.tm-pdf-overlay__fallback:hover,
.tm-pdf-overlay__fallback:focus {
    background: rgba(255, 255, 255, .15);
}

@media (prefers-reduced-motion: reduce) {
    body { animation: none; }

    .tm-pdf-page canvas {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .tm-pdf-overlay { transition: none; }
}
