﻿:root {
    --brand: #0ea5e9;
    --brand-2: #22d3ee;
    --ink: #e6eef7;
    --muted: #a7b4c7;
    --paper: #0e1a28;
    --edge: #1e2b3c;
    --foil: #e6c457;
    --foil-2: #f5d277;
    --panel: #0f2133;
    --panel-2: #0b1a29;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    color: var(--ink);
    background-color: #2e363f;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    padding: clamp(8px, 2vw, 24px);
}

/* Container central */
.sheet {
    max-width: 1123px;
    margin: 0 auto
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 auto 16px auto;
    max-width: 1123px;
}

.btn {
    appearance: none;
    border: 1px solid var(--edge);
    background: #0f1b2a;
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(2,8,23,.35);
    transition: transform .1s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        border-color: var(--brand);
        box-shadow: 0 10px 26px rgba(2,8,23,.6)
    }

    .btn:active {
        transform: translateY(0)
    }

.btn-primary {
    border-color: transparent;
    background: linear-gradient(180deg, var(--brand-2), var(--brand));
    color: #031018;
    text-shadow: 0 1px 0 rgba(255,255,255,.25);
    min-width: 180px;
    height: 40px;
}

/* Certificado */
.certificate {
    position: relative;
    background: linear-gradient(160deg,var(--panel),var(--panel-2));
    border-radius: clamp(16px, 2.2vw, 28px);
    padding: clamp(20px, 5vw, 56px) clamp(20px, 5.5vw, 60px);
    box-shadow: 0 40px 120px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.03);
    overflow: hidden;
}

/* Ornamentos “foil” nos cantos */
.foil-corner {
    position: absolute;
    width: clamp(120px, 28vw, 220px);
    height: clamp(120px, 28vw, 220px);
    pointer-events: none;
    opacity: .24;
    filter: blur(0.2px);
    background: conic-gradient(from 210deg, var(--foil), var(--foil-2), #fff0 65%);
    mix-blend-mode: screen;
}

    .foil-corner.tl {
        top: -50px;
        left: -50px;
        border-radius: 0 0 180px 0
    }

    .foil-corner.br {
        right: -50px;
        bottom: -50px;
        border-radius: 180px 0 0 0
    }

.watermark-text {
    position: absolute;
    inset: auto -10% -14% auto;
    font-family: "Cinzel Decorative", "Playfair Display", serif;
    font-weight: 900;
    letter-spacing: .2em;
    font-size: clamp(64px, 22vw, 160px);
    opacity: .035;
    color: #fff;
    transform: rotate(-12deg);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* Cabeçalho / marca */
.header {
    justify-content: center;
    margin-bottom: 28px;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px
}

    .brand img {
        height: clamp(28px, 5vw, 44px);
        object-fit: contain;
        filter: drop-shadow(0 2px 6px rgba(2,8,23,.4));
    }

.brand-name {
    font-weight: 800;
    letter-spacing: .3px;
    font-size: 18px;
    text-transform: uppercase;
    color: var(--muted)
}

.ribbon {
    margin-left: 8px;
    background: linear-gradient(90deg,rgba(255,255,255,.08),rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.08);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: clamp(10px, 2.4vw, 12px);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
    white-space: nowrap;
}

/* Título e subtítulo */
.title {
    font-family: "Cinzel Decorative","Playfair Display",serif;
    font-size: clamp(28px, 6vw, 48px);
    line-height: 1.12;
    margin: 8px 0 6px 0;
    letter-spacing: .5px;
    background: linear-gradient(180deg,#fff, #f6e6a7 40%, #e5c65c 60%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 14px 40px rgba(245,210,119,.16);
    text-align: center;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 16px 0;
    font-size: clamp(13px, 2.8vw, 15px);
    text-align: center
}

/* Nome do participante em caligrafia */
.recipient {
    display: grid;
    justify-items: center;
    margin: 18px 0 22px 0
}

.recipient-name {
    font-family: "Great Vibes", cursive;
    font-size: clamp(34px, 10vw, 72px);
    line-height: 1.05;
    letter-spacing: .5px;
    color: #fff;
    text-align: center;
    text-wrap: balance;
    text-shadow: 0 14px 36px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.12);
}

/* Cartão interno (curso + metas) */
.panel {
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 20px;
    padding: clamp(16px, 4vw, 26px);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    box-shadow: 0 18px 44px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.02);
}

.course {
    font-size: clamp(15px, 3.6vw, 18px);
    margin: 6px 0 6px 0;
    color: var(--ink);
    letter-spacing: .3px;
    text-align: center;
}

.desc {
    color: var(--muted);
    margin: 0 0 14px 0;
    font-size: clamp(13px, 3.5vw, 15px);
    text-align: center;
    overflow-wrap: anywhere;
}

.course-name {
    color: #eaf2ff;
    font-size: clamp(20px, 6vw, 40px);
    font-weight: 700;
    letter-spacing: .2px;
    margin-bottom: 10px;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Metadados */
.meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

    .meta .item {
        border: 1px dashed rgba(255,255,255,.10);
        border-radius: 14px;
        padding: 12px 14px;
        min-height: 64px;
        background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
    }

    .meta .k {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: .25px;
        font-weight: 800;
    }

    .meta .v {
        font-weight: 800;
        color: #f0f6ff;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .meta .verify {
        display: flex;
        flex-direction: column;
        justify-content: center
    }

/* Assinatura + selo */
.footer {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin-top: 26px;
}

.signature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.sig-handwrite {
    font-family: "Allura", cursive;
    font-size: clamp(28px, 6.4vw, 40px);
    line-height: 1;
    color: #fff;
    opacity: .92;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.35));
    transform: translateY(6px);
}

