:root {
  --hsc-ink: #17324d;
  --hsc-muted: #5e7084;
  --hsc-line: rgba(23, 50, 77, 0.12);
  --hsc-surface: rgba(255, 255, 255, 0.94);
  --hsc-blue: #2563eb;
  --hsc-teal: #0f766e;
  --hsc-green: #10b981;
  --hsc-amber: #f59e0b;
  --hsc-rose: #e11d48;
  --hsc-violet: #7c3aed;
  --hsc-shadow: 0 18px 48px rgba(25, 54, 91, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body.hsc-auth-body,
body.hsc-dashboard-body {
  min-height: 100vh;
  margin: 0;
  color: var(--hsc-ink);
  font-family: 'Sarabun', 'Prompt', Tahoma, sans-serif !important;
  background:
    linear-gradient(180deg, rgba(242, 248, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 44%, rgba(240, 253, 250, 0.95) 100%);
}

body.hsc-auth-body a,
body.hsc-dashboard-body a {
  text-decoration: none;
}

.hsc-portal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 0;
  border-bottom: 1px solid var(--hsc-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 26px rgba(23, 50, 77, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hsc-portal-nav .container-fluid {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  padding: 0;
  gap: 14px;
}

.hsc-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: var(--hsc-ink) !important;
}

.hsc-nav-brand img,
.hsc-auth-logo img,
.hsc-dashboard-avatar img {
  display: block;
  object-fit: cover;
}

.hsc-nav-brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
}

.hsc-nav-brand span {
  display: block;
  overflow: hidden;
  max-width: 360px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hsc-nav-brand small {
  display: block;
  color: var(--hsc-muted);
  font-size: 12px;
  font-weight: 500;
}

.hsc-menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--hsc-line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.hsc-portal-nav .navbar-nav {
  gap: 6px;
}

.hsc-portal-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px !important;
  border-radius: 8px;
  color: #31445a !important;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.hsc-portal-nav .nav-link:hover,
.hsc-portal-nav .nav-link:focus {
  color: var(--hsc-blue) !important;
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.hsc-auth-main,
.hsc-dashboard {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
}

.hsc-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 24px;
  align-items: stretch;
}

.hsc-auth-hero,
.hsc-dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(9, 43, 74, 0.92) 0%, rgba(15, 92, 98, 0.78) 52%, rgba(255, 255, 255, 0.1) 100%),
    url('../../image/baner01.jpg?v=20260902') center / cover no-repeat;
  box-shadow: var(--hsc-shadow);
}

.hsc-auth-hero {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 5vw, 46px);
}

.hsc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 13px;
  font-weight: 700;
}

.hsc-auth-hero h1,
.hsc-dashboard-hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.hsc-auth-hero p,
.hsc-dashboard-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  line-height: 1.75;
}

.hsc-hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.hsc-hero-meta span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.hsc-auth-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--hsc-line);
  border-radius: 8px;
  background: var(--hsc-surface);
  box-shadow: var(--hsc-shadow);
}

.hsc-auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hsc-auth-logo img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.18);
}

.hsc-auth-logo h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.hsc-auth-logo p,
.hsc-form-note {
  margin: 4px 0 0;
  color: var(--hsc-muted);
  font-size: 14px;
  line-height: 1.6;
}

.hsc-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 8px;
  color: #075985;
  background: rgba(14, 165, 233, 0.12);
  font-size: 14px;
  font-weight: 700;
}

.hsc-role-master .hsc-role-badge {
  color: #6d2872;
  background: rgba(225, 29, 72, 0.1);
}

.hsc-role-student .hsc-role-badge {
  color: #036047;
  background: rgba(16, 185, 129, 0.12);
}

.hsc-role-parent .hsc-role-badge {
  color: #075985;
  background: rgba(37, 99, 235, 0.1);
}

