/* =========================================================
   NU Result Checker v6 — Mobile-first, compact design
   Primary: #1a56db blue scheme
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

#nurc-app {
    --nurc-primary:    #1a56db;
    --nurc-primary-dk: #1341b0;
    --nurc-danger:     #ef4444;
    --nurc-bg:         #f0f4ff;
    --nurc-card:       #ffffff;
    --nurc-border:     #dbe4f7;
    --nurc-text:       #1e293b;
    --nurc-muted:      #64748b;
    --nurc-radius:     12px;
    --nurc-shadow:     0 2px 16px rgba(26,86,219,.10);

    font-family: 'Inter', 'Hind Siliguri', sans-serif;
    color: var(--nurc-text);
    width: 100%;
    max-width: 780px;
    margin: 1rem auto;
    padding: 0 .75rem;
    box-sizing: border-box;
}
#nurc-app *, #nurc-app *::before, #nurc-app *::after { box-sizing: inherit; }

/* ── Header ─────────────────────────────────────── */
.nurc-header { text-align: center; margin-bottom: 1.2rem; }
.nurc-header-icon { font-size: 2rem; margin-bottom: .25rem; display: block; }
.nurc-title { font-size: 1.45rem; font-weight: 800; color: var(--nurc-primary); margin: 0 0 .2rem; letter-spacing: -.4px; }
.nurc-subtitle { font-family: 'Hind Siliguri', sans-serif; color: var(--nurc-muted); font-size: .9rem; margin: 0; }

/* ── Card ───────────────────────────────────────── */
.nurc-card {
    background: var(--nurc-card);
    border: 1.5px solid var(--nurc-border);
    border-radius: var(--nurc-radius);
    padding: 1.1rem 1rem;
    box-shadow: var(--nurc-shadow);
    margin-bottom: 1rem;
    animation: nurc-fadein .3s ease;
}
@keyframes nurc-fadein { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.nurc-section-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--nurc-muted); margin-bottom: .35rem;
    display: flex; align-items: center; gap: .35rem;
}
.nurc-section-label svg { flex-shrink: 0; }

/* ── Select ─────────────────────────────────────── */
.nurc-select {
    width: 100%; padding: .62rem .9rem; border: 1.5px solid var(--nurc-border);
    border-radius: 8px; font-size: .92rem; font-family: 'Inter', sans-serif;
    color: var(--nurc-text); background: #f8faff; outline: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231a56db' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
    padding-right: 2.2rem; cursor: pointer; margin-bottom: .8rem;
}
.nurc-select:focus { border-color: var(--nurc-primary); box-shadow: 0 0 0 3px rgba(26,86,219,.13); background-color: #fff; }

/* ── Tags ───────────────────────────────────────── */
.nurc-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.nurc-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .22rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.nurc-tag-blue  { background: #dbeafe; color: #1e40af; }
.nurc-tag-green { background: #d1fae5; color: #065f46; }

/* ── Form inputs ────────────────────────────────── */
.nurc-field { margin-bottom: .8rem; }
.nurc-label { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; color: var(--nurc-text); margin-bottom: .35rem; flex-wrap: wrap; }
.nurc-label svg { flex-shrink: 0; color: var(--nurc-primary); }
.nurc-label-sub { font-family: 'Hind Siliguri', sans-serif; font-size: .75rem; color: var(--nurc-muted); font-weight: 400; margin-left: auto; }
.nurc-input {
    width: 100%; padding: .62rem .9rem; border: 1.5px solid var(--nurc-border);
    border-radius: 8px; font-size: .92rem; font-family: 'Inter', sans-serif;
    color: var(--nurc-text); background: #f8faff; outline: none;
}
.nurc-input:focus { border-color: var(--nurc-primary); box-shadow: 0 0 0 3px rgba(26,86,219,.13); background: #fff; }
.nurc-input.nurc-inp-err { border-color: var(--nurc-danger); }

/* ── Captcha ────────────────────────────────────── */
.nurc-captcha-row { display: flex; align-items: stretch; gap: .5rem; }
.nurc-captcha-left { display: flex; flex-direction: column; gap: .4rem; flex: 0 0 48%; }
.nurc-captcha-img-wrap {
    position: relative; width: 100%; height: 50px; border-radius: 8px;
    overflow: hidden; background: #eef2ff; border: 1.5px solid var(--nurc-border);
    display: flex; align-items: center; justify-content: center;
}
#nurc-captcha-img { width: 100%; height: 100%; object-fit: fill; display: block; }
#nurc-captcha-loading { font-size: .75rem; color: var(--nurc-muted); }
.nurc-captcha-error { font-size: .75rem; color: var(--nurc-danger); }
.nurc-refresh-btn {
    background: var(--nurc-bg); border: 1.5px solid var(--nurc-border);
    border-radius: 8px; padding: .35rem .6rem; font-size: .76rem;
    color: var(--nurc-primary); cursor: pointer; font-family: 'Inter', sans-serif;
    font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
    gap: .3rem; width: 100%;
}
.nurc-captcha-input-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.nurc-captcha-input-wrap .nurc-input { height: 100%; min-height: 50px; }

/* ── Buttons ────────────────────────────────────── */
.nurc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem; background: var(--nurc-primary); color: #fff;
    border: 1.5px solid transparent; border-radius: 8px; padding: .65rem 1.2rem;
    font-size: .88rem; font-family: 'Inter', sans-serif; font-weight: 600;
    cursor: pointer; white-space: nowrap; text-decoration: none;
}
.nurc-btn svg { flex-shrink: 0; }
.nurc-btn:disabled { opacity: .6; cursor: not-allowed; }
.nurc-btn-outline { background: transparent; color: var(--nurc-primary); border-color: var(--nurc-primary); }
.nurc-btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }

/* ── Loading ────────────────────────────────────── */
#nurc-loading {
    display: flex; align-items: center; justify-content: center;
    gap: .75rem; padding: 1.5rem; color: var(--nurc-muted); font-size: .88rem;
}
.nurc-spinner {
    width: 22px; height: 22px; border: 3px solid var(--nurc-border);
    border-top-color: var(--nurc-primary); border-radius: 50%;
    animation: nurc-spin .75s linear infinite; flex-shrink: 0;
}
@keyframes nurc-spin { to { transform: rotate(360deg); } }

/* ── Error ──────────────────────────────────────── */
#nurc-error { text-align: center; padding: 1.2rem; }
#nurc-err-msg { color: var(--nurc-danger); font-weight: 600; margin-bottom: .8rem; }

/* ── Result area ────────────────────────────────── */
#nurc-app.nurc-wide { max-width: 840px; }
#nurc-result-body { display: none !important; }

.nurc-result-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: .5rem; padding: .7rem 0 .2rem; flex-wrap: wrap;
}
.nurc-pdf-busy { opacity: .7; cursor: not-allowed; }