.sig-line {
    width: clamp(160px, 40vw, 280px);
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
}

.sig-label {
    font-size: 12px;
    color: var(--muted)
}

.seal {
    border: 2px solid var(--foil);
    color: #2c1e04;
    background: radial-gradient(circle at 30% 30%, #fff4ce, #f5d277);
    border-radius: 999px;
    width: clamp(72px, 24vw, 120px);
    height: clamp(72px, 24vw, 120px);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .5px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 0 0 6px rgba(255,255,255,.35);
}

    .seal .seal-top {
        font-size: clamp(12px, 3.6vw, 16px);
        line-height: 1
    }

    .seal .seal-mid {
        font-size: clamp(10px, 3vw, 12px);
        opacity: .9
    }

    .seal .seal-year {
        font-size: clamp(9px, 2.8vw, 11px);
        margin-top: 6px;
        opacity: .9
    }

/* Rodapé */
.copyright {
    text-align: center;
    margin-top: 14px
}

/* QRCode (opcional futuro) */
.qrcode {
    width: 82px;
    height: 82px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.10);
    background: #0c1929;
    display: grid;
    place-items: center;
    overflow: hidden;
}

    .qrcode img {
        max-width: 100%;
        max-height: 100%;
        display: block
    }

/* ===== Breakpoints ===== */
@media (max-width: 900px) {
    .meta {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .footer {
        flex-direction: column;
        align-items: center;
        gap: 18px
    }

    .signature {
        align-items: center;
        text-align: center
    }
}

@media (max-width: 520px) {
    .meta {
        grid-template-columns: 1fr
    }

    .watermark-text {
        opacity: .025;
        transform: rotate(-10deg) translateY(8%);
    }

    .foil-corner {
        opacity: .18
    }
}

/* Impressão A4 */
@page {
    size: A4 landscape;
    margin: 16mm
}

@media print {
    body {
        background: #fff;
        color: #111;
        padding: 0
    }

    .toolbar {
        display: none !important
    }

    .certificate {
        background: #fff;
        color: #111;
        box-shadow: none;
        border-radius: 0;
        padding: 0
    }

    .foil-corner, .watermark-text {
        display: none
    }

    .panel {
        background: #fff;
        border-color: #ddd;
        box-shadow: none
    }

    .meta .item {
        background: #fff;
        border-color: #ccc
    }

    .sig-line {
        background: linear-gradient(90deg, transparent, #333, transparent)
    }

    .recipient-name {
        color: #111;
        text-shadow: none
    }

    a[href]:after {
        content: ""
    }
}

/* Acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.img-logo {
    width: 100%;
    margin-top:20px;
}