/* ============================================================
   NU Result Unified — nu-result.css  (v5.0.0)
   White-Shade "Result Publication System" theme.
   Ported to match the reference design exactly. Scoped under
   .nucom-redesign so nothing leaks into the host WP theme.
   ============================================================ */

.nucom-redesign {
  --font-primary:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Noto Sans Bengali","Hind Siliguri",sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;

  --bg-body:#f7f8fa; --bg-panel:#ffffff; --bg-solid:#ffffff; --bg-header:#1e293b;
  --border-element:rgba(15,23,42,0.09);

  --shadow-premium:0 2px 20px rgba(15,23,42,0.06),0 1px 4px rgba(15,23,42,0.04);
  --shadow-hover:0 8px 30px rgba(15,23,42,0.10),0 2px 8px rgba(15,23,42,0.04);

  --text-main:#1e293b; --text-muted:#64748b; --text-inverse:#ffffff;
  --color-primary:#374151; --color-primary-light:#4b5563; --color-accent:#6b7280;
  --color-danger:hsl(350,89%,60%); --color-success:hsl(142,70%,45%); --color-info:hsl(217,91%,60%);

  --radius-lg:18px; --radius-md:12px; --radius-sm:8px;
  --transition-smooth:all .35s cubic-bezier(.16,1,.3,1);
  --transition-fast:all .18s ease;

  font-family:var(--font-primary);
  color:var(--text-main);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  max-width:820px;
  margin:0 auto;
  padding:0 4px 20px;
}
.nucom-redesign *,
.nucom-redesign *::before,
.nucom-redesign *::after { box-sizing:border-box; }
.nucom-redesign button,
.nucom-redesign select,
.nucom-redesign input { font-family:inherit; outline:none; border:none; }

@keyframes nucom-gradient-flow { 0% { background-position:0% 50%; } 100% { background-position:200% 50%; } }
@keyframes nucom-spin { 0% { transform:rotate(0); } 100% { transform:rotate(360deg); } }
@keyframes nucom-shake { 0%,100% { transform:translateX(0);} 20%,60% { transform:translateX(-4px);} 40%,80% { transform:translateX(4px);} }
@keyframes nucom-reveal { from { opacity:0; transform:translateY(24px);} to { opacity:1; transform:translateY(0);} }


