/* Shared certificate page for every course, layered on sales2-certificate.css:
   skills, verification QR, the sample mark, owner tools, the public banner and the
   hh.ru helper. Sizes inside the sheet stay in cqw so it scales like an image. */

/* ── Sheet: room for skills ─────────────────────────────── */
.cert { padding: 4.6cqw 6.2cqw 3cqw; }
.cert-title { font-size: 4.4cqw; }
.cert-ribbon { margin: 1cqw 0 1.1cqw; font-size: 1.2cqw; }
.cert-confirm, .cert-lead { font-size: 1.3cqw; }
.cert-name { font-size: 4.3cqw; margin: .5cqw 0 .6cqw; }
.cert-name::after { margin-top: .8cqw; }
.cert-course { font-size: 2.3cqw; }
.cert-stats { margin-top: 1.5cqw; }
.cert-stat { padding: .8cqw 1.5cqw; min-width: 14cqw; }
.cert-stat strong { font-size: 2.1cqw; }

.cert-skills { margin-top: 1.4cqw; width: 84%; }
.cert-skills-title {
    display: block;
    margin-bottom: .7cqw;
    font-size: .95cqw;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}
.cert-skills-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5cqw 2.4cqw;
    text-align: left;
}
.cert-skills-list.is-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5cqw 1.8cqw; }
.cert-skills-list li {
    display: flex;
    align-items: baseline;
    gap: .7cqw;
    padding-bottom: .45cqw;
    border-bottom: .08cqw solid var(--line);
    font-size: 1.15cqw;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}
.cert-skills-list li span { flex: 1; }
.cert-skills-list i {
    flex: none;
    font-style: normal;
    font-weight: 800;
    color: var(--metal-2);
}
.cert-skills-list b { flex: none; font-weight: 800; color: var(--accent); }

/* ── Footer: date + honour | seal | verification QR ─────── */
.cert-foot { margin-top: 1.2cqw; }
.cert-foot .cert-honor {
    margin: .35cqw 0 0;
    text-align: left;
    font-size: 1.25cqw;
}
.cert-verify { display: flex; align-items: flex-end; justify-content: flex-end; gap: 1.1cqw; }
.cert-verify-text strong { display: block; font-size: 1.05cqw; letter-spacing: .01em; overflow-wrap: anywhere; }
.cert-qr {
    flex: none;
    width: 7.4cqw;
    height: 7.4cqw;
    padding: .55cqw;
    border-radius: .6cqw;
    background: #fff;
    color: #111;
    line-height: 0;
}
.cert-qr svg { width: 100%; height: 100%; display: block; }
.lvl-expert .cert-qr { box-shadow: 0 0 0 .12cqw rgba(227, 192, 109, .7); }