.hsc-alert {
  border: 1px solid rgba(225, 29, 72, 0.18);
  border-radius: 8px;
  background: rgba(225, 29, 72, 0.08);
  color: #991b1b;
  font-size: 14px;
  line-height: 1.65;
}

.hsc-form {
  display: grid;
  gap: 14px;
}

.hsc-field label {
  display: block;
  margin: 0 0 7px;
  color: #33465b;
  font-size: 14px;
  font-weight: 700;
}

.hsc-input-wrap {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--hsc-line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hsc-input-wrap:focus-within {
  border-color: rgba(37, 99, 235, 0.52);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hsc-input-wrap i {
  width: 46px;
  color: var(--hsc-teal);
  text-align: center;
}

.hsc-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  color: var(--hsc-ink);
  background: transparent;
  font: inherit;
}

.hsc-input-wrap input::placeholder {
  color: #94a3b8;
  font-size: 14px;
  text-align: left;
}

.hsc-password-toggle {
  width: 46px;
  height: 46px;
  border: 0;
  color: #597089;
  background: transparent;
  cursor: pointer;
}

.hsc-checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hsc-muted);
  font-size: 14px;
}

.hsc-checkbox-line input {
  width: 19px;
  height: 19px;
  accent-color: var(--hsc-teal);
}

.hsc-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--hsc-teal), var(--hsc-blue));
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hsc-submit:hover,
.hsc-submit:focus {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.28);
}

.hsc-expired {
  width: min(640px, calc(100% - 32px));
  margin: 38px auto;
  padding: 28px;
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 8px;
  color: #991b1b;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--hsc-shadow);
  text-align: center;
}

.hsc-expired i {
  display: block;
  margin-bottom: 12px;
  color: var(--hsc-rose);
  font-size: 42px;
}

.hsc-auth-footer {
  margin-top: 18px;
  color: var(--hsc-muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.hsc-dashboard {
  display: grid;
  gap: 18px;
}

.hsc-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(22px, 4vw, 34px);
}

.hsc-dashboard-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.hsc-dashboard-user {
  min-width: min(320px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--hsc-ink);
}

.hsc-dashboard-user strong {
  display: block;
  margin-bottom: 3px;
  font-size: 18px;
  line-height: 1.35;
}

.hsc-dashboard-user span,
.hsc-dashboard-user a {
  color: var(--hsc-muted);
  font-size: 14px;
  line-height: 1.6;
}

.hsc-dashboard-user a {
  color: var(--hsc-blue);
  font-weight: 700;
}

.hsc-dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hsc-ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--hsc-line);
  border-radius: 8px;
  color: var(--hsc-ink);
  background: #ffffff;
  font-weight: 700;
}

.hsc-ghost-link:hover,
.hsc-ghost-link:focus {
  color: var(--hsc-blue);
  border-color: rgba(37, 99, 235, 0.24);
}

.hsc-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 14px;
}

.hsc-menu-grid form {
  height: 100%;
  margin: 0;
}

.hsc-menu-grid form .hsc-action-card {
  height: 100%;
}

.hsc-action-card {
  position: relative;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--hsc-line);
  border-radius: 8px;
  color: var(--hsc-ink) !important;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 50, 77, 0.09);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button.hsc-action-card {
  font: inherit;
  cursor: pointer;
}

.hsc-action-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: var(--hsc-accent, linear-gradient(135deg, var(--hsc-teal), var(--hsc-blue)));
}

.hsc-action-card:hover,
.hsc-action-card:focus {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 18px 40px rgba(23, 50, 77, 0.15);
}

.hsc-action-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--hsc-accent, linear-gradient(135deg, var(--hsc-teal), var(--hsc-blue)));
  font-size: 21px;
  box-shadow: 0 10px 22px rgba(23, 50, 77, 0.15);
}

.hsc-action-card h3 {
  margin: 14px 0 5px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.hsc-action-card p {
  margin: 0;
  color: var(--hsc-muted);
  font-size: 13px;
  line-height: 1.55;
}

.hsc-action-foot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #23445f;
  font-size: 14px;
  font-weight: 700;
}

