/* =========================================================
   SmartVerify+ main page
   ========================================================= */

:root {
    --text: #171b23;
    --teal: #08726f;
    --teal-strong: #007b74;
    --teal-background: #d5f5f2;
    --viewer-border: #252a32;
    --toolbar-background: #fafbfc;
    --toolbar-icon: #9099a6;
    --viewport-background: #f0f2f5;
    --footer-background: #171824;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/*
   V6 typography adjustment:
   Main website text is intentionally smaller than V5.
*/
body {
    font-size: 13px;
}

/* =========================================================
   Main page and header
   ========================================================= */

.page {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 28px 38px 34px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    margin-bottom: 28px;
}

.header-brand-image {
    display: block;
    width: 100%;
    max-width: 1060px;
    height: auto;
    object-fit: contain;
}

/* =========================================================
   Validity banner
   ========================================================= */

.validity-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
    padding: 26px 28px;
    border-radius: 5px;
    background: var(--teal-background);
    color: var(--teal);
    font-size: 15px;
    line-height: 1.4;
}

.validity-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-weight: 700;
}

/* =========================================================
   Document viewer
   ========================================================= */

.viewer {
    margin-bottom: 44px;
    border: 7px solid var(--viewer-border);
    box-shadow: 6px 7px #a5abb4;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 92px;
    padding: 0 28px;
    border-bottom: 1px solid #ccd1d8;
    background: var(--toolbar-background);
}

.toolbar-button {
    display: inline-flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--toolbar-icon);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.toolbar-button:hover,
.toolbar-button:focus-visible,
.toolbar-button.active {
    background: #eef1f5;
    color: #6f7885;
    outline: none;
}

.toolbar-button:focus-visible {
    box-shadow: inset 0 0 0 2px #9aa4b0;
}

.toolbar-separator {
    width: 1px;
    height: 42px;
    background: #d5d9df;
}

.toolbar-spacer {
    flex: 1;
}

.menu-wrapper {
    position: relative;
}

/*
   Important:
   The button itself owns the complete 58 x 58 px click target.
   The icon has pointer-events disabled so every pixel inside the
   button activates the same click listener.
*/
.menu-button {
    position: relative;
    z-index: 3;
}

.menu-button i {
    pointer-events: none;
}

.document-menu {
    position: absolute;
    z-index: 20;
    top: 64px;
    right: 0;
    width: 190px;
    overflow: hidden;
    border: 1px solid #d5d9df;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgb(0 0 0 / 14%);
}

.document-menu[hidden] {
    display: none;
}

.document-menu button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 13px;
    padding: 10px 16px;
    border: 0;
    background: #ffffff;
    color: #353b44;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.document-menu button:hover,
.document-menu button:focus-visible {
    background: #f1f3f5;
    outline: none;
}

.document-menu i {
    width: 20px;
    color: #7c8591;
    text-align: center;
}

.document-viewport {
    display: flex;
    height: 620px;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    padding: 42px;
    background: var(--viewport-background);
    cursor: default;
    overscroll-behavior: contain;
}

.document-viewport.pan-enabled {
    cursor: grab;
}

.document-viewport.pan-enabled.dragging {
    cursor: grabbing;
    user-select: none;
}

.pdf-stage {
    position: relative;
    flex: 0 0 auto;
    transform-origin: top center;
}

#pdfCanvas {
    display: block;
    max-width: none;
    background: #ffffff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 20%);
}

.loading-message {
    position: absolute;
    inset: 0;
    display: grid;
    min-width: 300px;
    min-height: 400px;
    place-items: center;
    color: #66707c;
    text-align: center;
}

/* =========================================================
   Verification details
   ========================================================= */

.details {
    max-width: 660px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #e1e4e8;
    border-radius: 5px;
}

.details-row {
    display: grid;
    min-height: 64px;
    grid-template-columns: 1fr 1.9fr 80px;
    align-items: center;
    padding: 0 18px;
}

.details-row:nth-child(odd) {
    background: #f6f6f6;
}

.details-row strong {
    color: var(--teal-strong);
}

.details-heading {
    min-height: 45px;
}

.details-heading strong {
    color: #111111;
}

.verified-check {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    justify-self: center;
    border: 2px solid #00847e;
    border-radius: 50%;
    color: #00847e;
    font-weight: 700;
}

.details-match {
    margin: 0 13px 13px;
    padding: 15px;
    background: var(--teal-background);
    color: var(--teal);
}

/* =========================================================
   Footer and return-to-top button
   ========================================================= */

.site-footer {
    padding: 34px 20px 28px;
    background: var(--footer-background);
    color: #ffffff;
    font-size: 13px;
    text-align: center;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-top: 14px;
}

.site-footer a {
    color: #ffffff;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.site-footer a i {
    margin-left: 3px;
    font-size: 0.82em;
}

.return-to-top {
    position: fixed;
    z-index: 30;
    right: 28px;
    bottom: 25px;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: rgb(48 58 145 / 78%);
    color: #c0c5cb;
    cursor: pointer;
    font-size: 26px;
    opacity: 0.78;
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.return-to-top:hover,
.return-to-top:focus-visible {
    opacity: 1;
    transform: translateY(-2px);
    outline: none;
}

/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 700px) {
    .page {
        padding: 18px 18px 28px;
    }

    .site-header {
        min-height: 95px;
        margin-bottom: 20px;
    }

    .validity-banner {
        padding: 20px;
        font-size: 13px;
    }

    .viewer {
        border-width: 5px;
    }

    .toolbar {
        height: 70px;
        gap: 4px;
        padding: 0 8px;
    }

    .toolbar-button {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }

    .toolbar-separator {
        height: 34px;
    }

    .document-viewport {
        height: 520px;
        padding: 20px;
    }

    .details {
        font-size: 13px;
    }

    .details-row {
        grid-template-columns: 1fr 1.5fr 45px;
        padding: 0 10px;
    }

    .site-footer nav {
        gap: 15px;
    }

    .return-to-top {
        right: 14px;
        bottom: 18px;
        width: 50px;
        height: 50px;
    }
}
