* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --pe-orange: #f23a09;
    --pe-orange-dark: #bf3e0d;
    --pe-black: #111318;
    --pe-ink: #2b313a;
    --pe-muted: #6b7280;
    --pe-line: #e2e6ea;
    --pe-bg: #f4f6f8;
    --pe-white: #ffffff;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--pe-bg);
    color: var(--pe-ink);
}

.public-hero {
    min-height: 244px;
    padding: 22px 10%;
    color: #fff;
    background:
        linear-gradient(rgba(17, 19, 24, 0.72), rgba(17, 19, 24, 0.72)),
        repeating-linear-gradient(112deg, rgba(242, 58, 9, 0.76) 0 38px, transparent 38px 170px),
        linear-gradient(135deg, #16191f, #3b414a);
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1060px;
    margin: 0 auto 58px;
}

.public-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.brand-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.brand-mini em {
    color: var(--pe-orange);
    font-style: normal;
}

.brand-dots {
    position: relative;
    width: 42px;
    height: 32px;
    display: inline-block;
}

.brand-dots::before,
.brand-dots::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: var(--pe-orange);
}

.brand-dots::before {
    width: 28px;
    height: 28px;
    left: 0;
    bottom: 0;
}

.brand-dots::after {
    width: 13px;
    height: 13px;
    right: 0;
    top: 0;
}

.public-hero h1 {
    text-align: center;
    font-size: 2rem;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}

.validation-panel {
    max-width: 1060px;
    margin: -34px auto 56px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--pe-line);
    box-shadow: 0 10px 30px rgba(17, 19, 24, 0.08);
}

.verification-form {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 16px;
    align-items: center;
    max-width: 760px;
    margin: 0 auto;
}

.verification-form select,
.verification-form input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #ccd3dc;
    border-radius: 5px;
    background: #fff;
}

.verification-form select:focus,
.verification-form input:focus {
    outline: 2px solid rgba(242, 58, 9, 0.18);
    border-color: var(--pe-orange);
}

.btn-search {
    min-height: 42px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--pe-orange);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.btn-search:hover {
    background: var(--pe-orange-dark);
}

.form-help {
    margin: 12px 0 30px;
    text-align: center;
    color: var(--pe-muted);
    font-size: 0.92rem;
}

.alert {
    padding: 14px 16px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 700;
}

.alert-error {
    color: #a42507;
    background: #fff0ed;
    border: 1px solid #ffc5b7;
}

.person-data,
.issued-certs {
    margin-top: 26px;
}

.person-data h2,
.issued-certs h2 {
    margin-bottom: 14px;
    font-weight: 500;
    color: #525a66;
}

.person-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 42px;
    max-width: 760px;
}

.person-grid p {
    line-height: 1.6;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 12px 9px;
    border-bottom: 1px solid var(--pe-line);
    text-align: left;
}

th {
    color: #1f2937;
    font-size: 0.82rem;
}

tbody tr:nth-child(odd) {
    background: #f4f4f4;
}

.btn-link {
    color: var(--pe-orange-dark);
    font-weight: 800;
    text-decoration: none;
}

.certificate-body {
    min-height: 100vh;
    padding: 28px;
    background: #d9dde2;
}

.certificate-body,
.certificate-sheet,
.certificate-sheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    forced-color-adjust: none;
}

.certificate-sheet {
    position: relative;
    width: 1120px;
    aspect-ratio: 1.414 / 1;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 34px rgba(17, 19, 24, 0.22);
}

.certificate-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
}

.ribbon {
    position: absolute;
    z-index: 1;
    transform: skewX(-22deg);
    display: none;
}

.ribbon-left-a {
    left: -58px;
    top: -50px;
    width: 110px;
    height: 580px;
    background: linear-gradient(#ff8a72, var(--pe-orange));
}

.ribbon-left-b {
    left: 52px;
    top: -65px;
    width: 108px;
    height: 360px;
    background: var(--pe-orange-dark);
}

.ribbon-left-c {
    left: 72px;
    top: 135px;
    width: 105px;
    height: 462px;
    background: rgba(255, 157, 170, 0.28);
}

.ribbon-right-a {
    right: -58px;
    bottom: -40px;
    width: 124px;
    height: 590px;
    background: linear-gradient(var(--pe-orange), var(--pe-orange-dark));
}

.ribbon-right-b {
    right: 118px;
    top: 196px;
    width: 104px;
    height: 380px;
    background: rgba(255, 157, 170, 0.34);
}

.ribbon-right-c {
    right: 24px;
    top: 236px;
    width: 72px;
    height: 300px;
    background: rgba(191, 62, 13, 0.65);
}

.seal {
    position: absolute;
    z-index: 2;
    left: 290px;
    top: 68px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff3bd 0 30%, #bd8427 31% 58%, #f4d283 60% 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
    display: none;
}

.seal::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 58px;
    width: 16px;
    height: 58px;
    background: #e5b85e;
    transform: skewX(-18deg);
    box-shadow: 26px 4px 0 #dca94a;
}

