﻿.enrollment-page {
    padding: 35px 15px;
    background: #f3f6f9;
    min-height: 70vh;
}

.enrollment-page-heading {
    text-align: center;
    margin-bottom: 25px;
}

    .enrollment-page-heading h1 {
        color: #153e75;
        font-weight: 800;
    }

.verify-box {
    max-width: 650px;
    margin: 0 auto 30px;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,.08);
}

    .verify-box h2 {
        color: #153e75;
        margin-bottom: 18px;
    }

.verify-input {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccd5df;
    border-radius: 5px;
    box-sizing: border-box;
}

.action-btn {
    display: inline-block;
    border: 0;
    padding: 11px 20px;
    border-radius: 5px;
    color: #fff;
    background: #153e75;
    cursor: pointer;
    margin: 4px;
    font-size: 14px;
}

    .action-btn:hover {
        background: #0b2a54;
        color: #fff;
    }

.enrollment-message {
    display: block;
    margin-top: 12px;
    line-height: 1.6;
}

    .enrollment-message.success {
        color: #167044;
    }

    .enrollment-message.error {
        color: #b42332;
    }

/* Certificate canvas */
.certificate {
    position: relative;
    width: 100%;
    max-width: 1024px;
    aspect-ratio: 1024 / 1447;
    margin: 25px auto;
    overflow: hidden;
    background-color: #fff;
    background-image: url('/images/SKTI-Certificate.jpg');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

    .certificate * {
        box-sizing: border-box;
    }

.cert-field {
    position: absolute;
    z-index: 3;
    color: #363636;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    line-height: 1.25;
}

.cert-number {
    top: 2.1%;
    left: 1.5%;
    width: 35%;
    color: #fff;
    font-size: clamp(9px, 1.8vw, 18px);
    white-space: nowrap;
}

.cert-reg-number {
    top: 2.1%;
    right: 3%;
    width: 29%;
    text-align: right;
    font-size: clamp(9px, 1.8vw, 20px);
    white-space: nowrap;
}

/* QR code */
.cert-qr {
    position: absolute;
    z-index: 4;
    left: 7%;
    top: 30.5%;
    width: 18%;
    padding: 5px;
    background: #fff;
    text-align: center;
}

    .cert-qr img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .cert-qr small {
        display: block;
        margin-top: 4px;
        color: #153e75;
        font-size: clamp(5px, .9vw, 11px);
        font-weight: 700;
    }

/* Optional student photo area */
.cert-photo {
    position: absolute;
    z-index: 4;
    top: 30.5%;
    right: 7%;
    width: 15%;
    aspect-ratio: 3 / 4;
    background: #fff;
    border: 1px solid #d4d4d4;
    overflow: hidden;
}

    .cert-photo img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

/* Student detail rows */
.cert-details {
    position: absolute;
    z-index: 3;
    left: 11.5%;
    top: 50.7%;
    width: 86%;
    height: 24%;
}

.cert-row {
    position: absolute;
    left: 0;
    width: 100%;
    min-height: 35px;
    display: flex;
    align-items: flex-end;
    color: #363636;
    font-size: clamp(10px, 1.8vw, 21px);
    line-height: 1.3;
}

.cert-row-label {
    flex: 0 0 auto;
    margin-right: 7px;
    white-space: nowrap;
    font-family: Georgia, "Times New Roman", serif;
    font-size: inherit;
    font-weight: 400;
}

.cert-row-value {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 31px;
    padding: 0 5px 3px;
    border-bottom: 1px solid #383838;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(11px, 1.9vw, 22px);
    line-height: 1.25;
    font-weight: 700;
    color: #153477;
    overflow-wrap: anywhere;
}

.cert-row-rollno {
    top: 1%;
}

.cert-row-name {
    top: 15%;
}

.cert-row-father {
    top: 30%;
}

.cert-row-completion {
    top: 45%;
}

.cert-row-course {
    top: 60%;
}

.cert-grade-row {
    position: absolute;
    left: 14%;
    top: 70%;
    width: 49%;
    display: flex;
    align-items: flex-end;
    z-index: 3;
}

.cert-grade-label {
    flex: 0 0 auto;
    margin-right: 7px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(10px, 1.8vw, 21px);
    color: #363636;
    white-space: nowrap;
}

.cert-grade-value {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 5px 3px;
    border-bottom: 1px solid #383838;
    text-align: center;
    font-size: clamp(11px, 2vw, 23px);
    font-weight: 800;
    color: #153477;
}

.cert-issue-date {
    position: absolute;
    z-index: 3;
    top: 81%;
    left: 42%;
    width: 22%;
    text-align: center;
    font-size: clamp(9px, 1.6vw, 19px);
    font-weight: 700;
    color: #363636;
    white-space: nowrap;
}

.certificate-actions {
    text-align: center;
    margin: 20px auto 35px;
}

/* Print only the certificate */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html, body {
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

        body * {
            visibility: hidden !important;
        }

    #certificateArea,
    #certificateArea * {
        visibility: visible !important;
    }

    #certificateArea {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .verify-box,
    .enrollment-page-heading,
    .certificate-actions {
        display: none !important;
    }
}

