@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* ================= FORM ================= */

.acush-portal-wrap {
    font-family: 'Poppins', sans-serif;
    max-width: 860px;
    margin: auto;
}

/* ================= FORM (RESTORED) ================= */

.acush-form-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.acush-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.acush-form-header img {
    width: 60px;
}

.acush-academy-name {
    font-size: 20px;
    font-weight: 700;
    color: #3C4A94;
    margin: 0;
}

.acush-academy-sub {
    font-size: 12px;
    margin: 0;
}

.acush-form-title {
    text-align: center;
    font-weight: 600;
    color: #3C4A94;
    margin: 15px 0;
}

/* RADIO */

.radio-buttons {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-buttons input {
    margin-right: 5px;
}

/* GRID */

.acush-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media(max-width:600px){
    .acush-form-row{
        grid-template-columns:1fr;
    }
}

/* INPUT */

.form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border-radius: 6px;
    border: none;
    background: #D4F7E8;
    font-weight: 600;
}

/* BUTTON */

.acush-submit-btn {
    width: 100%;
    padding: 12px;
    background: #2bae9a;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    border: none;
    margin-top: 10px;
}

.acush-submit-btn:hover {
    background: #239b8c;
}

/* ================= MODAL ================= */

#acush-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* overlay stays same */
.acush-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

/* 🔥 FIXED MODAL CONTAINER */
.acush-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    background: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* important */
}

/* 🔥 SCROLL ONLY CONTENT, NOT BUTTONS */
.acush-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.acush-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: red;
    color: #fff;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
}

/* ================= CERTIFICATE ================= */

.certificate {
    width: 780px;
    margin: 0 auto;
    border: 2px solid #000;
    padding: 0;
    background: #fff;
    position: relative;
}

/* INNER WRAPPER */
.certificate-inner {
    padding: 18px;
    width: 100%;
}

/* ================= HEADER ================= */

.header {
    text-align: center;
}

.header img {
    width: 200px;   /* 🔥 increase */
    margin-bottom: 6px;
}

.header h1 {
    font-size: 18px; /* 🔥 reduced */
    font-weight: 700;
    margin: 4px 0;
    color: #2d3884;
    letter-spacing: 1px;
}

.header p {
    font-size: 10px;
}

/* ================= TITLE ================= */

.title {
    text-align: center; /* 🔥 centered */
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0;
    color: #1f8f86;
}

.batch {
    text-align: center; /* 🔥 centered */
    font-size: 13px;
    margin-bottom: 10px;
}

/* ================= INFO GRID ================= */

.info {
    font-size: 12px;
    margin-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 40px;

    /* 🔥 THIS IS THE FIX */
    max-width: 600px;   /* controls width like Django */
    margin: 0 auto;     /* centers it */
}

.info-grid .col div {
    margin-bottom: 2px;
}

/* ================= TABLE ================= */

.marks-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11.5px;
}

/* COLUMN WIDTH CONTROL */
.marks-table th:nth-child(1),
.marks-table td:nth-child(1) {
    width: 90px;
}

.marks-table th:nth-child(2),
.marks-table td:nth-child(2) {
    width: 45%; /* 🔥 subject wider */
    text-align: left;
}

.marks-table th:nth-child(3),
.marks-table td:nth-child(3),
.marks-table th:nth-child(4),
.marks-table td:nth-child(4),
.marks-table th:nth-child(5),
.marks-table td:nth-child(5),
.marks-table th:nth-child(6),
.marks-table td:nth-child(6) {
    width: 11%;
}

/* CELLS */
.marks-table th {
    background: #2bae9a;
    color: #fff;
}

.marks-table th,
.marks-table td {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
    word-wrap: break-word;
}

/* SUBJECT TEXT */
.marks-table td:nth-child(2) {
    text-align: left;
    white-space: normal;
    line-height: 1.3;
}

/* ALTERNATING COLORS */
.marks-table tbody tr:nth-child(odd) td {
    background: #d6f0e6;
}

.marks-table tbody tr:nth-child(even) td {
    background: #ffffff;
}

/* ================= WATERMARK ================= */

.certificate::after {
    content: "";
    position: absolute;
    top: 58%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: url('../images/logo.png') no-repeat center;
    background-size: contain;
    opacity: 0.08;
    pointer-events: none;
}

/* ================= RESULT ================= */

.result-text {
    font-size: 12px;
    margin-top: 6px;
    text-align: left;
}

/* ================= FOOTER ================= */

.footer-text {
    text-align: center;
    font-size: 10px;
    margin-top: 6px;
}

/* ================= PRINT BUTTON ================= */

.actions {
    text-align: center;
    margin-top: 12px;
}

.btnM {
    background: #2bae9a;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ================= PRINT ================= */

@media print {

    body * {
        visibility: hidden;
    }

    #acush-modal,
    #acush-modal * {
        visibility: visible;
    }

    #acush-modal {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: #fff;
    }

    .acush-modal-overlay,
    .acush-modal-close,
    .actions {
        display: none !important;
    }

    .acush-modal-content {
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }

    .acush-modal-body {
        overflow: visible;
        padding: 0;
    }

    .certificate {
        margin: 20px auto;
        width: 780px;
        border: 2px solid #000;
        page-break-inside: avoid;
    }

    /* 🔥 ENSURE COLORS PRINT */
    .marks-table th {
        background: #2bae9a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .marks-table tbody tr:nth-child(odd) td {
        background: #d6f0e6 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

}