﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #ED7520;
    --primary-200: #ed75206e;
    --navy-2: #243660;
    --gold: #C9A84C;
    --gold-lt: #E8CC80;
    --green-500: #16a34a;
    --white: #FFFFFF;
    --slate: #c1c6cf;
    --bg: #F0F2F7;
    --radius: 12px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
p{
    margin:0;
}

/* ── Top bar ─────────────────────────────────────── */
.topbar {
    background: var(--primary);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo {
    font-family: 'Montserrat', sans-serif;
    color: var(--white);
    font-size: 1.15rem;
    letter-spacing: .02em;
}

.topbar-sep {
    color: var(--slate);
    font-size: .85rem;
}

.topbar-label {
    color: var(--navy-2);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Main layout ─────────────────────────────────── */
main {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    box-shadow: 1px 1px 12px -2px rgba(0, 0, 0, .25);
    border-radius: 12px
}

/* ── Left panel ──────────────────────────────────── */
.panel-info {
    background: #fffaf7;
    color: black;
    border-radius: var(--radius) 0 0 var(--radius);
    padding: 40px 36px;
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Seal */
.seal {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2.5px solid var(--green-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .seal-icon svg {
        width: 22px;
        height: 22px;
    }

.seal-text strong {
    display: block;
    color: var(--green-500);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.seal-text span {
    font-size: .75rem;
    color: #5a5b5d;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--navy-2);
}

/* Student name */
.student-block {
}

.label-tiny {
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--navy-2);
    margin-bottom: 6px;
}

.student-name {
    font-size: 1.55rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--primary);
}

/* Info rows */
.info-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
}

    .info-row .label-tiny {
        margin-bottom: 3px;
    }

.info-value {
    font-size: .92rem;
    color: var(--primary);
    font-weight: 500;
    line-height: 1.4;
}

    .info-value.gold {
        color: var(--gold-lt);
    }

/* Certificate ID */
.cert-id-block {
    background: var(--navy-2);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: auto;
    color: var(--white);
    text-align: center;
}

    .cert-id-block .label-tiny {
        margin-bottom: 4px;
        color: var(--white);
    }

.cert-id {
    font-size: .78rem;
    color: var(--slate);
    font-family: 'Courier New', monospace;
    letter-spacing: .04em;
    word-break: break-all;
}

/* ── Right panel ─────────────────────────────────── */
.panel-cert {
    flex: 1;
    background: #fff;
    border-radius: 0 var(--radius) var(--radius) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    gap: 16px;
}

/* Mode toggle */
.mode-toggle {
    align-self: flex-end;
    display: flex;
    gap: 6px;
}

.mode-btn {
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border: 1.5px solid #D0D5E0;
    border-radius: 20px;
    background: transparent;
    color: #8A97B0;
    cursor: pointer;
    transition: all .15s;
}

    .mode-btn.active {
        border-color: var(--primary);
        background: var(--primary);
        color: #fff;
    }

/* Certificate display */
.cert-display {
    width: 100%;
    flex: 1;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .cert-display img {
        max-width: 100%;
        max-height: 500px;
        object-fit: contain;
        border-radius: 6px;
        box-shadow: 0 4px 24px rgba(0,0,0,.12);
        display: none;
    }

    .cert-display iframe {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 6px;
        box-shadow: 0 4px 24px rgba(0,0,0,.12);
        display: none;
    }

        .cert-display img.visible,
        .cert-display iframe.visible {
            display: block;
        }

/* Placeholder (when no cert loaded) */
.cert-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #C0C7D6;
}

    .cert-placeholder svg {
        width: 64px;
        height: 64px;
        opacity: .4;
    }

    .cert-placeholder p {
        font-size: .85rem;
    }

    .cert-placeholder.hidden {
        display: none;
    }

/* Download link */
.download-link {
    align-self: flex-end;
    font-size: .78rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    opacity: .7;
    transition: opacity .15s;
}

    .download-link:hover {
        opacity: 1;
    }

    .download-link svg {
        width: 14px;
        height: 14px;
    }

/* ── Footer ──────────────────────────────────────── */
footer {
    text-align: center;
    padding: 20px;
    font-size: .73rem;
    color: #9BA4B8;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 780px) {
    main {
        flex-direction: column;
        margin: 20px auto;
        padding: 0 16px;
        gap: 0;
    }

    .panel-info {
        width: 100%;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 28px 24px;
        gap: 24px;
    }

    .cert-id-block {
        margin-top: 0;
    }

    .panel-cert {
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 28px 20px;
    }

    .cert-display iframe {
        height: 380px;
    }

    .student-name {
        font-size: 1.3rem;
    }
}
