/* =========================================================
   NU Admission Result Checker — Design System v1.0.0
   Identical tokens to NU Result v6 plugin
   Fonts: Outfit + Hind Siliguri
   ========================================================= */

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

/* ── Design Tokens ──────────────────────────────────────── */
#nuar-app {
    --primary:      #0F52BA;
    --primary-rgb:  15, 82, 186;
    --secondary:    #2563EB;
    --accent:       #3B82F6;
    --success:      #10B981;
    --warning:      #F59E0B;
    --danger:       #EF4444;
    --dark:         #0F172A;
    --light:        #F8FAFC;
    --white:        #FFFFFF;
    --gray-100:     #F1F5F9;
    --gray-200:     #E2E8F0;
    --gray-300:     #CBD5E1;
    --gray-400:     #64748B;
    --gray-600:     #475569;
    --gray-800:     #1E293B;

    --primary-dk:   #1d4ed8;
    --primary-xdk:  #1e3a8a;
    --primary-lt:   #eff6ff;
    --primary-md:   #bfdbfe;
    --green:        #10b981;
    --green-lt:     #d1fae5;
    --red:          #ef4444;
    --red-lt:       #fef2f2;
    --border:       #E2E8F0;
    --bg:           #F8FAFC;
    --card:         #ffffff;
    --text:         #0F172A;
    --text-2:       #334155;
    --muted:        #64748B;

    --shadow-sm:  0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.05), 0 2px 4px -1px rgba(0,0,0,.03);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.06), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-xl:  0 20px 25px -5px rgba(15,82,186,.06), 0 10px 10px -5px rgba(0,0,0,.03);

    --radius:     16px;
    --radius-sm:  6px;
    --radius-xs:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    font-family: 'Outfit', 'Hind Siliguri', sans-serif;
    font-size: 14px;
    color: var(--dark);
    max-width: 720px;
    margin: 32px auto;
    padding: 0 .75rem;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#nuar-app *, #nuar-app *::before, #nuar-app *::after {
    box-sizing: inherit;
}

/* ── Utility ─────────────────────────────────────────────── */
.nucom-hide { display: none !important; }

/* ── Card ─────────────────────────────────────────────────── */
.nucom-card {
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 1rem;
    animation: nucom-fadein .28s ease;
    position: relative;
}

@keyframes nucom-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Dividers ─────────────────────────────────────────────── */
.nucom-divider-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 16px;
    color: var(--gray-400);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nucom-divider-label::before,
.nucom-divider-label::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--gray-200);
}

.nucom-divider-label svg { stroke: var(--gray-400); flex-shrink: 0; }

/* ── Form grid ────────────────────────────────────────────── */
.nucom-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.nucom-field { display: flex; flex-direction: column; gap: 6px; }
.nucom-field--full { grid-column: 1 / -1; }

/* ── Labels ───────────────────────────────────────────────── */
.nucom-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .01em;
    flex-wrap: wrap;
}

.nucom-label svg { flex-shrink: 0; stroke: var(--primary); }

.nucom-label-sub {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: .72rem;
    color: var(--gray-400);
    font-weight: 400;
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
}

.nucom-req { color: var(--danger); font-size: .85em; }

/* ── Text inputs ──────────────────────────────────────────── */
.nucom-input-wrap input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    font-weight: 600;
    background: var(--white);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.nucom-input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,82,186,.10);
}

.nucom-input-wrap input::placeholder { color: var(--gray-400); font-weight: 400; }
.nucom-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px rgba(239,68,68,.12) !important; }

/* ── Alert ────────────────────────────────────────────────── */
.nucom-alert {
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 14px;
    border: 1px solid transparent;
    animation: nucom-fadein .25s ease;
}

