:root {
  color-scheme: light;
  --md-sys-color-primary: #b01f2b;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffd9dc;
  --md-sys-color-on-primary-container: #410009;
  --md-sys-color-secondary: #5f5658;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #f5dde0;
  --md-sys-color-on-secondary-container: #25191c;
  --md-sys-color-background: #f8f3f4;
  --md-sys-color-on-background: #181114;
  --md-sys-color-surface: rgba(255, 250, 251, 0.84);
  --md-sys-color-surface-strong: #ffffff;
  --md-sys-color-surface-variant: rgba(247, 232, 234, 0.92);
  --md-sys-color-on-surface: #181114;
  --md-sys-color-on-surface-variant: #675c5f;
  --md-sys-color-outline: rgba(103, 92, 95, 0.18);
  --md-sys-color-outline-strong: rgba(24, 17, 20, 0.14);
  --md-sys-color-shadow: rgba(46, 11, 14, 0.14);
  --md-sys-color-error: #8d1117;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffd9dc;
  --md-sys-color-on-error-container: #410009;

  --bg: var(--md-sys-color-background);
  --surface: var(--md-sys-color-surface);
  --surface-strong: var(--md-sys-color-surface-strong);
  --surface-variant: var(--md-sys-color-surface-variant);
  --border: var(--md-sys-color-outline);
  --text: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --accent: var(--md-sys-color-primary);
  --accent-soft: rgba(176, 31, 43, 0.12);
  --accent-soft-strong: rgba(176, 31, 43, 0.18);
  --neutral-soft: rgba(24, 17, 20, 0.06);
  --warn: #5f5658;
  --warn-soft: rgba(95, 86, 88, 0.12);
  --danger: var(--md-sys-color-error);
  --danger-soft: rgba(141, 17, 23, 0.12);
  --shadow: 0 24px 72px var(--md-sys-color-shadow);
  --shadow-strong: 0 42px 120px rgba(46, 11, 14, 0.2);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --md-sys-color-primary: #ffb3ba;
    --md-sys-color-on-primary: #680013;
    --md-sys-color-primary-container: #90001d;
    --md-sys-color-on-primary-container: #ffd9dc;
    --md-sys-color-secondary: #d8c1c4;
    --md-sys-color-on-secondary: #3a2d30;
    --md-sys-color-secondary-container: #524347;
    --md-sys-color-on-secondary-container: #f5dde0;
    --md-sys-color-background: #121012;
    --md-sys-color-on-background: #ece0e2;
    --md-sys-color-surface: rgba(22, 18, 20, 0.82);
    --md-sys-color-surface-strong: #191416;
    --md-sys-color-surface-variant: rgba(40, 30, 34, 0.96);
    --md-sys-color-on-surface: #ece0e2;
    --md-sys-color-on-surface-variant: #d3c2c5;
    --md-sys-color-outline: rgba(211, 194, 197, 0.18);
    --md-sys-color-outline-strong: rgba(255, 255, 255, 0.08);
    --md-sys-color-shadow: rgba(0, 0, 0, 0.42);
    --md-sys-color-error: #ffb3ba;
    --md-sys-color-on-error: #680013;
    --md-sys-color-error-container: #93001f;
    --md-sys-color-on-error-container: #ffd9dc;

    --accent-soft: rgba(255, 179, 186, 0.16);
    --accent-soft-strong: rgba(255, 179, 186, 0.22);
    --neutral-soft: rgba(255, 255, 255, 0.06);
    --warn: #d3c2c5;
    --warn-soft: rgba(211, 194, 197, 0.12);
    --danger-soft: rgba(255, 179, 186, 0.16);
    --shadow: 0 26px 72px var(--md-sys-color-shadow);
    --shadow-strong: 0 48px 132px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(176, 31, 43, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(24, 17, 20, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 88%, #ffffff 12%) 50%, var(--surface-variant) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.background-grid,
.background-orb {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.background-grid {
  background-image:
    linear-gradient(rgba(24, 17, 20, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 17, 20, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 94%);
}

.background-orb {
  filter: blur(42px);
  opacity: 0.8;
}

.orb-primary {
  inset: auto auto 60% 3%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(176, 31, 43, 0.16);
  animation: float-orb 14s ease-in-out infinite;
}

.orb-secondary {
  inset: 16% 5% auto auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  animation: float-orb 18s ease-in-out infinite reverse;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: stretch;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 34px;
  min-height: 680px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  animation: fade-up 0.6s cubic-bezier(0.2, 0, 0, 1) both;
}

.hero::before,
.login-panel::before {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.hero::before {
  top: -110px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(176, 31, 43, 0.18), transparent 72%);
  transform: rotate(18deg);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
}

.brand-lockup img {
  display: block;
  width: auto;
  height: 46px;
}

.brand-badge,
.feature-chip,
.tag,
.stat-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.brand-badge {
  background: var(--neutral-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.65rem, 5vw, 4.7rem);
  line-height: 0.96;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1.02;
}

h3 {
  font-size: 1.4rem;
}

.hero-copy,
.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy {
  max-width: 56ch;
  font-size: 1.04rem;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-chip {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--border);
  color: var(--text);
}

.hero-highlights {
  display: grid;
  gap: 14px;
}

.highlight-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--border);
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.highlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(176, 31, 43, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.highlight-card .material-symbols-outlined {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.highlight-card strong {
  display: block;
  margin-bottom: 4px;
}

.highlight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-panel {
  padding: 32px;
  display: grid;
  gap: 24px;
  align-content: start;
  min-height: 680px;
  animation: fade-up 0.75s cubic-bezier(0.2, 0, 0, 1) both;
}

.login-panel::before {
  top: -80px;
  left: auto;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 31, 43, 0.18), transparent 72%);
}

.login-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

.login-icon {
  width: 68px;
  height: 68px;
  border-radius: 24px 24px 24px 12px;
  background: linear-gradient(180deg, var(--accent-soft-strong), var(--accent-soft));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-icon .material-symbols-outlined {
  font-size: 34px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.md-field {
  display: grid;
  gap: 8px;
}

label span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 15px 18px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

input:hover {
  transform: translateY(-1px);
}

input:focus {
  outline: none;
  border-color: rgba(176, 31, 43, 0.6);
  box-shadow: 0 0 0 5px rgba(176, 31, 43, 0.14);
  background: var(--surface-strong);
}

button,
.quick-access-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

button:hover,
.quick-access-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.58;
  cursor: progress;
  transform: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.quick-access-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-button {
  background: var(--accent);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 14px 28px rgba(176, 31, 43, 0.22);
}

.primary-button:hover {
  box-shadow: 0 18px 36px rgba(176, 31, 43, 0.28);
}

.primary-button-lg {
  min-height: 52px;
  font-size: 0.98rem;
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent);
}

.ghost-button {
  background: var(--neutral-soft);
  color: var(--text);
}

.access-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.access-divider p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.access-divider span {
  height: 1px;
  background: var(--border);
}

.quick-access-grid {
  display: grid;
  gap: 12px;
}

.quick-access-button {
  min-height: 56px;
  justify-content: flex-start;
  border-radius: 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.54);
  color: var(--text);
}

.quick-access-button small {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-meta {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-variant);
}

.auth-meta-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  color: var(--muted);
  line-height: 1.6;
}

.error-banner,
.status-banner {
  border-radius: var(--radius-md);
  padding: 15px 16px;
  border: 1px solid transparent;
  line-height: 1.55;
}

.error-banner {
  margin: 0;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: rgba(141, 17, 23, 0.2);
  animation: fade-up 0.28s ease both;
}

.dashboard.hidden,
.hidden {
  display: none;
}

.dashboard {
  display: grid;
  gap: 18px;
  margin-top: 12px;
  animation: fade-up 0.5s ease both;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.summary-card span {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  margin-top: 8px;
}

.status-banner {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(95, 86, 88, 0.16);
}

.status-banner.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(141, 17, 23, 0.18);
}

.cards {
  display: grid;
  gap: 18px;
}

.student-card {
  padding: 22px;
  animation: fade-up 0.4s ease-out both;
}

.student-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.student-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.student-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 22px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 8px 12px;
  margin: 12px 0 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  word-break: break-word;
}

.tag.ok,
.status-pill.pending-match,
.stat-chip.pending-match {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.warn,
.status-pill.matched-no-student-pending,
.stat-chip.matched-no-student-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag.error,
.status-pill.error,
.stat-chip.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.idle,
.status-pill.not-found,
.stat-chip.not-found {
  background: var(--neutral-soft);
  color: var(--muted);
}

.document-block {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
}

.document-block h5 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.document-meta,
.document-tags,
.action-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.action-card {
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(176, 31, 43, 0.14);
}

.action-card.other {
  background: var(--warn-soft);
  border-color: rgba(95, 86, 88, 0.14);
}

.action-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.action-card button {
  margin-top: 12px;
}

.error-text {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

:focus-visible {
  outline: 3px solid rgba(176, 31, 43, 0.22);
  outline-offset: 3px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-orb {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(10px, -14px, 0);
  }
}

@media (max-width: 960px) {
  .layout {
    width: min(100%, calc(100% - 24px));
    padding: 24px 0 56px;
  }

  .login-shell,
  .student-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .login-panel {
    min-height: auto;
  }

  .hero {
    padding: 28px;
  }

  .toolbar,
  .student-card-header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .layout {
    width: min(100%, calc(100% - 18px));
  }

  .hero,
  .login-panel,
  .student-card,
  .summary-card {
    padding: 22px;
  }

  .brand-row,
  .login-card-head,
  .action-card-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .brand-row {
    justify-content: start;
  }

  .brand-badge {
    width: max-content;
  }

  .quick-access-button {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 20px;
  }

  .quick-access-button small {
    margin-left: 0;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .action-card button {
    width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

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