/* certificate-sample-modal-v1 */

body.certificate-sample-opened {
    overflow: hidden !important;
}

.certificate-sample-open {
    appearance: none;
    cursor: pointer;
    font-family: inherit;
}

.certificate-sample-modal[hidden] {
    display: none !important;
}

.certificate-sample-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: stretch;
    background: rgba(0, 0, 0, .86);
}

.certificate-sample-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(30, 67, 116, .24), transparent 40%),
        rgba(0, 4, 12, .92);
    cursor: zoom-out;
}

.certificate-sample-shell {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    pointer-events: none;
}

.certificate-sample-toolbar,
.certificate-sample-viewport,
.certificate-sample-mobile-hint {
    pointer-events: auto;
}

.certificate-sample-toolbar {
    min-height: 70px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(232, 184, 92, .35);
    background: rgba(3, 9, 20, .97);
    color: #f4f0e8;
    font-family: Arial, Helvetica, sans-serif;
}

.certificate-sample-toolbar > div:first-child {
    min-width: 0;
}

.certificate-sample-toolbar strong {
    display: block;
    color: #f0c46d;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: .08em;
}

.certificate-sample-toolbar span {
    display: block;
    margin-top: 3px;
    color: #aebed2;
    font-size: 12px;
    line-height: 1.35;
}

.certificate-sample-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.certificate-sample-toolbar-btn {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(232, 184, 92, .70);
    border-radius: 6px;
    background: rgba(14, 24, 42, .96);
    color: #f1c66f;
    font: 700 11px/1.25 Arial, Helvetica, sans-serif;
    letter-spacing: .045em;
    cursor: pointer;
}

.certificate-sample-toolbar-btn:hover,
.certificate-sample-toolbar-btn:focus-visible {
    border-color: #ffd678;
    background: rgba(31, 42, 64, .98);
    outline: none;
}

.certificate-sample-close {
    border-color: rgba(255,255,255,.48);
    color: #fff;
}