.hsc-card-blue { --hsc-accent: linear-gradient(135deg, #2563eb, #0f766e); }
.hsc-card-green { --hsc-accent: linear-gradient(135deg, #0f766e, #10b981); }
.hsc-card-amber { --hsc-accent: linear-gradient(135deg, #f59e0b, #ef4444); }
.hsc-card-rose { --hsc-accent: linear-gradient(135deg, #e11d48, #7c3aed); }
.hsc-card-violet { --hsc-accent: linear-gradient(135deg, #7c3aed, #2563eb); }
.hsc-card-slate { --hsc-accent: linear-gradient(135deg, #475569, #0f766e); }

.hsc-dashboard-footer {
  padding: 16px 18px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(240, 253, 250, 0.95), rgba(255, 251, 235, 0.9));
  color: #31445a;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.hsc-student-top {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.hsc-profile-panel,
.hsc-score-panel {
  border: 1px solid var(--hsc-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 50, 77, 0.09);
}

.hsc-profile-panel {
  padding: 18px;
  text-align: center;
}

.hsc-dashboard-avatar {
  display: block;
  width: 118px;
  height: 118px;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 4px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(23, 50, 77, 0.18);
}

.hsc-dashboard-avatar img {
  width: 100%;
  height: 100%;
}

.hsc-profile-panel h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
}

.hsc-profile-panel p {
  margin: 5px 0 0;
  color: var(--hsc-muted);
}

.hsc-score-panel {
  padding: 18px;
}

.hsc-score-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.hsc-score-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.hsc-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hsc-score-card {
  min-height: 116px;
  padding: 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--hsc-score-bg, linear-gradient(135deg, var(--hsc-teal), var(--hsc-blue)));
}

.hsc-score-card span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.92;
}

.hsc-score-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1;
}

.hsc-score-good { --hsc-score-bg: linear-gradient(135deg, #0f766e, #10b981); }
.hsc-score-bad { --hsc-score-bg: linear-gradient(135deg, #e11d48, #f59e0b); }
.hsc-score-total { --hsc-score-bg: linear-gradient(135deg, #2563eb, #7c3aed); }

.hsc-disabled-card {
  opacity: 0.72;
  pointer-events: none;
}

.hsc-auth-body .container,
.hsc-dashboard-body .container {
  max-width: none;
}

@media (max-width: 991px) {
  .hsc-portal-nav .navbar-collapse {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--hsc-line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(23, 50, 77, 0.14);
  }

  .hsc-portal-nav .nav-link {
    width: 100%;
  }

  .hsc-auth-shell,
  .hsc-dashboard-hero,
  .hsc-student-top {
    grid-template-columns: 1fr;
  }

  .hsc-auth-hero {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .hsc-portal-nav .container-fluid,
  .hsc-auth-main,
  .hsc-dashboard {
    width: min(100% - 24px, 1120px);
  }

  .hsc-nav-brand span {
    max-width: calc(100vw - 142px);
    font-size: 14px;
  }

  .hsc-auth-main,
  .hsc-dashboard {
    margin-top: 18px;
  }

  .hsc-auth-hero,
  .hsc-dashboard-hero {
    background:
      linear-gradient(180deg, rgba(9, 43, 74, 0.92) 0%, rgba(15, 92, 98, 0.84) 70%, rgba(9, 43, 74, 0.74) 100%),
      url('../../image/baner01.jpg?v=20260902') center / cover no-repeat;
  }

  .hsc-auth-hero h1,
  .hsc-dashboard-hero h1 {
    font-size: 30px;
  }

  .hsc-hero-meta,
  .hsc-score-grid {
    grid-template-columns: 1fr;
  }

  .hsc-auth-logo {
    align-items: flex-start;
  }

  .hsc-auth-logo img {
    width: 58px;
    height: 58px;
  }

  .hsc-menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