.nucom-alert--error   { background: var(--red-lt);   color: #991b1b; border-color: #fecaca; }
.nucom-alert--success { background: var(--green-lt); color: #065f46; border-color: #a7f3d0; }

/* ── CAPTCHA ──────────────────────────────────────────────── */
.nucom-captcha-section { margin-bottom: 4px; }

.nucom-captcha-label {
    font-size: .77rem;
    font-weight: 700;
    color: var(--gray-600);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: .35rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.nucom-captcha-label svg { stroke: var(--primary); flex-shrink: 0; }

.nucom-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nucom-captcha-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: .75rem 1.25rem;
    height: 48px;
    flex-shrink: 0;
    min-width: 160px;
}

.nucom-captcha-q {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: .05em;
    user-select: none;
    white-space: nowrap;
    transition: opacity .3s;
}

.nucom-fading { opacity: .4; }

#nuar-refresh-captcha {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    border-radius: 4px;
    transition: color .15s, background .15s;
    flex-shrink: 0;
    line-height: 0;
}

#nuar-refresh-captcha svg { display: block; stroke: var(--gray-400); flex-shrink: 0; }
#nuar-refresh-captcha:hover { color: var(--primary); background: rgba(15,82,186,.08); }
#nuar-refresh-captcha:hover svg { stroke: var(--primary); }
#nuar-refresh-captcha:active svg { animation: nucom-spin .4s linear; }

.nucom-captcha-input { flex: 1; min-width: 120px; }
.nucom-captcha-input input { text-align: center; letter-spacing: .10em; font-weight: 700; height: 48px; }

/* ── Submit row ───────────────────────────────────────────── */
.nucom-submit-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.nucom-btn-submit {
    flex: 1;
    min-width: 0;
    padding: .85rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-shadow: 0 4px 14px rgba(15,82,186,.20);
    transition: var(--transition);
}

.nucom-btn-submit:hover:not(:disabled) {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15,82,186,.25);
}

.nucom-btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.nucom-btn-submit svg { stroke: currentColor; flex-shrink: 0; }

.nucom-btn-reset {
    padding: .85rem 1.4rem;
    background: transparent;
    color: var(--gray-600);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.nucom-btn-reset svg { stroke: currentColor; flex-shrink: 0; }
.nucom-btn-reset:hover { border-color: var(--primary); color: var(--primary); background: rgba(15,82,186,.02); }

/* ── Spinner ──────────────────────────────────────────────── */
@keyframes nucom-spin { to { transform: rotate(360deg); } }
.nucom-spin { animation: nucom-spin .75s linear infinite; }

#nuar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 52px 0;
    color: var(--gray-400);
    font-size: .9rem;
    font-weight: 500;
}

.nucom-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(15,82,186,.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: nucom-spin .75s linear infinite;
}

/* ── Error panel ──────────────────────────────────────────── */
.nucom-err-text { text-align: center; color: var(--danger); font-weight: 600; margin: 0 0 16px; }

/* ── Modal overlay ────────────────────────────────────────── */
.nucom-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 20, 50, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: nucom-fadein .25s ease;
}

.nucom-modal-overlay.nucom-modal-open { display: flex; }

.nucom-modal-box {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 64px rgba(10,20,50,.38);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nucom-modal-in .28s cubic-bezier(.34,1.56,.64,1);
}

@keyframes nucom-modal-in {
    from { opacity: 0; transform: scale(.93) translateY(18px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* ── Modal header ─────────────────────────────────────────── */
.nucom-modal-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.nucom-modal-titles { min-width: 0; }

.nucom-result-title-1 {
    font-size: .8rem;
    font-weight: 500;
    margin: 0 0 2px;
    color: rgba(255,255,255,.85);
    letter-spacing: .03em;
}

.nucom-result-title-2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nucom-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .18s;
    line-height: 1;
}

.nucom-modal-close svg { display: block; stroke: #fff; flex-shrink: 0; }
.nucom-modal-close:hover { background: rgba(255,255,255,.28); }

/* ── Modal body ───────────────────────────────────────────── */
.nucom-modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: var(--light);
}

/* ── Status banner ────────────────────────────────────────── */
.nuar-status-banner {
    padding: .75rem 1.25rem;
    font-size: .9rem;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: .5rem;
    line-height: 1.5;
}

.nuar-status-banner.admitted {
    display: flex;
    background: var(--green-lt);
    color: #065f46;
    border-bottom: 2px solid #6ee7b7;
}

.nuar-status-banner.not-admitted {
    display: flex;
    background: var(--red-lt);
    color: #991b1b;
    border-bottom: 2px solid #fca5a5;
}

/* ── Result Sheet ─────────────────────────────────────────── */
.nuar-result-sheet {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 13px;
    color: var(--dark);
}

.nuar-sheet-header {
    background: var(--white);
    text-align: center;
    padding: 18px 20px 14px;
    border-bottom: 3px solid var(--primary);
}

.nuar-sheet-org {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: .3px;
    margin: 0 0 4px;
}

.nuar-sheet-type {
    font-size: 12px;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.6;
}

/* Info table */
.nuar-info-wrap { padding: 14px 18px 8px; }

.nuar-info-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dde6f5;
}

.nuar-info-table td {
    padding: 8px 12px;
    border: 1px solid #e2eaf6;
    font-size: 13px;
    vertical-align: middle;
    line-height: 1.5;
}

td.nu-lbl {
    background: var(--primary-lt);
    font-weight: 700;
    color: var(--primary-xdk);
    width: 160px;
    white-space: nowrap;
}

td.nu-lbl-sm {
    background: var(--primary-lt);
    font-weight: 700;
    color: var(--primary-xdk);
    width: 120px;
    white-space: nowrap;
}

td.nu-val { color: var(--dark); font-weight: 500; }

/* Result badge */
.nuar-status-admitted {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--green-lt);
    color: #065f46;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #6ee7b7;
    font-size: .82rem;
}