.certificate-logo {
    position: absolute;
    z-index: 3;
    top: 56px;
    right: 252px;
    width: 210px;
    text-align: center;
}

.certificate-logo-svg {
    display: block;
    width: 100%;
    height: auto;
}

.certificate-logo em {
    color: var(--pe-orange);
    font-style: normal;
}

.certificate-logo small {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.logo-bubbles {
    height: 40px;
    position: relative;
}

.logo-bubbles span {
    position: absolute;
    border-radius: 50%;
    background: var(--pe-orange);
}

.logo-bubbles span:nth-child(1) {
    width: 34px;
    height: 34px;
    left: 50px;
    bottom: 0;
}

.logo-bubbles span:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 92px;
    top: 0;
}

.logo-bubbles span:nth-child(3) {
    width: 12px;
    height: 12px;
    left: 124px;
    top: 16px;
}

.certificate-content {
    position: relative;
    z-index: 3;
    width: 700px;
    margin: 150px auto 0;
    text-align: center;
}

.certificate-content h1 {
    margin-bottom: 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    letter-spacing: 0.06em;
    color: #000;
}

.certificate-content .intro {
    margin-bottom: 24px;
    letter-spacing: 0.12em;
    font-size: 14px;
}

.certificate-content h2 {
    margin-bottom: 34px;
    font-size: 30px;
    font-weight: 500;
    color: #16191f;
}

.certificate-content p {
    margin-bottom: 16px;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.certificate-content .description {
    max-width: 560px;
    margin: 0 auto 18px;
    line-height: 1.45;
}

.signature-block {
    position: relative;
    z-index: 3;
    width: 520px;
    height: 150px;
    margin: 2px auto 0;
    text-align: center;
}

.signature-block img {
    display: block;
    width: 235px;
    height: auto;
    margin: 0 auto;
    background: transparent;
}

.signature-line {
    height: 1px;
    background: #b6b6b6;
    margin-top: 2px;
    margin-bottom: 8px;
}

.signature-block strong,
.signature-block span {
    display: block;
    font-size: 12px;
    line-height: 1.25;
}

.certificate-qr {
    position: absolute;
    right: 74px;
    bottom: 52px;
    z-index: 4;
    width: 126px;
    text-align: center;
    color: #1f2937;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.certificate-qr img {
    display: block;
    width: 116px;
    height: 116px;
    margin: 0 auto 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid #d9dde2;
}

.certificate-code {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 3;
    text-align: center;
    color: #6f7782;
    font-size: 12px;
}

.print-button {
    display: block;
    margin: 20px auto 0;
    padding: 11px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--pe-orange);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.certificate-error {
    max-width: 520px;
    margin: 80px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 900px) {
    .public-hero {
        padding: 18px 22px;
    }

    .verification-form,
    .person-grid {
        grid-template-columns: 1fr;
    }

    .validation-panel {
        margin: -28px 14px 32px;
        padding: 20px;
    }

    .certificate-body {
        padding: 10px;
        overflow-x: auto;
    }

    .certificate-sheet {
        transform-origin: top left;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    html,
    body {
        width: 296mm;
        height: 209mm;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #fff;
    }

    body.certificate-body {
        min-height: auto;
        width: 296mm;
        height: 209mm;
        margin: 0;
        padding: 0;
        background: #fff;
        overflow: hidden;
    }

    .certificate-sheet {
        width: 296mm;
        height: 209mm;
        margin: 0;
        aspect-ratio: auto;
        box-shadow: none;
        page-break-after: avoid;
        break-after: avoid-page;
        page-break-inside: avoid;
        break-inside: avoid;
        overflow: hidden;
    }

    .print-button {
        display: none;
    }
}
