.certificate-section {
    padding: 90px 5%;
    background: #fff;
}

.certificate-section .heading {
    max-width: 780px;
    margin: 0 auto 50px;
    text-align: center;
}

.certificate-section .heading > span {
    display: inline-block;
    margin-bottom: 10px;
    color: #c74500;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: inherit;
}

.certificate-section .heading h2 {
    margin: 0;
    color: #111;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
}

.certificate-section .heading h2 span { color: #ff5e14; font: inherit; letter-spacing: inherit; }

.certificate-section .heading p {
    margin-top: 18px;
    color: #666;
    font-size: 15px;
    line-height: 1.8;
    text-transform: none;
}

.certificate-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.certificate-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .06);
    overflow: hidden;
}

.certificate-card:hover { box-shadow: 0 15px 35px rgba(0, 0, 0, .12); }

.certificate-image {
    position: relative;
    display: block;
    height: 420px;
    border-radius: 7px;
    background: #f5f5f5;
    overflow: hidden;
}

.certificate-image img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
}

.certificate-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #000b49;
    color: #fff;
    font-size: 12px;
    text-transform: none;
}

.certificate-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
}

.certificate-image:hover .certificate-overlay,
.certificate-image:focus-visible .certificate-overlay { opacity: 1; }

.certificate-overlay > span {
    padding: 13px 18px;
    border-radius: 6px;
    background: #c74500;
    color: #fff;
    font-size: 14px;
}

.certificate-overlay i { margin-right: 6px; }

.certificate-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 0 5px;
    text-align: center;
}

.certificate-content h3 {
    margin-bottom: 8px;
    color: #111;
    font-size: 20px;
    line-height: 1.4;
}

.certificate-content p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.certificate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
}

.certificate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #c74500;
    border-radius: 5px;
    background: #c74500;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}

.certificate-button:hover { background: #a93b00; color: #fff; }
.certificate-download, .certificate-open-pdf { background: #fff; color: #b33d00; }

.certificate-section a:focus-visible,
.certificate-dialog :focus-visible { outline: 3px solid #000b49; outline-offset: 3px; }

.certificate-placeholder {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #c74500;
    font-size: 18px;
}

.certificate-placeholder i { font-size: 60px; }
html.certificate-preview-open, html.certificate-preview-open body { overflow: hidden; }

.certificate-dialog {
    width: min(1000px, calc(100% - 32px));
    max-width: none;
    height: 90vh;
    height: 90dvh;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #111;
    overflow: hidden;
}

.certificate-dialog:not([open]) { display: none; }
.certificate-dialog[open] { display: flex; flex-direction: column; }
.certificate-dialog::backdrop { background: rgba(0, 0, 0, .82); }

.certificate-dialog-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.certificate-dialog-header h2 { font-size: 20px; line-height: 1.4; }
.certificate-dialog-close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 5px;
    background: #f0f0f0;
    color: #111;
    font-size: 22px;
    cursor: pointer;
}

.certificate-dialog-close:hover { background: #e2e2e2; }
.certificate-dialog-toolbar {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
}

.certificate-dialog-toolbar p { color: #666; font-size: 13px; text-transform: none; }
.certificate-dialog-toolbar .certificate-actions { margin: 0; }
.certificate-dialog-pages {
    flex: 1;
    min-height: 0;
    padding: 20px;
    background: #e9e9e9;
    overflow: auto;
    overscroll-behavior: contain;
}

.certificate-page { margin: 0 auto 24px; max-width: 900px; }
.certificate-page:last-child { margin-bottom: 0; }
.certificate-page figcaption { margin-bottom: 8px; color: #444; font-size: 13px; text-transform: none; }
.certificate-page img { display: block; width: 100%; height: auto; background: #fff; }
.certificate-page-error { padding: 20px; background: #fff; color: #a33; font-size: 15px; text-transform: none; }

@media (max-width: 991px) {
    .certificate-section { padding: 75px 30px; }
    .certificate-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; }
    .certificate-section .heading h2 { font-size: 36px; }
}

@media (max-width: 575px) {
    .certificate-section { padding: 60px 18px; }
    .certificate-section .heading { margin-bottom: 35px; }
    .certificate-section .heading h2 { font-size: 29px; }
    .certificate-section .heading > span { font-size: 13px; }
    .certificate-container { grid-template-columns: minmax(0, 1fr); }
    .certificate-image { height: auto; aspect-ratio: 3 / 4; }
    .certificate-content h3 { font-size: 19px; }
    .certificate-dialog { width: calc(100% - 16px); height: 94vh; height: 94dvh; }
    .certificate-dialog-header { padding: 10px 12px; }
    .certificate-dialog-header h2 { font-size: 17px; }
    .certificate-dialog-toolbar { padding: 10px 12px; }
    .certificate-dialog-pages { padding: 12px 8px; }
}
