/* ===== ATEX RMS FRONTEND & MARKSHEET CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

/* ---- Result Portal ---- */
.atex-result-portal { max-width: 680px; margin: 0 auto; font-family: 'Poppins', sans-serif; }
.atex-portal-header { text-align: center; padding: 32px 20px 20px; background: linear-gradient(135deg, #1e3a5f 0%, #2e6da4 100%); color: #fff; border-radius: 16px 16px 0 0; }
.atex-portal-logo { font-size: 52px; margin-bottom: 8px; }
.atex-portal-header h2 { margin: 0; font-size: 22px; font-weight: 700; }
.atex-portal-header p { margin: 4px 0 0; opacity: .85; font-size: 14px; }

.atex-result-form-card { background: #fff; padding: 32px; border-radius: 0 0 16px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.atex-result-form-card h3 { text-align: center; color: #1e3a5f; margin: 0 0 6px; font-size: 20px; }
.atex-form-subtitle { text-align: center; color: #888; font-size: 13px; margin: 0 0 24px; }

.atex-alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.atex-alert-error { background: #fdf0f0; border: 1px solid #f5c6c6; color: #c0392b; }
.atex-alert-success { background: #f0fdf4; border: 1px solid #a0e6b8; color: #27ae60; }

.atex-front-form-group { margin-bottom: 18px; }
.atex-front-form-group label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 7px; }
.atex-front-form-group input { width: 100%; padding: 12px 16px; border: 2px solid #e0e8f0; border-radius: 10px; font-family: 'Poppins', sans-serif; font-size: 14px; transition: border .2s; }
.atex-front-form-group input:focus { border-color: #2e6da4; outline: none; box-shadow: 0 0 0 3px rgba(46,109,164,.1); }

.atex-front-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #1e3a5f, #2e6da4); color: #fff; border: none; border-radius: 10px; font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.atex-front-btn:hover { opacity: .9; }

/* ---- Marksheet ---- */
.atex-marksheet-wrapper { max-width: 900px; margin: 0 auto; font-family: 'Poppins', sans-serif; padding: 20px; }

.atex-marksheet {
    border: 3px solid #1e3a5f;
    border-radius: 4px;
    padding: 0;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.atex-marksheet::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid #c8d8e8;
    pointer-events: none;
    z-index: 0;
}

.ms-header {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 16px;
    align-items: center;
    padding: 20px 28px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2e6da4 100%);
    color: #fff;
}
.ms-logo-img { width: 70px; height: 70px; object-fit: contain; border-radius: 50%; background: #fff; }
.ms-logo-placeholder { width: 70px; height: 70px; background: rgba(255,255,255,.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.ms-header-info { text-align: center; }
.ms-institute-name { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; margin: 0 0 4px; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.ms-affiliation { margin: 0 0 4px; font-size: 12px; opacity: .9; }
.ms-contact { margin: 0; font-size: 11px; opacity: .8; }
.ms-student-photo { width: 85px; height: 100px; object-fit: cover; border: 3px solid #fff; border-radius: 4px; }
.ms-photo-placeholder { width: 85px; height: 100px; background: rgba(255,255,255,.2); border: 2px dashed rgba(255,255,255,.5); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: rgba(255,255,255,.7); }

.ms-title-bar { background: #f0c040; text-align: center; padding: 10px; font-size: 14px; font-weight: 700; color: #1e3a5f; letter-spacing: 2px; text-transform: uppercase; position: relative; z-index: 1; }

.ms-student-info { padding: 18px 28px; position: relative; z-index: 1; }
.ms-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.ms-info-row { display: grid; grid-template-columns: 130px 12px 1fr; font-size: 13px; align-items: baseline; }
.ms-label { color: #555; font-weight: 500; }
.ms-colon { color: #555; }
.ms-value { color: #222; }

.ms-marks-table { width: 100%; border-collapse: collapse; position: relative; z-index: 1; }
.ms-marks-table thead tr { background: #1e3a5f; }
.ms-marks-table thead th { color: #fff; padding: 11px 12px; font-size: 12px; font-weight: 600; text-align: center; border: 1px solid #2e6da4; }
.ms-marks-table thead th:nth-child(3) { text-align: left; }
.ms-marks-table tbody td { padding: 9px 12px; font-size: 13px; text-align: center; border: 1px solid #dce8f0; }
.ms-marks-table tbody td:nth-child(3) { text-align: left; }
.ms-marks-table tbody tr:nth-child(even) { background: #f7faff; }
.ms-subject-name { font-weight: 500; }
.ms-grade { font-weight: 700; color: #1e3a5f; }
.ms-pass { color: #27ae60; font-weight: 700; }
.ms-fail { color: #e74c3c; font-weight: 700; }
.ms-total-row { background: #1e3a5f !important; }
.ms-total-row td { color: #fff !important; padding: 11px 12px !important; font-size: 13px !important; border-color: #2e6da4 !important; }

.ms-result-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 2px solid #1e3a5f; margin: 16px 28px; border-radius: 8px; overflow: hidden; position: relative; z-index: 1; }
.ms-summary-item { padding: 12px; text-align: center; border-right: 1px solid #1e3a5f; background: #f7faff; }
.ms-summary-item:last-child { border-right: none; }
.ms-sum-label { display: block; font-size: 11px; color: #666; font-weight: 500; margin-bottom: 4px; }
.ms-sum-value { display: block; font-size: 16px; font-weight: 700; color: #1e3a5f; }
.ms-grade-box { background: #1e3a5f; color: #fff !important; padding: 2px 12px; border-radius: 4px; }
.ms-result-pass { color: #27ae60 !important; }
.ms-result-fail { color: #e74c3c !important; }

.ms-grade-scale { padding: 10px 28px; font-size: 11px; color: #666; background: #f7faff; border-top: 1px dashed #dce8f0; text-align: center; position: relative; z-index: 1; }

.ms-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 28px 48px 16px; position: relative; z-index: 1; }
.ms-sig-block { text-align: center; }
.ms-sig-line { border-top: 1px solid #333; margin-bottom: 6px; }
.ms-sig-block p { font-size: 12px; color: #555; margin: 0; }

.ms-footer { background: #1e3a5f; color: rgba(255,255,255,.8); text-align: center; padding: 10px; font-size: 11px; position: relative; z-index: 1; }
.ms-footer p { margin: 2px 0; }
.ms-verify { color: #f0c040 !important; font-weight: 600; }

/* Action buttons */
.ms-action-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---- PRINT STYLES ---- */
@media print {
    body * { visibility: hidden; }
    #atex-marksheet-print, #atex-marksheet-print * { visibility: visible; }
    #atex-marksheet-print { position: absolute; left: 0; top: 0; width: 100%; }
    .no-print { display: none !important; }
    .atex-marksheet { border: 3px solid #1e3a5f !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 10mm; size: A4; }
}