.certificate-sample-viewport {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sample-cert-sheet {
    position: relative;
    container-type: inline-size;
    flex: 0 0 auto;
    width: min(
        1536px,
        calc(100vw - 32px),
        calc((100dvh - 116px) * 1.5)
    );
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #07111e;
    box-shadow: 0 22px 70px rgba(0,0,0,.65);
    user-select: none;
    transition: width .2s ease;
}

.certificate-sample-modal.is-zoomed .sample-cert-sheet {
    width: min(1536px, 145vw);
}

.sample-cert-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.sample-cert-overlay {
    position: absolute;
    z-index: 10;
    box-sizing: border-box;
    color: #f5f1e8;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.12;
    text-shadow: 0 1px 2px rgba(0,0,0,.75);
}

.sample-cert-owner {
    left: 11.0%;
    top: 39.8%;
    width: 30.5%;
    min-height: 5.8%;
    font-size: 1.00cqw;
}

.sample-cert-owner small {
    display: block;
    margin-top: .24cqw;
    color: #d9d2c3;
    font-size: .62cqw;
    line-height: 1.1;
}

.sample-cert-coordinates {
    left: 11.0%;
    top: 49.2%;
    width: 30.5%;
    font-size: .98cqw;
}

.sample-cert-height {
    left: 11.0%;
    top: 57.5%;
    width: 30.5%;
    font-size: .98cqw;
}

.sample-cert-time-label {
    position: absolute;
    z-index: 12;
    left: 10.55%;
    top: 63.55%;
    width: 31.4%;
    height: 2.25%;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding-left: .28%;
    background: #07111e;
    color: #d89a3b;
    font-family: Georgia, "Times New Roman", serif;
    font-size: .79cqw;
    letter-spacing: .01em;
    white-space: nowrap;
}

.sample-cert-time {
    left: 11.0%;
    top: 65.7%;
    width: 31.0%;
    min-height: 4.6%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: .12cqw;
    font-size: .72cqw;
    white-space: nowrap;
}

.sample-cert-time small {
    color: #ddd5c8;
    font-size: .61cqw;
    line-height: 1.05;
}

.sample-cert-id {
    left: 11.0%;
    top: 74.25%;
    width: 31.8%;
    font-size: .50cqw;
    white-space: nowrap;
}

.sample-cert-badge {
    position: absolute;
    z-index: 12;
    left: 81.2%;
    top: 4.0%;
    width: 14.5%;
    height: 4.3%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(216,154,59,.92);
    background: #07111e;
    color: #d89a3b;
    font: 700 .82cqw/1 Georgia, "Times New Roman", serif;
    letter-spacing: .10em;
}

.sample-cert-watermark {
    position: absolute;
    z-index: 9;
    left: 31%;
    top: 42%;
    width: 52%;
    transform: rotate(-17deg);
    color: #ffffff;
    font: 700 6.2cqw/1 Arial, Helvetica, sans-serif;
    letter-spacing: .13em;
    text-align: center;
    opacity: .075;
    pointer-events: none;
}

.sample-cert-qr {
    position: absolute;
    z-index: 12;
    left: 4.55%;
    top: 80.8%;
    width: 9.5%;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid #fff;
    background: #fff;
}

.sample-cert-qr-pattern {
    position: absolute;
    inset: 5%;
    background:
        linear-gradient(90deg, #000 12%, transparent 12% 24%, #000 24% 38%, transparent 38% 47%, #000 47% 58%, transparent 58% 72%, #000 72% 88%, transparent 88%),
        linear-gradient(#000 11%, transparent 11% 23%, #000 23% 35%, transparent 35% 49%, #000 49% 63%, transparent 63% 77%, #000 77% 90%, transparent 90%);
    opacity: .95;
}

.sample-cert-qr span {
    position: relative;
    z-index: 2;
    padding: .25em .38em;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font: 800 .62cqw/1 Arial, Helvetica, sans-serif;
    letter-spacing: .06em;
}

.certificate-sample-mobile-hint {
    display: none;
    box-sizing: border-box;
    padding: 8px 14px 12px;
    background: rgba(3, 9, 20, .98);
    color: #aebed2;
    font: 12px/1.35 Arial, Helvetica, sans-serif;
    text-align: center;
}

@media (max-width: 700px) {
    .certificate-sample-toolbar {
        min-height: 62px;
        padding: 8px 10px;
        gap: 8px;
    }

    .certificate-sample-toolbar strong {
        font-size: 11px;
    }

    .certificate-sample-toolbar span {
        display: none;
    }

    .certificate-sample-toolbar-actions {
        gap: 5px;
    }

    .certificate-sample-toolbar-btn {
        min-height: 38px;
        padding: 7px 9px;
        font-size: 9px;
    }

    .certificate-sample-viewport {
        padding: 8px;
    }

    .sample-cert-sheet {
        width: min(
            1536px,
            calc(100vw - 16px),
            calc((100dvh - 114px) * 1.5)
        );
    }

    .certificate-sample-modal.is-zoomed .sample-cert-sheet {
        width: 180vw;
        max-width: none;
    }

    .certificate-sample-mobile-hint {
        display: block;
    }

    .final-actions .certificate-sample-open {
        flex: 1 1 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sample-cert-sheet {
        transition: none;
    }
}


/* =========================================================
   CERTIFICATE SAMPLE VISUAL FIX v2
   ========================================================= */

.sample-cert-watermark {
    display: none !important;
}

.sample-cert-badge {
    left: 80.2% !important;
    top: 3.6% !important;
    width: 15.8% !important;
    height: 4.9% !important;
    border-width: 1.5px !important;
    color: #f0bd58 !important;
    font-size: 1.02cqw !important;
    letter-spacing: .11em !important;
    background: rgba(7,17,30,.94) !important;
}

.sample-cert-owner {
    left: 11.0% !important;
    top: 39.5% !important;
    width: 31.5% !important;
    font-size: 1.22cqw !important;
    line-height: 1.05 !important;
}

.sample-cert-owner small {
    margin-top: .20cqw !important;
    font-size: .72cqw !important;
}

.sample-cert-coordinates {
    left: 11.0% !important;
    top: 49.0% !important;
    width: 31.5% !important;
    font-size: 1.18cqw !important;
}

.sample-cert-height {
    left: 11.0% !important;
    top: 57.35% !important;
    width: 31.5% !important;
    font-size: 1.18cqw !important;
}

.sample-cert-time-label {
    left: 10.55% !important;
    top: 63.35% !important;
    width: 31.5% !important;
    height: 2.35% !important;
    font-size: .86cqw !important;
}

.sample-cert-time {
    left: 11.0% !important;
    top: 66.05% !important;
    width: 32.6% !important;
    min-height: auto !important;
    display: block !important;
    font-size: .80cqw !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}

.sample-cert-time span,
.sample-cert-time small {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: #f5f1e8 !important;
}

.sample-cert-id {
    left: 11.0% !important;
    top: 74.05% !important;
    width: 32.5% !important;
    font-size: .61cqw !important;
    white-space: nowrap !important;
}

.sample-cert-qr {
    left: 4.55% !important;
    top: 80.7% !important;
    width: 9.8% !important;
}

@media (max-width: 700px) {
    .sample-cert-badge {
        font-size: 1.12cqw !important;
    }

    .sample-cert-owner {
        font-size: 1.28cqw !important;
    }

    .sample-cert-coordinates,
    .sample-cert-height {
        font-size: 1.22cqw !important;
    }

    .sample-cert-time {
        font-size: .86cqw !important;
    }

    .sample-cert-id {
        font-size: .64cqw !important;
    }
}


/* certificate-sample-visual-tuning-v2 */
.sample-cert-sheet {
    width: min(
        1660px,
        calc(100vw - 24px),
        calc((100dvh - 108px) * 1.53)
    );
}

.certificate-sample-modal.is-zoomed .sample-cert-sheet {
    width: min(1680px, 150vw);
}

.sample-cert-owner {
    font-size: 1.34cqw;
    line-height: 1.08;
}

.sample-cert-owner small {
    margin-top: .26cqw;
    font-size: .84cqw;
    line-height: 1.08;
}

.sample-cert-coordinates {
    font-size: 1.24cqw;
    line-height: 1.08;
}

.sample-cert-height {
    font-size: 1.24cqw;
    line-height: 1.08;
}

.sample-cert-time-label {
    font-size: .92cqw;
    letter-spacing: .015em;
}

.sample-cert-time {
    width: 31.2%;
    gap: .16cqw;
    font-size: .86cqw;
    line-height: 1.08;
}

.sample-cert-time small {
    font-size: .74cqw;
    line-height: 1.08;
}

.sample-cert-id {
    font-size: .64cqw;
    line-height: 1.08;
}

@media (max-width: 700px) {
    .sample-cert-sheet {
        width: min(
            1660px,
            calc(100vw - 10px),
            calc((100dvh - 110px) * 1.56)
        );
    }

    .certificate-sample-modal.is-zoomed .sample-cert-sheet {
        width: 190vw;
        max-width: none;
    }
}