/* ── Utilities ──────────────────────────────────── */
.nurc-hint { font-size: .74rem; color: var(--nurc-muted); margin-top: .35rem; }
.nurc-hide { display: none !important; }
.nurc-divider { border: none; border-top: 1px solid var(--nurc-border); margin: .75rem 0; }

/* ================================================================
   NU OFFICIAL RESULT SHEET — mobile-first responsive
   ================================================================ */

.nu-result-sheet {
    background: #fff;
    border: 1.5px solid #c2d0f0;
    font-family: Arial, 'Hind Siliguri', sans-serif;
    font-size: 13px;
    color: #111;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    animation: nurc-fadein .4s ease;
    box-shadow: 0 2px 14px rgba(26,86,219,.10);
    overflow-x: hidden;
}

/* Header */
.nu-sheet-header {
    background: #fff;
    text-align: center;
    padding: 14px 16px 10px;
    border-bottom: 3px solid #1a56db;
}
.nu-sheet-logo { width: 54px; height: 54px; margin: 0 auto 8px; display: block; }
.nu-sheet-org { font-size: 16px; font-weight: 700; color: #1a56db; letter-spacing: .3px; margin: 0 0 2px; }
.nu-sheet-type { font-size: 11.5px; color: #444; margin: 0; line-height: 1.5; }

/* Student info table */
.nu-info-wrap { padding: 10px 12px 4px; }
.nu-info-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #b0c0e8;
    table-layout: fixed;
}
.nu-info-table td {
    padding: 5px 9px;
    border: 1px solid #c8d6f0;
    font-size: 12px;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: break-word;
}
.nu-info-table td.nu-lbl {
    background: #eef3fc; font-weight: 700; color: #1a2e5a;
    width: 36%; white-space: normal;
}
.nu-info-table td.nu-lbl-sm {
    background: #eef3fc; font-weight: 700; color: #1a2e5a;
    width: 28%; white-space: normal;
}
.nu-info-table td.nu-val { font-weight: 500; color: #111; }

.nu-result-badge {
    display: inline-block; background: #dbeafe; color: #1e40af;
    font-size: 11px; font-weight: 700; padding: 2px 10px;
    border-radius: 3px; border: 1px solid #93c5fd; letter-spacing: .02em;
    white-space: nowrap;
}
.nu-result-badge.fail-badge { background: #ffeaea; color: #b71c1c; border-color: #ef9a9a; }
.nu-gpa-badge {
    display: inline-block; background: #ecfdf5; color: #065f46;
    font-size: 11px; font-weight: 700; padding: 2px 10px;
    border-radius: 3px; border: 1px solid #6ee7b7; letter-spacing: .02em;
    white-space: nowrap;
}

/* Course table */
.nu-course-wrap { padding: 6px 12px 14px; }
.nu-course-heading {
    text-align: center; font-size: 12.5px; font-weight: 700; color: #1a2e5a;
    margin: 0 0 6px; padding-top: 8px; border-top: 1px solid #c8d6f0;
}
.nu-course-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #b0c0e8;
    table-layout: fixed;
}
.nu-course-table th {
    background: #1a56db; color: #fff; padding: 6px 8px; font-size: 11px;
    font-weight: 700; text-align: left; border: 1px solid #1341b0; word-break: break-word;
}
.nu-course-table th.nu-th-c    { text-align: center; width: 20%; }
.nu-course-table th.nu-th-code { width: 20%; }
.nu-course-table th.nu-th-gp   { text-align: center; width: 18%; }
.nu-course-table td {
    padding: 5px 8px; border: 1px solid #c8d6f0;
    font-size: 11.5px; vertical-align: middle; word-break: break-word;
}
.nu-course-table tbody tr:nth-child(even) td { background: #f4f7fe; }
.nu-td-code  { color: #555; font-family: monospace; font-size: 11px; }
.nu-td-grade { text-align: center; font-weight: 700; font-size: 13px; }
.nu-td-gp    { text-align: center; font-size: 11.5px; font-weight: 600; color: #1a2e5a; }

.nu-grade-fail { color: #c0392b; }
.nu-grade-d    { color: #92610a; }
.nu-grade-c    { color: #1a5276; }
.nu-grade-b    { color: #1a6b3c; }
.nu-grade-a    { color: #155a2e; }
.nu-grade-pass { color: #196f3d; }

/* Footer */
.nu-sheet-footer {
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 8px 12px 12px; border-top: 1px solid #c8d6f0;
    margin-top: 2px; flex-wrap: wrap; gap: .4rem;
}
.nu-footer-gen { font-size: 10px; color: #888; }
.nu-footer-sig { text-align: right; font-size: 11px; margin-left: auto; }
.nu-footer-sig .nu-sig-top   { display: block; font-style: italic; color: #333; }
.nu-footer-sig .nu-sig-title { display: block; font-weight: 700; font-size: 11px; color: #111; text-transform: uppercase; letter-spacing: .03em; }
.nu-footer-sig .nu-sig-org   { display: block; font-size: 10px; color: #1a56db; font-weight: 700; text-transform: uppercase; }

/* ── Mobile < 480px ─────────────────────────────── */
@media (max-width: 480px) {
    #nurc-app { margin: .5rem auto; padding: 0 .5rem; }
    .nurc-card { padding: .85rem .8rem; }
    .nurc-title { font-size: 1.2rem; }

    .nurc-btn-row { flex-direction: column; }
    .nurc-btn { width: 100%; justify-content: center; }
    .nurc-result-actions { justify-content: stretch; flex-direction: column; }
    .nurc-result-actions .nurc-btn { width: 100%; justify-content: center; }

    .nurc-captcha-left { flex: 0 0 46%; }

    /* Result sheet */
    .nu-result-sheet { font-size: 11px; }
    .nu-sheet-header { padding: 10px 10px 7px; }
    .nu-sheet-logo { width: 42px; height: 42px; margin-bottom: 6px; }
    .nu-sheet-org { font-size: 13px; }
    .nu-sheet-type { font-size: 10px; }

    .nu-info-wrap { padding: 7px 8px 3px; }
    .nu-info-table td { padding: 4px 5px; font-size: 10.5px; }
    .nu-info-table td.nu-lbl,
    .nu-info-table td.nu-lbl-sm { font-size: 9.5px; }

    .nu-course-wrap { padding: 5px 8px 10px; }
    .nu-course-heading { font-size: 10.5px; padding-top: 6px; }
    .nu-course-table th { font-size: 9px; padding: 5px 4px; }
    .nu-course-table td { font-size: 10px; padding: 4px 4px; }
    .nu-td-grade { font-size: 11px; }
    .nu-course-table th.nu-th-code { width: 22%; }
    .nu-course-table th.nu-th-c  { width: 18%; }
    .nu-course-table th.nu-th-gp { width: 16%; }

    .nu-sheet-footer { padding: 6px 8px 9px; }
    .nu-footer-gen { font-size: 9px; }
    .nu-footer-sig { font-size: 9.5px; }
    .nu-footer-sig .nu-sig-title { font-size: 9.5px; }
    .nu-footer-sig .nu-sig-org   { font-size: 9px; }
}

/* ── Tablet 481–640px ───────────────────────────── */
@media (min-width: 481px) and (max-width: 640px) {
    #nurc-app { padding: 0 .75rem; }
    .nurc-result-actions .nurc-btn { flex: 1; }
    .nu-sheet-org { font-size: 15px; }
    .nu-info-table td { font-size: 11.5px; }
    .nu-course-table th { font-size: 10.5px; }
    .nu-course-table td { font-size: 11px; }
}

/* ── Print ──────────────────────────────────────── */
@media print {
    #nurc-s1, #nurc-s2, #nurc-loading, #nurc-error,
    .nurc-result-actions, .nurc-header { display: none !important; }
    .nu-result-sheet { box-shadow: none; border-color: #aaa; }
    #nurc-app { max-width: 100%; padding: 0; margin: 0; }
}

/* ── Credit column (added for weighted GPA) ─── */
.nu-course-table th.nu-th-cr { text-align: center; width: 12%; }
.nu-course-table th.nu-th-c  { text-align: center; width: 18%; }
.nu-course-table th.nu-th-gp { text-align: center; width: 14%; }
.nu-course-table th.nu-th-code { width: 18%; }
.nu-td-credit { text-align: center; font-size: 11.5px; color: #1a2e5a; font-weight: 600; }
