/* ===== Certificates & Company Profile (front-end) ===== */
.dm-certs { background: linear-gradient(180deg, #f7fafb 0%, #ffffff 100%); }

.dm-cert {
    height: 100%;
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(16, 33, 71, .06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.dm-cert:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(16, 33, 71, .12); border-color: rgba(221, 176, 35, .5); }

.dm-cert-preview {
    position: relative; display: block; width: 100%;
    padding: 22px 22px 0; border: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(221, 176, 35, .16), transparent 60%),
        linear-gradient(180deg, #f2f5f9, #e9eef5);
    height: 300px; overflow: hidden; cursor: zoom-in;
}
.dm-cert-preview canvas {
    display: block; margin: 0 auto;
    width: auto; max-width: 100%; height: 100%;
    background: #fff;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 10px 30px rgba(16, 33, 71, .18);
    object-fit: contain; object-position: top;
    opacity: 0; transition: opacity .4s ease, transform .35s ease;
    transform-origin: top center;
}
.dm-cert-preview canvas.ready { opacity: 1; }
.dm-cert:hover .dm-cert-preview canvas { transform: scale(1.03); }
.dm-cert-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    color: #6b7486; font-size: 14px;
}
.dm-cert-zoom {
    position: absolute; bottom: 14px; inset-inline-end: 14px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bs-dark, #102147); color: #fff;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(6px); transition: .25s ease;
}
.dm-cert:hover .dm-cert-zoom { opacity: 1; transform: none; }

.dm-cert-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.dm-cert-std {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(221, 176, 35, .14); color: #9a780b;
    font-weight: 700; font-size: 13px; letter-spacing: .3px;
    padding: 5px 12px; border-radius: 999px;
}
.dm-cert-title { font-size: 1.2rem; margin: 14px 0 8px; color: var(--bs-dark, #102147); line-height: 1.45; }
.dm-cert-desc { color: #6b7486; font-size: .93rem; margin-bottom: 14px; }
.dm-cert-meta { list-style: none; padding: 0; margin: 0 0 18px; border-top: 1px dashed #e3e8ef; }
.dm-cert-meta li {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed #e3e8ef; font-size: .9rem;
}
.dm-cert-meta span { color: #8a93a5; }
.dm-cert-meta strong { color: var(--bs-dark, #102147); font-weight: 600; }
.dm-cert-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dm-cert-actions .btn { padding: 9px 18px; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.dm-cert-verify { color: #16a34a; text-decoration: none; font-weight: 600; }
.dm-cert-verify:hover { color: #15803d; }

/* ----- Company profile ----- */
.dm-profile { background: #fff; }
.dm-profile-box {
    position: relative; overflow: hidden;
    border-radius: 28px;
    padding: 56px 56px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(221, 176, 35, .28), transparent 40%),
        radial-gradient(circle at 10% 100%, rgba(255, 255, 255, .07), transparent 45%),
        linear-gradient(135deg, #102147 0%, #0b1833 100%);
    box-shadow: 0 30px 60px rgba(16, 33, 71, .25);
}
.dm-profile-box::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 36px 36px; pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.dm-profile-box > .row { position: relative; z-index: 1; }
.dm-profile-eyebrow { color: var(--bs-primary, #DDB023); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; font-size: .9rem; }
.dm-profile-title { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: 10px 0 16px; }
.dm-profile-text { color: rgba(255, 255, 255, .75); font-size: 1.05rem; max-width: 560px; }
.dm-profile-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dm-profile-chips span {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
    font-size: .88rem; color: rgba(255, 255, 255, .85);
}
.dm-profile-chips i { color: var(--bs-primary, #DDB023); }
.dm-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.dm-btn-ghost:hover, .dm-btn-ghost:focus { background: #fff; color: #102147; border-color: #fff; }
.dm-profile .btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.dm-profile-cover {
    position: relative; display: block;
    width: 100%; max-width: 330px; margin: 0 auto;
    aspect-ratio: 1 / 1.414;
    border: 0; padding: 0; background: none; cursor: zoom-in;
}
.dm-profile-page, .dm-profile-sheet {
    position: absolute; inset: 0;
    border-radius: 10px; overflow: hidden;
}
.dm-profile-page { background: #fff; box-shadow: 0 25px 50px rgba(0, 0, 0, .35); transform: rotate(-3deg); transition: transform .35s ease; }
.dm-profile-sheet { background: #fff; opacity: .16; }
.dm-profile-sheet.s1 { transform: rotate(3deg) translate(10px, 6px); }
.dm-profile-sheet.s2 { transform: rotate(7deg) translate(20px, 12px); opacity: .08; }
.dm-profile-cover:hover .dm-profile-page { transform: rotate(0) scale(1.02); }
.dm-profile-page canvas { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .4s; }
.dm-profile-page canvas.ready { opacity: 1; }

@media (max-width: 991.98px) {
    .dm-profile-box { padding: 36px 24px; border-radius: 20px; }
    .dm-profile-cover { max-width: 240px; }
}

/* ----- Viewer modal ----- */
.dm-viewer .modal-content { background: #1b2130; border: 0; border-radius: 16px; overflow: hidden; }
.dm-viewer-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #102147; color: #fff;
}
.dm-viewer-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-viewer-tools { display: flex; align-items: center; gap: 6px; }
.dm-viewer-count { font-size: .85rem; color: rgba(255, 255, 255, .7); margin-inline-end: 6px; white-space: nowrap; }
.dm-vbtn {
    width: 38px; height: 38px; border-radius: 10px; border: 0;
    background: rgba(255, 255, 255, .08); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.dm-vbtn:hover { background: var(--bs-primary, #DDB023); color: #102147; }
.dm-viewer-body {
    height: calc(100vh - 140px);
    overflow: auto; padding: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    direction: ltr;
}
.dm-viewer-page {
    position: relative; background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    border-radius: 4px; flex-shrink: 0;
}
.dm-viewer-page canvas { display: block; width: 100%; height: 100%; }
.dm-viewer-page .spinner-border { position: absolute; top: 50%; left: 50%; margin: -12px; color: #b9c0cf; }
@media (max-width: 767.98px) {
    .dm-viewer .modal-content { border-radius: 0; }
    .dm-viewer-body { height: calc(100vh - 62px); padding: 10px; }
    .dm-viewer-count { display: none; }
}