/* Sample certificates carry a clear mark */
.cert-sample-mark {
    position: absolute;
    left: 82%;
    top: 19%;
    z-index: 2;
    transform: translate(-50%, -50%) rotate(-12deg);
    padding: .5cqw 1.8cqw;
    border: .25cqw solid rgba(201, 72, 52, .5);
    border-radius: .8cqw;
    font: 800 3cqw/1 var(--sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(201, 72, 52, .55);
    pointer-events: none;
}

/* ── Owner tools ────────────────────────────────────────── */
.tools-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-hh {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #d6001c;
    color: #fff;
    font: 700 15px var(--sans);
    cursor: pointer;
    white-space: nowrap;
}
.tools-verify { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: #3e4a4c; }
.lvl-expert .tools-verify { color: #d8cfb5; }
.tools-verify-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tools-verify a { font-weight: 700; color: inherit; overflow-wrap: anywhere; }
.tools-copy, .hh-copy {
    flex: none;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #b9b2a4;
    border-radius: 8px;
    background: #fff;
    color: #192326;
    font: 700 13px var(--sans);
    cursor: pointer;
}
.tools-copy.is-done, .hh-copy.is-done { background: #11695f; border-color: #11695f; color: #fff; }

/* ── Banners: public verification and samples ───────────── */
.banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    max-width: 1140px;
    margin: 18px auto 0;
    padding: 18px 22px;
    border-radius: 16px;
    background: #fff;
    color: #192326;
    box-shadow: 0 6px 24px rgba(20, 24, 30, .1);
    font-size: 15px;
}
.lvl-expert .banner { background: #171c38; color: #f5ecd3; box-shadow: 0 0 0 1px rgba(201, 162, 74, .35); }
.banner-text { flex: 1 1 420px; min-width: 0; }
.banner-text strong { display: block; font-size: 18px; }
.banner-text p { margin: 4px 0 0; line-height: 1.5; opacity: .82; }
.banner-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #11695f;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}
.banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.banner-link {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    border: 1px solid currentColor;
    border-radius: 10px;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}
.banner-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.banner-tabs a {
    padding: 7px 14px;
    border: 1px solid rgba(25, 35, 38, .25);
    border-radius: 999px;
    color: inherit;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}
.lvl-expert .banner-tabs a { border-color: rgba(245, 236, 211, .35); }
.banner-tabs a[aria-current="page"] { background: #192326; border-color: #192326; color: #fff; }
.lvl-expert .banner-tabs a[aria-current="page"] { background: #e3c06d; border-color: #e3c06d; color: #1a1305; }
.banner :focus-visible, .hh :focus-visible { outline: 3px solid #e0752c; outline-offset: 2px; }

/* ── Embedded preview on course pages ───────────────────── */
body.mode-embed { min-height: 0; background: transparent; overflow: hidden; }
.mode-embed .sheet { margin: 0; padding: 0; max-width: none; }
.mode-embed .cert { box-shadow: none; }

/* ── hh.ru helper ───────────────────────────────────────── */
.hh {
    width: min(640px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 26px 26px 22px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #192326;
    font: 15px/1.5 var(--sans);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.hh::backdrop { background: rgba(10, 13, 28, .6); }
.hh h2 { margin: 0 36px 6px 0; font-size: 21px; line-height: 1.25; }
.hh-lead, .hh-note { margin: 0 0 12px; color: #4b5759; }
.hh-close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.hh-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1eee7; font-size: 22px; cursor: pointer; }
.hh-steps { margin: 0 0 10px; padding-left: 20px; }
.hh-steps li { margin-bottom: 4px; }
.hh-steps a { color: #d6001c; font-weight: 700; }
.hh-fields { margin: 0 0 14px; display: grid; gap: 8px; }
.hh-fields div { padding: 10px 12px; border-radius: 10px; background: #f6f3ec; }
.hh-fields dt { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6a7476; }
.hh-fields dd { margin: 2px 0 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.hh-fields dd span, .hh-about span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hh-about { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f6f3ec; font-size: 14px; }
.hh-go {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    margin-top: 16px;
    border-radius: 12px;
    background: #d6001c;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

/* ── Not found ──────────────────────────────────────────── */
.missing { max-width: 560px; margin: 12vh auto; padding: 0 20px; text-align: center; font-size: 16px; line-height: 1.55; }
.missing h1 { font: 600 34px/1.2 var(--serif); margin: 16px 0 10px; }
.missing p { color: var(--muted); margin: 0 0 22px; }

@media print {
    .banner, .hh { display: none !important; }
    .cert-sample-mark { color: rgba(201, 72, 52, .38); }
    .cert-qr { box-shadow: none; }
}
@media (max-width: 640px) {
    .tools-actions { width: 100%; }
    .tools-actions button { flex: 1 1 auto; }
    .banner { margin: 12px 10px 0; padding: 16px; }
    .banner-actions { width: 100%; }
    .hh { padding: 22px 16px 18px; }
    .hh-fields dd, .hh-about { flex-wrap: wrap; }
}

/* ── Course art: every course has its own medallion, motto and engraving ── */
.cert-engraving {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    fill: none;
    stroke: var(--metal-2);
    stroke-width: .7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .2;
    /* keep the name, course and results area clean */
    -webkit-mask: radial-gradient(ellipse 34% 44% at 50% 50%, transparent 0 55%, #000 100%);
    mask: radial-gradient(ellipse 34% 44% at 50% 50%, transparent 0 55%, #000 100%);
}
.cert-engraving .fine { stroke-width: .4; }
.cert-engraving .dash { stroke-width: .5; stroke-dasharray: 1.6 1.8; }
.cert-engraving .fill { fill: var(--metal-2); fill-opacity: .2; stroke-width: .3; }
.lvl-advanced .cert-engraving { stroke: var(--accent); opacity: .16; }
.lvl-advanced .cert-engraving .fill { fill: var(--accent); }
.lvl-expert .cert-engraving { opacity: .26; }

.cert-emblem {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 3.3cqw;
    width: 5.4cqw;
    height: 5.4cqw;
    transform: translateX(-50%);
    pointer-events: none;
}
.cert-emblem svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cert-emblem .emblem-plate { fill: var(--paper); stroke: var(--metal-2); stroke-width: 2.2; }
.cert-emblem .emblem-ring { fill: none; stroke: var(--metal-2); stroke-width: .7; stroke-dasharray: 1.2 1.6; }
.cert-emblem .emblem-icon { fill: none; stroke: var(--metal-3); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cert-emblem .emblem-icon .fine { stroke-width: 1.3; }
.cert-emblem .emblem-icon .dot { fill: var(--metal-3); stroke: none; }
.lvl-advanced .cert-emblem .emblem-icon { stroke: var(--accent); }
.lvl-advanced .cert-emblem .emblem-icon .dot { fill: var(--accent); }
.lvl-expert .cert-emblem .emblem-plate { fill: #121732; filter: drop-shadow(0 0 .8cqw rgba(227, 192, 109, .3)); }
.lvl-expert .cert-emblem .emblem-icon { stroke: var(--metal-1); }
.lvl-expert .cert-emblem .emblem-icon .dot { fill: var(--metal-1); }

/* the motto sits on the top frame line, like an engraved inscription */
.cert-motto {
    position: absolute;
    left: 50%;
    top: -3.56cqw;
    transform: translate(-50%, -50%);
    padding: 0 1.2cqw;
    background: var(--paper);
    font-size: .95cqw;
    font-weight: 800;
    letter-spacing: .26em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--metal-3);
}
.lvl-advanced .cert-motto { color: var(--accent); }
.lvl-expert .cert-motto { background: #242532; color: var(--metal-1); }