.nuar-status-pending {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fffbeb;
    color: #92400e;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid #fcd34d;
    font-size: .82rem;
}

/* Sheet footer */
.nuar-sheet-footer {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 10px 18px 16px;
    border-top: 1px solid var(--gray-200);
    margin-top: 4px;
}

.nuar-footer-sig { text-align: right; }
.nu-sig-top   { display: block; font-style: italic; font-size: 11px; color: var(--gray-600); }
.nu-sig-title { display: block; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--dark); }
.nu-sig-org   { display: block; font-size: 10.5px; color: var(--primary); font-weight: 700; text-transform: uppercase; }

/* ── Modal footer ─────────────────────────────────────────── */
.nucom-result-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1.5px solid var(--gray-200);
    background: var(--white);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.nucom-result-btn {
    flex: 1;
    min-width: 140px;
    padding: .68rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-decoration: none;
    transition: var(--transition);
}

.nucom-result-btn svg { stroke: currentColor; flex-shrink: 0; }

.nucom-result-btn--search {
    background: transparent;
    color: var(--gray-600);
    border: 1.5px solid var(--gray-300);
}

.nucom-result-btn--search:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(15,82,186,.03);
    transform: translateY(-1px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    #nuar-app { margin: 10px auto; padding: 0 .5rem; font-size: 13px; }
    .nucom-card { padding: 1.25rem; }
    .nucom-form-grid { grid-template-columns: 1fr; }
    .nucom-modal-overlay { padding: 0; align-items: flex-end; }
    .nucom-modal-box { max-width: 100%; border-radius: var(--radius-md) var(--radius-md) 0 0; max-height: 94vh; }
    .nucom-result-actions { flex-direction: column; }
    .nucom-result-btn { min-width: unset; }
    .nucom-submit-row { flex-direction: column; gap: 10px; }
    .nucom-btn-submit { width: 100%; flex: none; }
    .nucom-btn-reset { width: 100%; flex: none; }
    .nucom-captcha-row { flex-direction: column; align-items: stretch; }
    .nucom-captcha-box { min-width: unset; width: 100%; justify-content: space-between; }
    .nucom-captcha-input { width: 100%; }
    .nuar-info-table td { font-size: 11px; padding: 6px 8px; }
    td.nu-lbl, td.nu-lbl-sm { width: 100px; }
    .nuar-sheet-footer { flex-direction: column; gap: .5rem; align-items: flex-start; }
}

/* ── Rate-limit / fetch-error messages (v1.1) ───────────────── */
.nuar-rate-limit-msg {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1.4rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    color: #9a3412;
    font-size: .9rem;
    margin: 1rem 0;
}
.nuar-rate-limit-msg svg { flex-shrink: 0; }
.nuar-fetch-error {
    color: #b91c1c;
    font-size: .9rem;
    text-align: center;
    padding: .75rem 0;
}
