/*
 * NTN Luyện tập Portal — Cổng học sinh & cổng giáo viên
 * Port từ theme ntn-exam (v1.3.0) để dùng trong theme qrall_NTN.
 * Mọi selector đều scope trong .ntn-page để không ảnh hưởng style qrall.
 */

.ntn-page {
  --ntn-ink: #0f172a;
  --ntn-muted: #64748b;
  --ntn-line: #e2e8f0;
  --ntn-bg: #f1f5f9;
  --ntn-card: #ffffff;
  --ntn-accent: #4f46e5;
  --ntn-accent-2: #7c3aed;
  --ntn-ok: #059669;
  --ntn-sidebar: #0b1220;
  --ntn-sidebar-2: #111827;

  box-sizing: border-box;
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  color: var(--ntn-ink);
  background: var(--ntn-bg);
  line-height: 1.55;
}
.ntn-page *,
.ntn-page *::before,
.ntn-page *::after { box-sizing: border-box; }

.ntn-page a { color: var(--ntn-accent); text-decoration: none; }
.ntn-page a:hover { text-decoration: underline; }

/* Nút dùng chung (đè style .btn/.form-input của qrall nếu conflv) */
.ntn-page .form-input { max-width: none; }

/* Login */
.ntn-page .ntn-login {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 55%, #db2777 100%);
}
.ntn-page .ntn-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  text-align: left;
}
.ntn-page .ntn-glass { backdrop-filter: none; }
.ntn-page .ntn-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.ntn-page .ntn-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ntn-accent), var(--ntn-accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.ntn-page .ntn-meta-text { color: #64748b; font-size: .9rem; }
.ntn-page .ntn-login-card h1 { margin: 4px 0 6px; font-size: 1.45rem; color: var(--ntn-ink); }
.ntn-page .ntn-login-card p.lead { color: var(--ntn-muted); margin: 0 0 22px; }
.ntn-page .ntn-field { margin-bottom: 14px; }
.ntn-page .ntn-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; color: var(--ntn-ink); }
.ntn-page .ntn-field input,
.ntn-page .ntn-field select {
  width: 100%;
  max-width: none;
  background: #fff;
  color: var(--ntn-ink);
  border: 1px solid var(--ntn-line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.ntn-page .ntn-field input:focus { outline: 2px solid #c7d2fe; border-color: var(--ntn-accent); }
.ntn-page .ntn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--ntn-accent);
  color: #fff;
  width: 100%;
  text-decoration: none;
}
.ntn-page .ntn-btn:hover { filter: brightness(1.05); text-decoration: none; }
.ntn-page .ntn-error, .ntn-page .ntn-alert {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.ntn-page .ntn-ok {
  background: #ecfdf5;
  color: #047857;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.ntn-page .ntn-teacher-link {
  text-align: center;
  margin: 16px 0 0;
  font-size: .9rem;
}
.ntn-page .ntn-teacher-link a { color: var(--ntn-muted); }
.ntn-page .ntn-card-pad { padding: 18px; }
.ntn-page .ntn-inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.ntn-page .ntn-del { color: #b91c1c; }

/* App shell */
.ntn-page .ntn-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.ntn-page .ntn-side {
  background: linear-gradient(180deg, var(--ntn-sidebar), var(--ntn-sidebar-2));
  color: #e5e7eb;
  padding: 28px 20px;
  min-height: 100vh;
}
.ntn-page .ntn-side h2 { margin: 0 0 4px; font-size: 1.15rem; color: #fff; }
.ntn-page .ntn-side .meta { color: #94a3b8; font-size: .9rem; margin-bottom: 28px; }
.ntn-page .ntn-side a {
  display: block;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.ntn-page .ntn-side a:hover, .ntn-page .ntn-side a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.ntn-page .ntn-main {
  padding: 36px 44px 48px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.ntn-page .ntn-hero {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 22px;
  width: 100%;
}
.ntn-page .ntn-hero h1 { margin: 0 0 8px; font-size: 1.7rem; color: var(--ntn-ink); }
.ntn-page .ntn-hero p { margin: 0; color: var(--ntn-muted); line-height: 1.55; }
.ntn-page .ntn-hero p a { color: var(--ntn-accent); }
.ntn-page .ntn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}
.ntn-page .ntn-stat {
  background: var(--ntn-card);
  border: 1px solid var(--ntn-line);
  border-radius: 16px;
  padding: 16px;
}
.ntn-page .ntn-stat b { display: block; font-size: 1.6rem; color: var(--ntn-ink); }
.ntn-page .ntn-stat span { color: var(--ntn-muted); font-size: .9rem; }
.ntn-page .ntn-card {
  background: var(--ntn-card);
  border: 1px solid var(--ntn-line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  color: var(--ntn-ink);
}
.ntn-page .ntn-card h3 { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--ntn-line); color: var(--ntn-ink); }
.ntn-page .ntn-exam {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ntn-line);
}
.ntn-page .ntn-exam:last-child { border-bottom: 0; }
.ntn-page .ntn-exam .title { font-weight: 700; color: var(--ntn-ink); }
.ntn-page .ntn-exam .sub { color: var(--ntn-muted); font-size: .9rem; }
.ntn-page .ntn-btn.small { width: auto; padding: 8px 14px; font-size: .92rem; }
.ntn-page .ntn-btn.ghost { background: #eef2ff; color: var(--ntn-accent); }
.ntn-page table.ntn-table { width: 100%; border-collapse: collapse; margin: 0; }
.ntn-page table.ntn-table th, .ntn-page table.ntn-table td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--ntn-line); color: var(--ntn-ink); }
.ntn-page table.ntn-table th { font-size: .82rem; color: var(--ntn-muted); text-transform: uppercase; letter-spacing: .04em; }
.ntn-page .best { color: var(--ntn-ok); font-weight: 800; }

.ntn-page .ntn-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ntn-page .ntn-muted { color: var(--ntn-muted); }
.ntn-page .ntn-help { color: var(--ntn-muted); font-size: .88rem; margin: 0 0 12px; }
.ntn-page .ntn-section-title { margin: 8px 0 12px; font-size: 1.05rem; color: var(--ntn-ink); }
.ntn-page .ntn-side-label {
  color: #64748b;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 26px 0 10px;
}
.ntn-page .ntn-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 8px;
  vertical-align: middle;
}
.ntn-page .ntn-badge.open { background: #d1fae5; color: #047857; }
.ntn-page .ntn-badge.scheduled { background: #fef3c7; color: #b45309; }
.ntn-page .ntn-badge.closed { background: #e2e8f0; color: #475569; }
.ntn-page .ntn-chip {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .8rem;
  font-weight: 600;
  margin: 0 4px 4px 0;
}
.ntn-page .ntn-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ntn-page .ntn-class-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--ntn-card);
  border: 1px solid var(--ntn-line);
  border-radius: 16px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
.ntn-page .ntn-class-card:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(79,70,229,.08); text-decoration: none; }
.ntn-page .ntn-class-card strong { font-size: 1.15rem; color: var(--ntn-ink); }
.ntn-page .ntn-class-card span { color: var(--ntn-muted); font-size: .9rem; }
.ntn-page .ntn-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 800;
  letter-spacing: .06em;
  color: #3730a3;
  background: #eef2ff;
  border-radius: 8px;
  padding: 1px 7px;
}
.ntn-page .ntn-copy {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 8px;
  padding: 3px 8px;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}
.ntn-page .ntn-copy:hover { background: #c7d2fe; }
.ntn-page .ntn-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ntn-page .ntn-filter-bar label { font-weight: 600; color: var(--ntn-ink); }
.ntn-page .ntn-filter-bar select {
  border: 1px solid var(--ntn-line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
  color: var(--ntn-ink);
}
.ntn-page .ntn-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px 12px;
  margin: 8px 0 10px;
}
.ntn-page .ntn-check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 6px; color: var(--ntn-ink); }
.ntn-page .ntn-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ntn-page .ntn-field input[type=datetime-local],
.ntn-page .ntn-field input[type=number],
.ntn-page .ntn-field input[type=text] {
  width: 100%;
  max-width: none;
  border: 1px solid var(--ntn-line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--ntn-ink);
}
.ntn-page .ntn-gate {
  max-width: 520px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--ntn-line);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
}
.ntn-page .ntn-gate h1 { color: var(--ntn-ink); font-size: 1.4rem; margin: 0 0 8px; }
.ntn-page .ntn-gate p { color: var(--ntn-muted); margin: 0 0 18px; }

@media (max-width: 860px) {
  .ntn-page .ntn-shell { grid-template-columns: 1fr; }
  .ntn-page .ntn-side { min-height: 0; }
  .ntn-page .ntn-main { padding: 20px 16px 32px; }
  .ntn-page .ntn-grid, .ntn-page .ntn-grid-4 { grid-template-columns: 1fr; }
  .ntn-page .ntn-exam { flex-direction: column; align-items: flex-start; }
  .ntn-page .ntn-field-row { grid-template-columns: 1fr; }
}
