/* Portal Học sinh — giao diện sinh động, thân thiện lứa tuổi HS */
:root {
  --sp-sky: #0ea5e9;
  --sp-teal: #14b8a6;
  --sp-coral: #f97316;
  --sp-mint: #34d399;
  --sp-ink: #0f172a;
  --sp-muted: #64748b;
  --sp-cream: #f0f9ff;
  --sp-card: rgba(255, 255, 255, 0.92);
  --sp-radius: 1.25rem;
  --sp-shadow: 0 12px 40px rgba(14, 165, 233, 0.12);
  --sp-font: "Nunito", system-ui, sans-serif;
  --sp-display: "Fredoka", "Nunito", system-ui, sans-serif;
}

.sp-body {
  font-family: var(--sp-font);
  color: var(--sp-ink);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(56, 189, 248, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(45, 212, 191, 0.28), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(251, 146, 60, 0.12), transparent 55%),
    linear-gradient(180deg, #e0f2fe 0%, #f8fafc 45%, #ecfeff 100%);
  background-attachment: fixed;
}

.sp-body .page-header {
  background: transparent !important;
  border: 0 !important;
  padding: 0 0 1rem !important;
  margin-bottom: 0.5rem;
}
.sp-body .page-header h1 {
  font-family: var(--sp-display);
  font-weight: 600;
  font-size: 1.65rem;
  color: var(--sp-ink);
  letter-spacing: -0.02em;
}
.sp-body .page-header p {
  color: var(--sp-muted);
  margin-top: 0.25rem;
}

/* —— Nav —— */
.sp-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(14, 165, 233, 0.15);
  box-shadow: 0 4px 24px rgba(14, 165, 233, 0.08);
}
.sp-nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.sp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
  color: var(--sp-ink) !important;
  font-family: var(--sp-display);
  font-weight: 600;
  font-size: 1.15rem;
}
.sp-brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--sp-sky), var(--sp-teal));
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
  font-size: 1rem;
}
.sp-nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .sp-nav-links { display: flex; }
  .sp-nav-toggle { display: none !important; }
}
.sp-nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sp-muted);
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.sp-nav-links a:hover {
  background: rgba(14, 165, 233, 0.1);
  color: var(--sp-sky);
  transform: translateY(-1px);
}
.sp-nav-links a.is-active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(20, 184, 166, 0.18));
  color: #0369a1;
}
.sp-nav-toggle {
  border: 0;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
}
.sp-nav-links.is-open {
  display: flex;
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: calc(100% + 0.35rem);
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  padding: 0.75rem;
  border-radius: 1rem;
  box-shadow: var(--sp-shadow);
  border: 1px solid rgba(14, 165, 233, 0.15);
}
.sp-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--sp-ink);
  cursor: pointer;
}
.sp-user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 11rem;
  background: #fff;
  border-radius: 0.85rem;
  box-shadow: var(--sp-shadow);
  border: 1px solid rgba(14, 165, 233, 0.12);
  padding: 0.35rem;
  z-index: 50;
}
.sp-user-menu.is-open {
  display: block;
}
.sp-user-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  color: var(--sp-ink);
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 600;
}
.sp-user-menu a:hover { background: rgba(14, 165, 233, 0.08); }

.sp-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  position: relative;
}
.sp-flash {
  max-width: 72rem;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}
