:root {
    color-scheme: dark;
    --bg: #05070d;
    --surface: #0d1220;
    --surface-2: #111827;
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --green: #22c55e;
    --red: #ef4444;
    --purple: #7c3aed;
    --blue: #0a66c2;
    --gold: #fbbf24;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(124, 58, 237, 0.26), transparent 32rem),
        radial-gradient(circle at 84% 14%, rgba(251, 191, 36, 0.12), transparent 24rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.page {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 40px 0;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 26px;
    text-align: left;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--purple), #a855f7);
    font-weight: 950;
    letter-spacing: -0.05em;
    box-shadow: 0 18px 45px rgba(124, 58, 237, 0.35);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 4vw, 42px); line-height: 1; }

.search-card,
.status-card,
.details-card,
.empty-card,
.certificate-wrap {
    border: 1px solid var(--border);
    background: rgba(13, 18, 32, 0.78);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.search-card {
    display: grid;
    gap: 10px;
    margin: 0 auto 20px;
    padding: 18px;
    border-radius: 18px;
}

.search-card label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #070b14;
    color: var(--text);
    padding: 13px 14px;
    font: inherit;
    font-weight: 800;
}

button {
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--purple), #a855f7);
    color: white;
    padding: 13px 18px;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
}

.status-card {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 18px;
}

.status-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-weight: 950;
}

.is-valid {
    border-color: rgba(34, 197, 94, 0.35);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(13, 18, 32, 0.86)),
        rgba(13, 18, 32, 0.9);
}
.is-valid .status-icon { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.is-invalid { border-color: rgba(239, 68, 68, 0.35); }
.is-invalid .status-icon { background: rgba(239, 68, 68, 0.16); color: var(--red); }
.status-card h2 { margin: 0 0 4px; font-size: 18px; }
.status-card p { margin: 0; color: var(--muted); font-size: 13px; }
.is-valid h2 { color: #86efac; }

.certificate-wrap {
    padding: clamp(12px, 2vw, 22px);
    border-radius: 22px;
    overflow: hidden;
}

.certificate-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1.414 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: #f8fafc;
    container-type: inline-size;
}

.certificate-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-bg {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 20px;
    background: linear-gradient(135deg, #f8fafc, #e0e7ff, #fef3c7);
    color: #111827;
    border: 10px solid #d4af37;
}

.fallback-bg span {
    font-size: 5cqw;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cert-field {
    position: absolute;
    transform: translateY(-50%);
    line-height: 1.15;
    user-select: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.cert-qr {
    transform: none;
    display: grid;
    place-items: start;
}

.cert-qr svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.details-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
    padding: 18px;
    border-radius: 18px;
}

.details-card span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.details-card strong {
    font-size: 14px;
}

.mono {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 47px;
    border-radius: 12px;
    padding: 13px 18px;
    color: white;
    font-weight: 950;
    text-decoration: none;
}

.linkedin {
    background: linear-gradient(135deg, var(--blue), #0f7bdc);
    box-shadow: 0 14px 35px rgba(10, 102, 194, 0.28);
}

.empty-card {
    padding: 32px;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 760px) {
    .page { padding: 24px 0; }
    .brand { justify-content: flex-start; }
    .search-row { grid-template-columns: 1fr; }
    .details-card { grid-template-columns: 1fr 1fr; }
}

@media print {
    body { background: white; }
    .brand, .search-card, .status-card, .details-card, .actions { display: none; }
    .page { width: 100%; padding: 0; }
    .certificate-wrap { border: 0; box-shadow: none; padding: 0; background: white; }
    .certificate-stage { border-radius: 0; box-shadow: none; }
}
