/* Design system for the (existing, admission-based) Student Panel.
   Sky Blue -> Cyan gradient ("learning/focus" feel), distinct from Mess
   (orange-red), Library (indigo-blue-purple), Hostel (teal-emerald), and
   Class Students (amber-gold). Mirrors hostel.css/class.css structure with
   a student- prefix. */

:root {
  --student-sky: #0ea5e9;
  --student-primary: #0284c7;
  --student-cyan: #06b6d4;
  --student-navy: #075985;
  --student-red: #dc2626;
  --student-ink: #082f3f;
  --student-muted: #7391a3;
  --student-bg: #f0f9ff;
  --student-card-radius: 20px;
}

* { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, .student-brand-text, .student-btn-primary { font-family: 'Poppins', sans-serif; }

/* ---------- Auth pages ---------- */
.student-auth-body {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 35%, #0ea5e9 70%, #06b6d4 100%);
  background-attachment: fixed;
}
.student-auth-shell { width: 100%; max-width: 430px; }
.student-brand-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.student-brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; backdrop-filter: blur(6px);
}
.student-brand-text { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .04em; line-height: 1.1; text-align: left; }
.student-brand-text small { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .14em; color: rgba(255,255,255,.75); }
.student-auth-card {
  background: #fff; border-radius: var(--student-card-radius);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(3,60,90,.35);
  animation: studentPop .35s ease-out;
}
@keyframes studentPop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }
.student-input-icon { position: relative; }
.student-input-icon > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--student-primary); z-index: 2; }
.student-input-icon .form-control, .student-input-icon .form-select { padding-left: 2.4rem; border-radius: 12px; border: 1.5px solid #bae6fd; background: #f0f9ff; }
.student-input-icon .form-control:focus { border-color: var(--student-primary); box-shadow: 0 0 0 4px rgba(2,132,199,.12); background: #fff; }
.student-input-icon input[type="password"] { padding-right: 2.4rem; }
.student-input-icon .password-toggle-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: none; background: none; color: #7391a3; padding: .2rem; line-height: 1; cursor: pointer;
}
.student-btn-primary {
  background: linear-gradient(120deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  background-size: 200% 200%; border: none; color: #fff; font-weight: 700;
  padding: .75rem 1rem; border-radius: 12px;
  box-shadow: 0 10px 24px rgba(2,132,199,.35);
  transition: transform .15s, box-shadow .15s, background-position .4s;
}
.student-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(2,132,199,.45); background-position: 100% 0; color: #fff; }
.student-btn-primary:disabled { opacity: .7; transform: none; cursor: not-allowed; }
.student-link { color: var(--student-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.student-link:hover { text-decoration: underline; color: var(--student-navy); }
.student-req { color: #ef4444; }

/* ---------- App shell ---------- */
body.student-app-body { background: var(--student-bg); min-height: 100vh; margin: 0; padding-bottom: 90px; }
.student-card {
  background: #fff; border-radius: var(--student-card-radius);
  box-shadow: 0 8px 24px rgba(3,60,90,.08); border: 1px solid rgba(3,60,90,.05);
}
.student-notif-unread { border-left: 4px solid var(--student-primary); }
.student-app-header {
  background: linear-gradient(120deg, var(--student-sky), var(--student-primary) 60%, var(--student-navy));
  color: #fff; padding: 14px 16px 20px; border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 28px rgba(2,132,199,.28);
  position: sticky; top: 0; z-index: 1030;
}
.student-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-profile-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.student-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Poppins', sans-serif;
}
.student-app-content { max-width: 900px; margin: 0 auto; padding: 16px; }
.student-header-icons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.student-header-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; text-decoration: none; transition: background .15s; cursor: pointer;
}
.student-header-icon-btn:hover { background: rgba(255,255,255,.3); color: #fff; }
.student-header-badge {
  position: absolute; top: -4px; right: -4px; background: #fff; color: #ef4444; font-size: .62rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ---------- ID Card link row + popup (mirrors library's id-card popup) ---------- */
.student-id-card-link-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.id-card {
  position: relative; width: 100%; max-width: 340px; margin: 0 auto; border-radius: 26px; overflow: hidden;
  box-shadow: 0 24px 56px rgba(3,60,90,.28); background: #fff;
}
.id-card-header {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  color: #fff; padding: 12px 18px 48px;
}
.id-card-header-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.id-card-header-blob-1 { width: 130px; height: 130px; top: -60px; right: -40px; }
.id-card-header-blob-2 { width: 80px; height: 80px; bottom: -10px; left: 45%; background: rgba(255,255,255,.18); }
.id-card-header-dots {
  position: absolute; top: 14px; right: 16px; width: 60px; height: 44px;
  background-image: radial-gradient(rgba(255,255,255,.4) 1.4px, transparent 1.4px);
  background-size: 9px 9px;
}
.id-card-header::after {
  content: ''; position: absolute; left: -20%; right: -20%; bottom: -1px; height: 30px;
  background: #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.id-card-header-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.id-card-logo {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; object-fit: contain;
  background: rgba(255,255,255,.95); padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.id-card-logo-fallback {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.id-card-header-text { line-height: 1.3; }
.id-card-header-text strong { display: block; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.05rem; }
.id-card-header-text small { display: block; font-size: .72rem; opacity: .85; font-weight: 500; }
.id-card-body { padding: 0 20px 22px; text-align: center; }
.id-card-avatar {
  position: relative; z-index: 2; width: 104px; height: 104px; border-radius: 50%; margin: -62px auto 12px; border: 5px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--student-primary), var(--student-navy)); font-family: 'Poppins', sans-serif;
  box-shadow: 0 10px 24px rgba(3,60,90,.3); overflow: hidden;
}
.id-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.id-card-name { font-weight: 800; font-size: 1.3rem; font-family: 'Poppins', sans-serif; color: var(--student-ink); }
.id-card-status {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 16px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.id-card-status.is-active { background: #dcfce7; color: #15803d; }
.id-card-status.is-inactive { background: #fee2e2; color: #b91c1c; }
.id-card-details { width: 100%; margin-top: 16px; background: var(--student-bg); border-radius: 14px; padding: 2px 12px; text-align: left; }
.id-card-detail-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #d6ecfa; }
.id-card-detail-row:last-child { border-bottom: none; }
.id-card-detail-icon {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: #fff; color: var(--student-primary); box-shadow: inset 0 0 0 1.5px #d6ecfa;
  display: flex; align-items: center; justify-content: center; font-size: .68rem;
}
.id-card-detail-label { flex: 1; font-size: .6rem; color: #7c8a94; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.id-card-detail-value { font-weight: 800; color: var(--student-ink); font-size: .78rem; text-align: right; white-space: nowrap; }
.id-card-qr { display: flex; justify-content: center; margin-top: 18px; padding: 14px; background: var(--student-bg); border-radius: 16px; }
.id-card-footer-tag {
  margin-top: 12px; font-size: .72rem; font-weight: 700; color: var(--student-primary);
  letter-spacing: .02em; display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------- Validity / Days Left card (mirrors library's days-left widget) ---------- */
.student-days-left-card {
  position: relative; overflow: hidden; border-radius: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  color: #fff; box-shadow: 0 10px 24px rgba(2,132,199,.28);
  display: flex; align-items: center; gap: 14px;
}
.student-days-left-blob { position: absolute; top: -40px; right: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.12); }
.student-days-left-number-wrap { position: relative; text-align: center; flex-shrink: 0; }
.student-days-left-number { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1; }
.student-days-left-label { font-size: .6rem; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .02em; }
.student-days-left-body { position: relative; flex: 1; min-width: 0; }
.student-days-left-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); margin: 4px 0 6px; overflow: hidden; }
.student-days-left-progress-bar { height: 100%; border-radius: 999px; background: #fff; }
.student-days-left-sub { font-size: .72rem; opacity: .9; }

/* ---------- Tests page: Active / Completed toggle ---------- */
.student-test-tabs { display: flex; gap: 8px; background: #fff; border-radius: 14px; padding: 5px; box-shadow: 0 8px 24px rgba(3,60,90,.08); border: 1px solid rgba(3,60,90,.05); }
.student-test-tab-btn {
  flex: 1; border: none; background: none; padding: 9px 10px; border-radius: 10px;
  font-weight: 700; font-size: .86rem; color: #7c8a94; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
}
.student-test-tab-btn .badge { font-size: .68rem; font-weight: 700; }
.student-test-tab-btn.active { background: var(--student-primary); color: #fff; }
.student-test-tab-btn.active .badge { background: rgba(255,255,255,.25) !important; color: #fff !important; }

/* ---------- Tests list cards ---------- */
.student-testlist-card {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 13px 14px; margin-bottom: 10px;
}
.student-testlist-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: #fff;
}
.student-testlist-icon.is-available { background: linear-gradient(135deg, #22c55e, #15803d); }
.student-testlist-icon.is-upcoming { background: linear-gradient(135deg, #f59e0b, #d97706); }
.student-testlist-icon.is-score { background: linear-gradient(135deg, var(--student-sky), var(--student-primary)); }
.student-testlist-body { flex: 1; min-width: 0; }
.student-testlist-title { font-weight: 800; color: var(--student-ink); font-size: .92rem; }
.student-testlist-meta { font-size: .74rem; color: var(--student-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.student-testlist-meta span { display: inline-flex; align-items: center; gap: 3px; }
.student-testlist-score-badge {
  flex-shrink: 0; text-align: center; padding: 4px 10px; border-radius: 12px; font-weight: 800; font-size: .82rem;
}
.student-testlist-score-badge.is-good { background: #dcfce7; color: #15803d; }
.student-testlist-score-badge.is-mid { background: #fef3c7; color: #92400e; }
.student-testlist-score-badge.is-low { background: #fee2e2; color: #b91c1c; }
.student-testlist-score-badge .pct-sub { display: block; font-size: .6rem; font-weight: 700; opacity: .8; }
.student-testlist-badge-pending {
  flex-shrink: 0; font-size: .68rem; font-weight: 700; color: var(--student-muted); background: var(--student-bg);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Bottom nav (mobile) ---------- */
.student-bottom-nav-colorful {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050;
  background: rgba(255,255,255,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(3,60,90,.2);
  display: flex; gap: 4px; border-radius: 22px; padding: 6px;
  border: 1px solid rgba(186,230,253,.8);
}
.student-bottom-nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: .5rem 0; color: #7391a3; text-decoration: none; font-size: .62rem; font-weight: 700;
  border-radius: 16px; transition: color .2s, background .2s, box-shadow .2s;
}
.student-bottom-nav-link i { font-size: 1.2rem; }
.student-bottom-nav-link.active {
  color: #fff; background: linear-gradient(135deg, var(--student-sky), var(--student-primary));
  box-shadow: 0 8px 18px rgba(2,132,199,.35);
}
.student-bottom-nav-link:not(.active):hover { color: var(--student-primary); background: var(--student-bg); }

/* ---------- Stat cards / hero ---------- */
.student-stat-grid .student-stat-card {
  background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 6px 18px rgba(3,60,90,.08); height: 100%;
}
.student-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(14,165,233,.12); color: var(--student-primary); font-size: 1.1rem; margin-bottom: 8px;
}
.student-stat-value { font-weight: 700; font-size: 1.1rem; color: var(--student-ink); }
.student-stat-label { font-size: .75rem; color: var(--student-muted); }

.student-welcome-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px 20px;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  color: #fff; box-shadow: 0 14px 34px rgba(2,132,199,.3);
}
.student-welcome-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.student-welcome-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.student-welcome-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }

/* ---------- Profile hero / info rows / payment rows ---------- */
.student-profile-hero {
  position: relative; overflow: hidden; text-align: center; border-radius: 22px; padding: 30px 20px;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  color: #fff; box-shadow: 0 14px 34px rgba(2,132,199,.3);
}
.student-profile-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.student-profile-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.student-profile-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }
.student-profile-hero-avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; font-family: 'Poppins', sans-serif;
}
.student-profile-status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff;
}
.student-profile-status-pill i { font-size: .5rem; color: #f1f5f9; }
.student-profile-status-pill.is-active i { color: #4ade80; }

.student-info-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e0f2fe; }
.student-info-row:last-child { border-bottom: none; padding-bottom: 2px; }
.student-info-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--student-bg); color: var(--student-primary); box-shadow: inset 0 0 0 1.5px #bae6fd;
  display: flex; align-items: center; justify-content: center;
}
.student-info-label { font-size: .68rem; color: var(--student-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.student-info-value { font-weight: 700; color: var(--student-ink); }

.student-payment-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--student-bg); border-radius: 14px; padding: 10px 14px;
}
.student-payment-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #fff; color: var(--student-primary); box-shadow: inset 0 0 0 1.5px #bae6fd;
  display: flex; align-items: center; justify-content: center;
}
.student-pay-status { font-size: .72rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.student-pay-status-pending { background: #fef3c7; color: #92400e; }
.student-pay-status-partial { background: #fef3c7; color: #92400e; }
.student-pay-status-paid { background: #dcfce7; color: #15803d; }
.student-pay-status-overdue { background: #fee2e2; color: #b91c1c; }

/* ---------- Test Take page ---------- */
.student-test-header {
  position: sticky; top: 0; z-index: 1020; margin: 0 -16px 14px; padding: 12px 16px 14px;
  background: linear-gradient(120deg, var(--student-sky), var(--student-primary) 60%, var(--student-navy));
  color: #fff; box-shadow: 0 10px 28px rgba(2,132,199,.28);
}
.student-test-header-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.student-test-title { font-weight: 800; font-family: 'Poppins', sans-serif; font-size: 1rem; }
.student-test-timer {
  display: flex; align-items: center; gap: 6px; font-weight: 800; font-family: 'Poppins', sans-serif; font-size: 1.05rem;
  background: rgba(255,255,255,.18); padding: 5px 12px; border-radius: 999px; flex-shrink: 0;
}
.student-test-timer.is-critical { background: #dc2626; animation: student-test-pulse 1s infinite; }
@keyframes student-test-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.student-test-progress-bar-wrap { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); margin-top: 10px; overflow: hidden; }
.student-test-progress-bar { height: 100%; border-radius: 999px; background: #fff; transition: width .25s; }
.student-test-progress-label { font-size: .7rem; opacity: .9; margin-top: 5px; }

.student-test-palette { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; }
.student-test-palette-item {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; border: none; font-weight: 700; font-size: .8rem;
  background: #fff; color: var(--student-muted); box-shadow: 0 4px 12px rgba(3,60,90,.1); cursor: pointer;
}
.student-test-palette-item.is-answered { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; }

.student-test-qcard { background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 16px; margin-bottom: 12px; scroll-margin-top: 150px; }
.student-test-qcard-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.student-test-qnum {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--student-bg); color: var(--student-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .84rem;
}
.student-test-qtext { font-weight: 700; color: var(--student-ink); flex: 1; }
.student-test-qmarks { font-size: .68rem; font-weight: 700; color: var(--student-muted); white-space: nowrap; margin-top: 3px; }

.student-test-option {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid #e0f2fe; border-radius: 13px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.student-test-option:last-child { margin-bottom: 0; }
.student-test-option:hover { border-color: var(--student-sky); }
.student-test-option.is-selected { border-color: var(--student-primary); background: var(--student-bg); }
.student-test-option-radio {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center;
}
.student-test-option.is-selected .student-test-option-radio { border-color: var(--student-primary); }
.student-test-option.is-selected .student-test-option-radio::after {
  content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--student-primary);
}
.student-test-option-label { font-size: .92rem; color: var(--student-ink); }
.student-test-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Review Answers (read-only, on result page) ---------- */
.student-test-option.is-review { cursor: default; }
.student-test-option.is-review:hover { border-color: #e0f2fe; }
.student-test-option.is-correct-answer { border-color: #22c55e; background: #f0fdf4; }
.student-test-option.is-correct-answer .student-test-option-radio { border-color: #22c55e; background: #22c55e; color: #fff; font-size: .7rem; }
.student-test-option.is-correct-answer .student-test-option-radio::after { content: none; }
.student-test-option.is-wrong-selected { border-color: #ef4444; background: #fef2f2; }
.student-test-option.is-wrong-selected .student-test-option-radio { border-color: #ef4444; background: #ef4444; color: #fff; font-size: .7rem; }
.student-test-option.is-wrong-selected .student-test-option-radio::after { content: none; }
.student-test-qcard-result-tag { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.student-test-qcard-result-tag.is-correct { background: #dcfce7; color: #15803d; }
.student-test-qcard-result-tag.is-wrong { background: #fee2e2; color: #b91c1c; }
.student-test-qcard-result-tag.is-skipped { background: var(--student-bg); color: var(--student-muted); }

/* ---------- PDF + OMR mode ---------- */
.student-test-omr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.student-test-omr-qnum {
  flex-shrink: 0; width: 28px; font-weight: 800; font-size: .85rem; color: var(--student-muted);
}
.student-test-omr-bubble { flex-shrink: 0; margin-bottom: 0 !important; padding: 0 !important; border: none !important; background: none !important; }
.student-test-omr-bubble .student-test-option-radio {
  width: 34px; height: 34px; font-weight: 800; font-size: .8rem; color: var(--student-muted);
  border: 1.5px solid #e0f2fe; transition: border-color .15s, background .15s, color .15s;
}
.student-test-omr-bubble:hover .student-test-option-radio { border-color: var(--student-sky); }
.student-test-omr-bubble.is-selected .student-test-option-radio {
  border-color: #22c55e; background: linear-gradient(135deg, #22c55e, #15803d); color: #fff;
}
.student-test-omr-bubble.is-selected .student-test-option-radio::after { content: none; }

.student-test-omr-scrollbox {
  max-height: 34vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 6px; margin-bottom: 14px;
}
.student-test-omr-scrollbox .student-test-qcard { box-shadow: none; margin-bottom: 4px; }
.student-test-omr-scrollbox .student-test-qcard:last-child { margin-bottom: 0; }

.student-test-pdf-viewer { background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 12px; margin-bottom: 14px; }
.student-test-pdf-canvas-wrap {
  position: relative; min-height: 160px; text-align: center;
  perspective: 1400px; overflow: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; max-height: 30vh;
}
.student-test-pdf-canvas-wrap.is-zoomed { text-align: left; touch-action: pan-x pan-y; }
.student-test-pdf-canvas-zoom { display: inline-block; transform-origin: top left; }
.student-test-pdf-canvas-wrap canvas { display: block; border-radius: 10px; box-shadow: 0 4px 16px rgba(3,60,90,.12); backface-visibility: hidden; margin: 0 auto; }
.student-test-pdf-canvas-wrap:not(.is-zoomed) canvas { max-width: 100%; }
.student-test-pdf-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px; color: var(--student-muted); font-size: .85rem; font-weight: 600;
}
.student-test-pdf-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.student-test-pdf-icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: none; background: var(--student-bg); color: var(--student-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: background .15s;
}
.student-test-pdf-icon-btn:hover { background: #e0f2fe; }
.student-test-pdf-page-indicator { font-size: .85rem; font-weight: 700; color: var(--student-ink); font-variant-numeric: tabular-nums; }

/* ---------- Test Result / Leaderboard ---------- */
.student-lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; margin-bottom: 6px;
}
.student-lb-row.is-me { background: var(--student-bg); box-shadow: inset 0 0 0 1.5px var(--student-sky); }
.student-lb-rank {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--student-bg); color: var(--student-muted);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem;
}
.student-lb-rank.is-gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.student-lb-rank.is-silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.student-lb-rank.is-bronze { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.student-lb-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--student-sky), var(--student-primary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; font-family: 'Poppins', sans-serif;
}
.student-lb-name { flex: 1; min-width: 0; font-weight: 700; color: var(--student-ink); font-size: .88rem; }
.student-lb-name .badge { font-size: .6rem; vertical-align: middle; }
.student-lb-score { text-align: right; flex-shrink: 0; }
.student-lb-score-marks { font-weight: 800; color: var(--student-ink); font-size: .9rem; }
.student-lb-score-pct { font-size: .68rem; color: var(--student-muted); }

/* ---------- Fees page ---------- */
.student-fee-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px; text-align: center;
  background: linear-gradient(135deg, #f97316, #dc2626 65%, #b91c1c); color: #fff;
  box-shadow: 0 14px 34px rgba(220,38,38,.28);
}
.student-fee-hero.is-clear { background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 60%, var(--student-navy)); box-shadow: 0 14px 34px rgba(2,132,199,.3); }
.student-fee-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.student-fee-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.student-fee-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }
.student-fee-hero-label { position: relative; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.student-fee-hero-amount { position: relative; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 2rem; margin-top: 2px; }
.student-fee-hero-sub { position: relative; font-size: .78rem; opacity: .9; margin-top: 4px; }

.student-fee-card { background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(3,60,90,.08); border: 1px solid rgba(3,60,90,.05); padding: 16px; }
.student-fee-card-head { display: flex; align-items: center; gap: 10px; }
.student-fee-type-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; background: linear-gradient(135deg, var(--student-sky), var(--student-primary));
}
.student-fee-progress { height: 7px; border-radius: 999px; background: var(--student-bg); overflow: hidden; margin: 12px 0 8px; }
.student-fee-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--student-sky), var(--student-primary)); }
.student-fee-progress-bar.is-complete { background: linear-gradient(90deg, #22c55e, #15803d); }
.student-fee-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.student-fee-chip { background: var(--student-bg); border-radius: 10px; padding: 6px 10px; font-size: .74rem; flex: 1; min-width: 90px; }
.student-fee-chip-label { color: var(--student-muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.student-fee-chip-value { font-weight: 800; color: var(--student-ink); }
.student-fee-chip.is-balance .student-fee-chip-value { color: #dc2626; }
.student-fee-chip.is-paid .student-fee-chip-value { color: #15803d; }
.student-fee-history-toggle {
  border: none; background: none; color: var(--student-primary); font-weight: 700; font-size: .78rem; padding: 0; margin-top: 12px;
  display: flex; align-items: center; gap: 4px;
}
.student-fee-history-toggle .bi-chevron-down { transition: transform .2s; }
.student-fee-history-toggle.open .bi-chevron-down { transform: rotate(180deg); }

/* ---------- Timetable / test cards ---------- */
.student-class-card { border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 14px; }
.student-class-time-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  padding: .3rem .65rem; border-radius: 999px; background: rgba(14,165,233,.12); color: var(--student-primary);
}

/* ---------- Timetable: day-grouped modern layout ---------- */
.student-tt-day-group { margin-bottom: 18px; }
.student-tt-day-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.student-tt-day-badge {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: #fff; box-shadow: 0 6px 18px rgba(3,60,90,.1);
  color: var(--student-ink); line-height: 1;
}
.student-tt-day-badge .num { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1rem; }
.student-tt-day-badge .mon { font-size: .58rem; font-weight: 700; text-transform: uppercase; color: var(--student-muted); margin-top: 1px; }
.student-tt-day-group.is-today .student-tt-day-badge {
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary)); color: #fff; box-shadow: 0 8px 20px rgba(2,132,199,.35);
}
.student-tt-day-group.is-today .student-tt-day-badge .mon { color: rgba(255,255,255,.85); }
.student-tt-day-title { font-weight: 800; font-family: 'Poppins', sans-serif; font-size: .95rem; color: var(--student-ink); }
.student-tt-day-sub { font-size: .72rem; color: var(--student-muted); }

.student-tt-class-row {
  position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(3,60,90,.08); padding: 12px 14px 12px 16px; margin-bottom: 10px; overflow: hidden;
}
.student-tt-class-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--student-sky), var(--student-primary));
}
.student-tt-class-row.is-now::before { background: linear-gradient(180deg, #22c55e, #15803d); }
.student-tt-class-time {
  flex-shrink: 0; text-align: center; width: 62px; font-size: .68rem; font-weight: 700; color: var(--student-primary);
  background: var(--student-bg); border-radius: 10px; padding: 6px 4px; line-height: 1.3;
}
.student-tt-class-body { flex: 1; min-width: 0; }
.student-tt-class-subject { font-weight: 800; color: var(--student-ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.student-tt-now-badge {
  font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff;
  background: #22c55e; padding: 2px 8px; border-radius: 999px;
}
.student-tt-class-meta { font-size: .74rem; color: var(--student-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.student-tt-class-meta span { display: inline-flex; align-items: center; gap: 4px; }
.student-test-status { font-size: .7rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.student-test-status-scheduled { background: #dbeafe; color: #1d4ed8; }
.student-test-status-completed { background: #dcfce7; color: #15803d; }
.student-score-badge {
  display: inline-block; font-size: .95rem; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--student-sky), var(--student-primary));
  padding: .25rem .75rem; border-radius: 999px;
}

/* ---------- Registration expiry warning modals ---------- */
.student-expiry-modal-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary));
  color: #fff; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(2,132,199,.3);
}
.student-expiry-modal-icon-urgent { background: linear-gradient(135deg, #f59e0b, var(--student-red)); box-shadow: 0 10px 22px rgba(220,38,38,.3); }

/* ---------- Success / confirmation modal (mirrors hostel/class success-modal) ---------- */
.student-success-modal { border: none; border-radius: 24px; overflow: hidden; }
.student-success-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--student-sky), var(--student-primary) 55%, var(--student-navy));
  color: #fff; text-align: center; padding: 34px 20px 42px;
}
.student-success-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.student-success-blob-1 { width: 140px; height: 140px; top: -60px; right: -40px; }
.student-success-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(7,89,133,.25); }
.student-success-check {
  position: relative; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--student-primary);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  margin: 0 auto 14px; box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.student-success-info { display: flex; flex-direction: column; gap: 10px; }
.student-success-row {
  display: flex; align-items: center; gap: 12px; background: var(--student-bg);
  border-radius: 14px; padding: 10px 14px;
}
.student-success-text small { display: block; color: var(--student-muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.student-success-text strong { font-size: 1rem; color: var(--student-ink); word-break: break-all; }
.student-success-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem;
}
.student-success-icon-sky { background: linear-gradient(135deg, var(--student-sky), var(--student-primary)); }
.student-success-icon-navy { background: linear-gradient(135deg, var(--student-primary), var(--student-navy)); }
.student-success-icon-green { background: linear-gradient(135deg, #059669, var(--student-cyan)); }

::placeholder { color: #93c5e8; opacity: 1; }

/* ---------- Complaints & Help (mirrors mess's mess-* / library's complaint-* classes) ---------- */
.student-mode-group { display: flex; gap: 8px; background: var(--student-bg); border-radius: 14px; padding: 4px; }
.student-mode-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 11px; border: none; background: transparent;
  color: var(--student-muted); font-weight: 700; font-size: .85rem; transition: background .15s, color .15s;
}
.student-mode-btn.active { background: #fff; color: var(--student-primary); box-shadow: 0 4px 12px rgba(2,132,199,.15); }

.student-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.student-category-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: 12px; border: 1.5px solid #bae6fd; background: var(--student-bg); color: var(--student-ink);
  font-size: .66rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .15s, background .15s, color .15s;
}
.student-category-chip i { font-size: 1.05rem; color: var(--student-primary); }
.student-category-chip:hover { border-color: var(--student-primary); }
.student-category-chip.active {
  background: linear-gradient(120deg, var(--student-sky), var(--student-primary) 60%, var(--student-navy));
  border-color: transparent; color: #fff;
}
.student-category-chip.active i { color: #fff; }

.student-photo-dropzone {
  border: 2px dashed #bae6fd; border-radius: 16px; background: var(--student-bg);
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--student-muted); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.student-photo-dropzone:hover { border-color: var(--student-primary); background: #fff; }
.student-photo-dropzone img { max-width: 100%; max-height: 180px; display: block; }
.student-photo-thumb { max-height: 130px; border-radius: 12px; border: 1px solid #bae6fd; display: block; }

.student-complaint-reply {
  background: var(--student-bg); border-radius: 12px; padding: 10px 12px; font-size: .85rem;
  border-left: 3px solid var(--student-primary); margin-top: 6px;
}
.student-complaint-reply i { color: var(--student-primary); }

/* Voice recorder - used both by students (voice complaint) and admin (voice
   reply); .recording pulses the mic button red while capturing. */
.student-record-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: 14px; border: 1.5px dashed #bae6fd;
  background: var(--student-bg); color: var(--student-primary); font-weight: 700; font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.student-record-btn:hover { border-color: var(--student-primary); }
.student-record-btn.recording {
  border-style: solid; border-color: var(--student-red); background: #fef2f2; color: var(--student-red);
  animation: studentRecordPulse 1.4s ease-in-out infinite;
}
@keyframes studentRecordPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.student-record-timer { font-variant-numeric: tabular-nums; }
.student-audio-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.student-audio-preview audio { flex: 1; height: 36px; }