.sp-flash .sp-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  animation: sp-pop 0.35s ease;
}
.sp-alert-success { background: #d1fae5; color: #065f46; }
.sp-alert-danger { background: #fee2e2; color: #991b1b; }
.sp-alert-warning { background: #ffedd5; color: #9a3412; }
.sp-alert-info { background: #e0f2fe; color: #075985; }

.sp-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--sp-muted);
  font-size: 0.8rem;
}

/* —— Dashboard hero —— */
.sp-hero {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--sp-radius) + 0.25rem);
  padding: 1.5rem 1.5rem 1.35rem;
  margin-bottom: 1.25rem;
  color: #fff;
  background: linear-gradient(125deg, #0284c7 0%, #0d9488 55%, #f97316 130%);
  box-shadow: 0 16px 40px rgba(2, 132, 199, 0.28);
  animation: sp-rise 0.55s ease both;
}
.sp-hero h1 {
  font-family: var(--sp-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.sp-hero p { margin: 0; opacity: 0.92; font-weight: 600; }
.sp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 700;
}
.sp-hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.25;
  background: #fff;
  animation: sp-float 6s ease-in-out infinite;
}
.sp-hero-orb.a { width: 7rem; height: 7rem; right: -1rem; top: -2rem; }
.sp-hero-orb.b { width: 4rem; height: 4rem; right: 5rem; bottom: -1rem; animation-delay: -2s; }

.sp-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .sp-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.sp-stat {
  background: var(--sp-card);
  border-radius: var(--sp-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--sp-shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: sp-rise 0.55s ease both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.sp-stat:nth-child(1) { animation-delay: 0.05s; }
.sp-stat:nth-child(2) { animation-delay: 0.1s; }
.sp-stat:nth-child(3) { animation-delay: 0.15s; }
.sp-stat:nth-child(4) { animation-delay: 0.2s; }
.sp-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.18);
}
.sp-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 0.65rem;
  font-size: 1rem;
}
.sp-stat-icon.sky { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.sp-stat-icon.mint { background: linear-gradient(135deg, #6ee7b7, #059669); }
.sp-stat-icon.coral { background: linear-gradient(135deg, #fb923c, #ea580c); }
.sp-stat-icon.rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.sp-stat strong {
  display: block;
  font-family: var(--sp-display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--sp-ink);
}
.sp-stat span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sp-muted);
}

.sp-panel {
  background: var(--sp-card);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
  overflow: hidden;
  margin-bottom: 1rem;
  animation: sp-rise 0.55s ease both;
}
.sp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  font-family: var(--sp-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.sp-panel-body { padding: 1rem 1.1rem; }

.sp-quick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
.sp-quick a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  text-decoration: none !important;
  font-weight: 700;
  color: var(--sp-ink);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.08), rgba(20, 184, 166, 0.06));
  border: 1px solid rgba(14, 165, 233, 0.12);
  transition: transform 0.15s, background 0.2s;
}
.sp-quick a:hover {
  transform: translateX(4px);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.14), rgba(249, 115, 22, 0.08));
}
.sp-quick-ico {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.sp-quick-ico.lms { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.sp-quick-ico.counsel { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.sp-quick-ico.eval { background: linear-gradient(135deg, #fb923c, #f43f5e); }

.sp-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}
.sp-chip-orange { background: #f97316; }
.sp-chip-red { background: #ef4444; }
.sp-chip-cyan { background: #06b6d4; }
.sp-chip-green { background: #10b981; }
.sp-score {
  display: inline-flex;
  min-width: 2.5rem;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

/* Soften legacy hv-card inside student shell */
.sp-body .hv-card {
  border-radius: var(--sp-radius) !important;
  box-shadow: var(--sp-shadow) !important;
  border: 1px solid rgba(14, 165, 233, 0.1) !important;
  overflow: hidden;
}
.sp-body .hv-card-header,
.sp-body .hv-stat-card {
  font-family: var(--sp-display);
}
.sp-body .btn-primary {
  background: linear-gradient(135deg, var(--sp-sky), var(--sp-teal)) !important;
  border: 0 !important;
  font-weight: 800 !important;
  border-radius: 0.85rem !important;
}
.sp-body .hv-table th {
  font-size: 0.7rem !important;
  letter-spacing: 0.04em;
}

/* —— Login —— */
.sp-login-body {
  font-family: var(--sp-font);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.45), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(45, 212, 191, 0.4), transparent 35%),
    radial-gradient(circle at 70% 80%, rgba(251, 146, 60, 0.3), transparent 40%),
    linear-gradient(160deg, #0369a1 0%, #0f766e 55%, #c2410c 120%);
}
.sp-login-card {
  width: 100%;
  max-width: 26rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  animation: sp-rise 0.5s ease both;
}
.sp-login-top {
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6 70%, #fb923c);
  position: relative;
  overflow: hidden;
}
.sp-login-top h1 {
  font-family: var(--sp-display);
  font-size: 1.65rem;
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
}
.sp-login-top p { margin: 0; opacity: 0.92; font-weight: 600; font-size: 0.9rem; }
.sp-login-mascot {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto;
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  font-size: 2rem;
  animation: sp-float 4s ease-in-out infinite;
}
.sp-login-body-inner { padding: 1.5rem 1.75rem 1.25rem; }
.sp-ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 0;
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #fff !important;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none !important;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.sp-ms-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2, 132, 199, 0.4);
  color: #fff !important;
}
.sp-login-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.sp-login-links a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  margin: 0 0.35rem;
}
.sp-login-links a:hover { text-decoration: underline; }

@keyframes sp-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes sp-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-hero, .sp-stat, .sp-panel, .sp-login-card,
  .sp-hero-orb, .sp-login-mascot, .sp-flash .sp-alert {
    animation: none !important;
  }
}

/* —— Tự đánh giá (port UI hv_review_sheet) —— */
.rv-wrap {
  --rv-orange: #f97316;
  --rv-ink: #9a3412;
  --rv-muted: #7c2d12;
  --rv-border: #fdba74;
  --rv-soft: #fed7aa;
  --rv-cream: #fff7ed;
  --rv-shadow: 8px 8px 0 rgba(154, 52, 18, 0.12);
  max-width: 980px;
  margin: 0 auto;
}
.rv-hero {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--rv-border);
  border-radius: 1.75rem;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #dbeafe 100%);
  box-shadow: var(--rv-shadow);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1rem;
}
.rv-hero h2 {
  font-family: var(--sp-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  color: var(--rv-ink);
  margin: 0.35rem 0 0.5rem;
  line-height: 1.2;
}
.rv-hero p { color: var(--rv-muted); margin: 0; max-width: 40rem; line-height: 1.5; }
.rv-brand {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 0.35rem;
}
.rv-brand-badge {
  width: 2.6rem; height: 2.6rem; border-radius: 0.9rem;
  border: 3px solid #fb923c;
  background: linear-gradient(145deg, #fdba74, #f97316);
  color: #fff; font-family: var(--sp-display); font-weight: 800;
  display: grid; place-items: center;
}
.rv-brand-text {
  font-family: var(--sp-display); font-weight: 800; font-size: 1.25rem; color: #c2410c;
}
.rv-hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.rv-tips {
  display: grid; gap: 0.75rem; margin-bottom: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .rv-tips { grid-template-columns: repeat(3, 1fr); }
}
.rv-tip {
  border: 3px solid var(--rv-soft);
  border-radius: 1rem;
  background: rgba(255,255,255,0.9);
  padding: 0.9rem 1rem;
  box-shadow: 4px 4px 0 rgba(154, 52, 18, 0.08);
}
.rv-tip strong { display: block; color: var(--rv-ink); font-family: var(--sp-display); margin-bottom: 0.25rem; }
.rv-tip p { margin: 0; font-size: 0.9rem; color: var(--rv-muted); line-height: 1.45; }

.rv-form-shell {
  border: 3px solid var(--rv-border);
  border-radius: 1.5rem;
  background: rgba(255,255,255,0.95);
  box-shadow: var(--rv-shadow);
  padding: 1.15rem 1rem 1.25rem;
}
.rv-progress {
  height: 12px; border-radius: 999px; background: #ffedd5; border: 2px solid var(--rv-soft);
  overflow: hidden; margin-bottom: 1rem;
}
.rv-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #fb923c, #f97316 45%, #2563eb);
  transition: width 0.35s ease;
}
.rv-step-index { margin: 0; font-weight: 800; color: #ea580c; }
.rv-step-title {
  margin: 0.15rem 0; font-family: var(--sp-display); font-size: 1.4rem; color: var(--rv-ink);
}
.rv-step-hint { margin: 0 0 0.85rem; color: var(--rv-ink); opacity: 0.85; font-size: 0.95rem; }
.rv-dots { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.rv-dots button {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--rv-border); background: var(--rv-cream); padding: 0; cursor: pointer;
}
.rv-dots button.active { background: var(--rv-orange); transform: scale(1.15); }
.rv-dots button.done { background: #34d399; border-color: #10b981; }
.rv-step { display: none; }
.rv-step.active { display: grid; gap: 0.95rem; animation: sp-rise 0.3s ease; }
.rv-field { display: grid; gap: 0.3rem; }
.rv-field-label { font-weight: 800; color: var(--rv-ink); font-size: 0.98rem; }
.rv-field-hint { font-size: 0.86rem; color: #c2410c; opacity: 0.9; }
.rv-form-shell input,
.rv-form-shell textarea,
.rv-form-shell select {
  width: 100%;
  border: 3px solid var(--rv-border) !important;
  border-radius: 14px !important;
  background: #fffaf5 !important;
  color: #1e293b !important;
  font: inherit;
  padding: 0.75rem 0.85rem !important;
  outline: none;
}
.rv-form-shell input:focus,
.rv-form-shell textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.rv-subject {
  border: 3px solid var(--rv-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff7ed, #fff);
  padding: 0.9rem;
}
.rv-subject h3 {
  margin: 0 0 0.7rem; font-family: var(--sp-display); color: #c2410c; font-size: 1.15rem;
}
.rv-subject-grid {
  display: grid; gap: 0.75rem;
}
@media (min-width: 720px) {
  .rv-subject-grid { grid-template-columns: 1fr 1fr; }
}
.rv-error {
  margin: 1rem 0 0; padding: 0.75rem 0.9rem; border-radius: 14px;
  border: 2px solid #fecaca; background: #fef2f2; color: #b91c1c; font-weight: 700;
}
.rv-actions {
  display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.2rem; flex-wrap: wrap;
}
.rv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border: 3px solid transparent; border-radius: 999px;
  padding: 0.7rem 1.15rem; font-family: var(--sp-display); font-weight: 700;
  font-size: 1.02rem; cursor: pointer; text-decoration: none !important;
}
.rv-btn-primary {
  background: linear-gradient(145deg, #fb923c, #f97316);
  border-color: #ea580c; color: #fff7ed !important; box-shadow: 0 5px 0 #c2410c;
}
.rv-btn-accent {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  border-color: #1d4ed8; color: #fff !important; box-shadow: 0 5px 0 #1e3a8a;
}
.rv-btn-ghost {
  background: #fff; border-color: var(--rv-soft); color: var(--rv-ink) !important;
}
.rv-done {
  border: 3px solid #86efac; border-radius: 1.25rem; background: #f0fdf4;
  padding: 1.25rem; text-align: center;
}
.rv-done h3 { font-family: var(--sp-display); color: #166534; margin: 0 0 0.5rem; }
.rv-form-shell .hidden,
.rv-actions .hidden,
.rv-error.hidden { display: none !important; }
.rv-form-shell input:disabled {
  opacity: 0.85;
  background: #fff1e6 !important;
  cursor: not-allowed;
}