/* ── Tabs ─────────────────────────────────────────────────── */
.nucom-redesign .checker-tabs {
  display:flex; gap:4px; padding:5px;
  background:var(--bg-panel);
  border:1px solid var(--border-element);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow-premium);
  margin-bottom:20px;
}
.nucom-redesign .tab-btn {
  flex:1; padding:12px 12px;
  background:transparent; border-radius:6px;
  font-size:.92rem; font-weight:650; color:var(--text-muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:var(--transition-fast);
}
.nucom-redesign .tab-btn svg { width:16px; height:16px; stroke:currentColor; stroke-width:2.2; fill:none; }
.nucom-redesign .tab-btn.active { background:var(--bg-header); color:#f1f5f9; box-shadow:0 2px 8px rgba(30,41,59,.15); }
.nucom-redesign .tab-btn:not(.active):hover { background:var(--bg-body); color:var(--text-main); }
.nucom-redesign .checker-tab-panel[hidden] { display:none; }

/* ── Premium card ─────────────────────────────────────────── */
.nucom-redesign .nucom-card {
  background:var(--bg-panel);
  border:1px solid var(--border-element);
  border-radius:var(--radius-lg);
  padding:32px;
  box-shadow:var(--shadow-premium);
  transition:var(--transition-smooth);
  position:relative; overflow:hidden;
  margin-bottom:20px;
}
.nucom-redesign .nucom-card::before {
  content:""; position:absolute; top:0; left:0; width:100%; height:3px;
  background:linear-gradient(90deg,#94a3b8,#e2e8f0,#94a3b8);
  background-size:200%; animation:nucom-gradient-flow 6s linear infinite;
}
.nucom-redesign .nucom-card:hover { box-shadow:var(--shadow-hover); }

/* ── Fieldset ─────────────────────────────────────────────── */
.nucom-redesign fieldset {
  background:#f8fafc; border:1px solid var(--border-element);
  border-radius:var(--radius-sm); padding:20px; margin:0 0 16px;
}
.nucom-redesign legend {
  font-size:1.05rem; font-weight:800; letter-spacing:-.1px;
  color:var(--text-main); padding:0 8px;
}

/* ── Form grid ────────────────────────────────────────────── */
.nucom-redesign .form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
.nucom-redesign .form-col-span-2 { grid-column:span 2; }
.nucom-redesign .form-group { display:flex; flex-direction:column; gap:7px; }
.nucom-redesign .form-group label {
  font-size:.86rem; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--text-muted); display:flex; align-items:center; gap:6px;
}
.nucom-redesign .form-group label svg { width:14px; height:14px; stroke:var(--text-muted); stroke-width:2.2; fill:none; }

.nucom-redesign .select-wrapper { position:relative; width:100%; }
.nucom-redesign .select-wrapper::after {
  content:""; position:absolute; right:14px; top:50%; transform:translateY(-50%);
  width:7px; height:4px; background:var(--text-muted);
  clip-path:polygon(100% 0%,0 0%,50% 100%); pointer-events:none;
}
.nucom-redesign select,
.nucom-redesign input[type="text"],
.nucom-redesign input[type="number"] {
  width:100%; padding:13px 16px;
  border-radius:var(--radius-sm);
  background:var(--bg-solid);
  border:1px solid var(--border-element);
  color:var(--text-main);
  font-size:1.02rem; font-weight:500;
  transition:var(--transition-fast); appearance:none; -webkit-appearance:none;
}
.nucom-redesign select:focus,
.nucom-redesign input[type="text"]:focus,
.nucom-redesign input[type="number"]:focus {
  border-color:#64748b; box-shadow:0 0 0 3px rgba(100,116,139,.1);
}
.nucom-redesign input::placeholder { color:var(--text-muted); opacity:.6; }

.nucom-redesign .input-icon-wrapper { position:relative; }
.nucom-redesign .input-icon-wrapper input { padding-left:40px; }
.nucom-redesign .input-icon-wrapper > svg {
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  width:14px; height:14px; stroke:var(--text-muted); stroke-width:2.2; fill:none; pointer-events:none;
}

/* Invalid state (JS toggles .nucom-invalid) */
.nucom-redesign .nucom-invalid {
  border-color:var(--color-danger) !important;
  box-shadow:0 0 0 3px rgba(239,68,68,.12) !important;
}

/* ── Captcha (themed; carries the real math answer, fits its box) ── */
.nucom-redesign .nucom-captcha-row {
  display:flex; align-items:stretch; gap:12px; margin-top:4px;
}
.nucom-redesign .nucom-captcha-top {
  display:flex; align-items:stretch; gap:12px; flex:0 0 auto;
}
.nucom-redesign .nucom-captcha-chip {
  display:flex; align-items:center; justify-content:center;
  min-width:158px; padding:0 22px; height:54px;
  background:#f1f5f9; border:1px solid var(--border-element); border-radius:var(--radius-sm);
  font-family:var(--font-mono); font-size:1.35rem; font-weight:700; color:var(--text-main);
  letter-spacing:1.5px; user-select:none; white-space:nowrap; overflow:visible;
  transition:opacity .35s ease;
}
.nucom-redesign .nucom-captcha-question { display:inline-block; }
.nucom-redesign .nucom-captcha-question.nucom-fading { opacity:.2; }
.nucom-redesign .nucom-captcha-refresh {
  flex:0 0 auto; width:54px; height:54px;
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-solid); border:1px solid var(--border-element); border-radius:var(--radius-sm);
  color:var(--text-muted); cursor:pointer; transition:var(--transition-fast);
}
.nucom-redesign .nucom-captcha-refresh:hover { color:var(--text-main); border-color:var(--text-muted); background:var(--bg-body); }
.nucom-redesign .nucom-captcha-refresh:active { transform:scale(.94); }
.nucom-redesign .nucom-captcha-refresh svg { width:18px; height:18px; stroke:currentColor; stroke-width:2.4; fill:none; }
.nucom-redesign .nucom-captcha-row input { flex:1 1 auto; height:54px; font-size:1.05rem; }


/* ── Buttons ──────────────────────────────────────────────── */
.nucom-redesign .form-actions { display:flex; gap:14px; margin-top:10px; }
.nucom-redesign .form-actions--center { justify-content:center; }

.nucom-redesign .btn {
  padding:13px 24px; border-radius:var(--radius-sm);
  font-size:1rem; font-weight:650; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  transition:var(--transition-smooth); white-space:nowrap;
}
.nucom-redesign .btn svg { width:17px; height:17px; stroke:currentColor; stroke-width:2.2; fill:none; }
.nucom-redesign .btn-primary { flex:2; background:var(--color-primary); color:#fff; box-shadow:0 4px 12px rgba(55,65,81,.2); }
.nucom-redesign .btn-primary:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(55,65,81,.3); }
.nucom-redesign .btn-primary:disabled { background:var(--border-element); color:var(--text-muted); cursor:not-allowed; box-shadow:none; transform:none; }
.nucom-redesign .btn-secondary-outline { flex:1; background:var(--bg-solid); border:1px solid var(--border-element); color:var(--text-main); }
.nucom-redesign .btn-secondary-outline:hover { background:var(--bg-body); border-color:var(--text-muted); transform:translateY(-1px); }

/* ── Alert ────────────────────────────────────────────────── */
.nucom-redesign .nucom-alert {
  display:flex; margin-top:14px; padding:11px 14px; border-radius:var(--radius-sm);
  align-items:center; gap:9px; font-size:.92rem; font-weight:600;
  animation:nucom-shake .5s ease-in-out;
}
/* button label / spinner: keep flex alignment when scripts toggle them */
.nucom-redesign .nucom-btn-text,
.nucom-redesign .nucom-btn-spinner,
.nucom-redesign #nuar-btn-text,
.nucom-redesign #nuar-btn-spinner { display:inline-flex; align-items:center; gap:7px; }
.nucom-redesign .nucom-alert svg { width:15px; height:15px; stroke:currentColor; stroke-width:2.2; fill:none; flex-shrink:0; }
.nucom-redesign .nucom-alert--error   { background:rgba(239,68,68,.07); border:1px solid rgba(239,68,68,.14); color:var(--color-danger); }
.nucom-redesign .nucom-alert--success { background:rgba(34,197,94,.08); border:1px solid rgba(34,197,94,.18); color:#15803d; }

/* ── Loading ──────────────────────────────────────────────── */
.nucom-redesign .nucom-loading {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  padding:40px 16px; margin-bottom:20px;
  background:var(--bg-panel); border:1px solid var(--border-element);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-premium);
}
.nucom-redesign .nucom-loading span { font-size:.98rem; font-weight:700; color:var(--text-main); letter-spacing:.3px; }
.nucom-redesign .nucom-spinner { position:relative; width:48px; height:48px; }
.nucom-redesign .nucom-spinner::before,
.nucom-redesign .nucom-spinner::after {
  content:""; position:absolute; border:3px solid transparent; border-radius:50%;
  animation:nucom-spin 1.2s cubic-bezier(.5,0,.5,1) infinite;
}
.nucom-redesign .nucom-spinner::before { inset:0; border-top-color:#374151; }
.nucom-redesign .nucom-spinner::after { inset:7px; border-top-color:#94a3b8; animation-duration:.8s; animation-direction:reverse; }
.nucom-redesign .nucom-spin { width:15px; height:15px; animation:nucom-spin .8s linear infinite; }

/* ── Error panel ──────────────────────────────────────────── */
.nucom-redesign .nucom-error { text-align:center; }
.nucom-redesign .nucom-err-text { margin:0 0 16px; color:var(--color-danger); font-size:1rem; font-weight:650; }

/* ── Result modal (PDF viewer) ────────────────────────────── */
.nucom-redesign .nucom-modal-overlay {
  display:none; position:fixed; inset:0; z-index:99999;
  background:rgba(15,23,42,.5); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  padding:18px; align-items:center; justify-content:center;
}
.nucom-redesign .nucom-modal-overlay.nucom-modal-open { display:flex; }
.nucom-redesign .nucom-modal-box {
  width:100%; max-width:860px; max-height:92vh;
  display:flex; flex-direction:column;
  background:var(--bg-panel); border:1px solid var(--border-element);
  border-radius:var(--radius-lg); overflow:hidden;
  box-shadow:0 24px 60px -20px rgba(15,23,42,.5);
  animation:nucom-reveal .4s cubic-bezier(.16,1,.3,1);
}
.nucom-redesign .nucom-modal-header {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 22px; background:var(--bg-header); position:relative;
}
.nucom-redesign .nucom-modal-header::before {
  content:""; position:absolute; top:0; left:0; width:100%; height:3px;
  background:linear-gradient(90deg,#94a3b8,#cbd5e1,#94a3b8); background-size:200% 100%;
  animation:nucom-gradient-flow 5s linear infinite;
}
.nucom-redesign .nucom-result-title-1 { margin:0; font-size:1rem; font-weight:800; color:#f1f5f9; letter-spacing:.2px; }
.nucom-redesign .nucom-result-title-2 { margin:2px 0 0; font-size:.76rem; font-weight:500; color:#94a3b8; letter-spacing:.4px; }
.nucom-redesign .nucom-modal-close {
  flex:0 0 auto; width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.1); color:#f1f5f9; border:1px solid rgba(255,255,255,.15);
  cursor:pointer; transition:var(--transition-fast);
}
.nucom-redesign .nucom-modal-close:hover { background:var(--color-danger); border-color:var(--color-danger); color:#fff; }
.nucom-redesign .nucom-modal-close svg { width:16px; height:16px; stroke:currentColor; stroke-width:2.5; fill:none; }

.nucom-redesign .nucom-modal-body { flex:1 1 auto; overflow:auto; background:#f8fafc; padding:16px; }
.nucom-redesign .nucom-pdf-viewer-wrap { width:100%; }
.nucom-redesign .nucom-result-iframe,
.nucom-redesign .nucom-pdf-iframe {
  width:100%; height:66vh; min-height:440px;
  border:1px solid var(--border-element); border-radius:var(--radius-md); background:#fff;
}
.nucom-redesign .nucom-pdf-image-viewer { display:flex; flex-direction:column; gap:12px; }
.nucom-redesign .nucom-pdf-page-wrap { background:#fff; border:1px solid var(--border-element); border-radius:var(--radius-md); overflow:hidden; }
.nucom-redesign .nucom-pdf-page-img { display:block; width:100%; height:auto; }

.nucom-redesign .nucom-result-actions {
  display:flex; gap:12px; flex-wrap:wrap;
  padding:16px 22px; border-top:1px solid var(--border-element); background:var(--bg-panel);
}
.nucom-redesign .nucom-result-btn {
  flex:1 1 auto; padding:11px 18px; border-radius:var(--radius-sm);
  font-size:.98rem; font-weight:650; cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  transition:var(--transition-smooth);
}
.nucom-redesign .nucom-result-btn svg { width:16px; height:16px; stroke:currentColor; stroke-width:2.2; fill:none; }
.nucom-redesign .nucom-result-btn--download { background:var(--color-primary); color:#fff; box-shadow:0 4px 12px rgba(55,65,81,.2); }
.nucom-redesign .nucom-result-btn--download:hover { background:#1e293b; transform:translateY(-1px); }
.nucom-redesign .nucom-result-btn--search { background:var(--bg-solid); border:1px solid var(--border-element); color:var(--text-main); }
.nucom-redesign .nucom-result-btn--search:hover { background:var(--bg-body); border-color:var(--text-muted); transform:translateY(-1px); }
.nucom-redesign .nucom-pdf-mobile-note {
  display:flex; align-items:center; gap:6px; justify-content:center;
  padding:11px 14px; font-size:.78rem; font-weight:550; color:var(--text-muted);
  background:#f8fafc; border-top:1px dashed var(--border-element);
}
.nucom-redesign .nucom-pdf-mobile-note svg { width:13px; height:13px; stroke:currentColor; stroke-width:2.2; fill:none; }

/* ── Admission marksheet (rendered by handler.php into the modal body) ── */
.nucom-redesign .nuar-status-banner {
  display:flex; align-items:center; gap:8px; margin-bottom:14px;
  padding:12px 16px; border-radius:var(--radius-sm); font-size:.86rem; font-weight:700; border:1px solid transparent;
}
.nucom-redesign .nuar-status-banner.admitted     { background:rgba(34,197,94,.08); color:#15803d; border-color:rgba(34,197,94,.2); }
.nucom-redesign .nuar-status-banner.not-admitted { background:rgba(234,179,8,.09); color:#a16207; border-color:rgba(234,179,8,.22); }
.nucom-redesign .nuar-status-admitted,
.nucom-redesign .nuar-status-pending {
  display:inline-flex; align-items:center; gap:5px; font-family:var(--font-mono);
  font-weight:800; font-size:.76rem; padding:3px 9px; border-radius:5px;
}
.nucom-redesign .nuar-status-admitted { background:rgba(34,197,94,.1); border:1.5px solid rgba(34,197,94,.25); color:#15803d; }
.nucom-redesign .nuar-status-pending  { background:rgba(234,179,8,.1); border:1.5px solid rgba(234,179,8,.25); color:#a16207; }

.nucom-redesign .nuar-result-sheet {
  background:var(--bg-panel); border:1px solid var(--border-element);
  border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-premium);
}
.nucom-redesign .nuar-sheet-header {
  display:flex; flex-direction:column; gap:2px; padding:20px 22px; text-align:center;
  border-bottom:2px solid var(--border-element); background:#f8fafc;
}
.nucom-redesign .nuar-sheet-org  { margin:0; font-size:1.02rem; font-weight:800; color:var(--text-main); letter-spacing:.2px; }
.nucom-redesign .nuar-sheet-type { margin:0; font-size:.76rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; }

.nucom-redesign .nuar-info-wrap { padding:20px 22px; }
.nucom-redesign .nuar-info-table { width:100%; border-collapse:collapse; }
.nucom-redesign .nuar-info-table td { padding:12px 16px; border-bottom:1px solid var(--border-element); font-size:.86rem; vertical-align:top; }
.nucom-redesign .nuar-info-table tr:last-child td { border-bottom:none; }
.nucom-redesign .nu-lbl,
.nucom-redesign .nu-lbl-sm {
  width:1%; white-space:nowrap; background:#f1f5f9; color:var(--text-muted);
  font-size:.7rem; font-weight:800; text-transform:uppercase; letter-spacing:.8px;
}
.nucom-redesign .nu-lbl-sm { font-size:.68rem; }
.nucom-redesign .nu-val { color:var(--text-main); font-weight:600; }

.nucom-redesign .nuar-sheet-footer { display:flex; justify-content:flex-end; padding:18px 22px; border-top:1px dashed var(--border-element); background:#f8fafc; }
.nucom-redesign .nuar-footer-sig { display:flex; flex-direction:column; align-items:flex-end; gap:1px; text-align:right; }
.nucom-redesign .nu-sig-top   { font-size:.68rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; }
.nucom-redesign .nu-sig-title { font-size:.84rem; font-weight:800; color:var(--text-main); border-top:1px solid var(--text-muted); padding-top:4px; margin-top:3px; }
.nucom-redesign .nu-sig-org   { font-size:.74rem; color:var(--text-muted); }

.nucom-redesign .nuar-fetch-error,
.nucom-redesign .nuar-rate-limit-msg {
  padding:14px 16px; border-radius:var(--radius-sm); font-size:.86rem; font-weight:600; text-align:center;
  background:rgba(239,68,68,.07); color:var(--color-danger); border:1px solid rgba(239,68,68,.14);
}

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

.nucom-redesign .btn:focus-visible,
.nucom-redesign .tab-btn:focus-visible,
.nucom-redesign .nucom-captcha-refresh:focus-visible,
.nucom-redesign .nucom-result-btn:focus-visible,
.nucom-redesign .nucom-modal-close:focus-visible { outline:2px solid #64748b; outline-offset:2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width:620px) {
  .nucom-redesign { padding:0 6px 20px; }
  .nucom-redesign .nucom-card { padding:20px 16px; }
  .nucom-redesign .form-grid { grid-template-columns:1fr; gap:15px; }
  .nucom-redesign .form-col-span-2 { grid-column:span 1; }
  .nucom-redesign .form-actions { flex-direction:column-reverse; }

  /* Tabs: show the name under the icon (stacked), all four fit */
  .nucom-redesign .checker-tabs { gap:3px; padding:4px; }
  .nucom-redesign .tab-btn { flex-direction:column; gap:5px; font-size:.74rem; padding:9px 3px; }
  .nucom-redesign .tab-btn .tab-label { display:block; }
  .nucom-redesign .tab-btn svg { width:17px; height:17px; }

  /* Captcha: question + refresh on row 1, answer input on row 2 */
  .nucom-redesign .nucom-captcha-row { flex-direction:column; gap:10px; }
  .nucom-redesign .nucom-captcha-top { width:100%; }
  .nucom-redesign .nucom-captcha-top .nucom-captcha-chip { flex:1 1 auto; min-width:0; }
  .nucom-redesign .nucom-captcha-row input { width:100%; }

  .nucom-redesign .nucom-result-iframe { height:58vh; min-height:340px; }
  .nucom-redesign .nuar-info-table td { padding:9px 11px; font-size:.86rem; }
}

@media (prefers-reduced-motion:reduce) {
  .nucom-redesign *, .nucom-redesign *::before, .nucom-redesign *::after {
    animation-duration:.001ms !important; transition-duration:.001ms !important;
  }
}
