:root {
  --wine: #681f2a;
  --wine-dark: #4d1621;
  --wine-soft: #f2e5e7;
  --cream: #f5f1eb;
  --paper: #fffdf9;
  --paper-strong: #ffffff;
  --ink: #292321;
  --muted: #706761;
  --line: #e1d9d1;
  --line-strong: #cfc3b9;
  --gold: #b58a3b;
  --gold-soft: #f5ecd8;
  --green: #244f40;
  --green-soft: #e5efe9;
  --slate: #58636a;
  --danger: #8a3037;
  --danger-soft: #f7e6e7;
  --shadow-sm: 0 2px 8px rgba(52, 37, 31, 0.06);
  --shadow-md: 0 12px 32px rgba(52, 37, 31, 0.09);
  --radius-md: 14px;
  --radius-lg: 20px;
  --topbar-height: 64px;
  --sidebar-width: 270px;
  --sidebar-collapsed: 76px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

body,
button,
input,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
summary {
  font: inherit;
}

button,
summary,
input[type="file"] {
  cursor: pointer;
}

img,
svg {
  display: block;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(181, 138, 59, 0.48);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--wine);
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button[aria-busy="true"]::after {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.button-primary {
  color: #fff;
  background: var(--wine);
  box-shadow: 0 5px 14px rgba(104, 31, 42, 0.18);
}

.button-primary:hover {
  background: var(--wine-dark);
}

.button-secondary {
  color: var(--wine);
  border-color: var(--line-strong);
  background: var(--paper-strong);
}

.button-secondary:hover {
  border-color: var(--wine);
  background: var(--wine-soft);
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.button-danger-secondary {
  color: var(--danger);
  border-color: #dbb5b8;
  background: #fff9f9;
}

.button-danger-secondary:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.button-wide {
  width: 100%;
}

.button-compact {
  min-height: 36px;
  padding: 7px 12px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
}

.icon-button:hover {
  background: #f0ebe5;
}

.text-link,
.back-link {
  color: var(--wine);
  font-size: 13px;
  font-weight: 750;
}

.text-link:hover,
.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
}

.eyebrow,
.section-kicker,
.resource-type {
  color: var(--wine);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.alert,
.inline-message,
.toast-message {
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
}

.alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #dfb5b8;
  color: #78272e;
  background: var(--danger-soft);
}

.inline-message {
  padding: 14px 16px;
  color: var(--muted);
  background: #f6f1eb;
}

.toast-message {
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 18px auto;
  padding: 11px 14px;
  border: 1px solid #bdd3c5;
  color: var(--green);
  background: #f5fbf7;
  box-shadow: var(--shadow-sm);
  transition: opacity 250ms ease, transform 250ms ease;
}

.toast-message > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
}

.toast-message.is-hiding {
  opacity: 0;
  transform: translateY(-5px);
}

.topbar,
.login-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(16px);
}

.login-topbar {
  justify-content: space-between;
  padding-right: max(28px, env(safe-area-inset-right));
  padding-left: max(28px, env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand span {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  color: var(--wine);
  letter-spacing: 0.03em;
}

.menu-button {
  margin-right: 7px;
}

.top-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 10px;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 7px 4px 4px;
  border-radius: 24px;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu summary:hover,
.user-menu[open] summary {
  background: #f0ebe5;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.user-name {
  max-width: 180px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu summary svg {
  width: 15px;
  height: 15px;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-md);
}

.user-menu-identity {
  display: grid;
  gap: 2px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.user-menu-identity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.user-menu-identity span {
  color: var(--muted);
  font-size: 11px;
}

.user-menu-panel form {
  margin: 0;
}

.user-menu-action {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 12px 15px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.user-menu-action:hover {
  background: var(--danger-soft);
}

.app-frame {
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--paper);
  transition: width 180ms ease, transform 180ms ease;
}

.sidebar-nav {
  overflow-y: auto;
  padding: 14px 10px 18px;
  scrollbar-width: thin;
}

.sidebar-group {
  display: grid;
  gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-link,
.sidebar-course {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  gap: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #4f4843;
}

.sidebar-link:hover,
.sidebar-course:hover {
  background: #f3eee8;
}

.sidebar-link.active,
.sidebar-course.active {
  color: var(--wine);
  background: var(--wine-soft);
  font-weight: 750;
}

.sidebar-link svg {
  flex: 0 0 auto;
}

.sidebar-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-courses {
  padding-top: 16px;
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-empty {
  margin: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.course-dot {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--course-color);
  font-size: 10px;
  font-weight: 850;
}

.sidebar-course-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.sidebar-course-copy strong,
.sidebar-course-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-course-copy strong {
  font-size: 12px;
}

.sidebar-course-copy small {
  color: var(--muted);
  font-size: 10px;
}

.sidebar-collapse {
  display: flex;
  align-items: center;
  min-height: 47px;
  margin-top: auto;
  gap: 13px;
  padding: 10px 21px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-collapse:hover {
  color: var(--wine);
  background: #f3eee8;
}

.sidebar-overlay {
  display: none;
}

.app-content {
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 180ms ease;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-collapsed .app-content {
  margin-left: var(--sidebar-collapsed);
}

.sidebar-collapsed .sidebar-link,
.sidebar-collapsed .sidebar-course {
  justify-content: center;
  padding-right: 8px;
  padding-left: 8px;
}

.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-course-copy,
.sidebar-collapsed .sidebar-label span:first-child,
.sidebar-collapsed .sidebar-empty,
.sidebar-collapsed .sidebar-collapse span {
  display: none;
}

.sidebar-collapsed .sidebar-label {
  justify-content: center;
}

.sidebar-collapsed .sidebar-collapse {
  justify-content: center;
  padding: 10px;
}

.sidebar-collapsed .sidebar-collapse svg {
  transform: rotate(180deg);
}

.page-shell {
  width: min(100% - 48px, 1220px);
  margin: 0 auto;
  padding: 34px 0 70px;
}

.narrow-page-shell,
.form-page-shell,
.review-page-shell {
  max-width: 980px;
}

.page-heading,
.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1,
.page-heading h2,
.task-form-heading h1 {
  margin: 5px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-heading p,
.task-form-heading p {
  margin: 0;
  color: var(--muted);
}

.count-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 11px;
  font-weight: 800;
}

.section-heading-row {
  margin-bottom: 16px;
}

.section-heading-row h2 {
  margin: 3px 0 0;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.dashboard-section {
  margin-top: 34px;
}

.dashboard-heading {
  margin-bottom: 4px;
}

.upcoming-list,
.pending-list,
.task-list,
.people-list,
.submission-student-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.upcoming-item {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--line);
}

.upcoming-item:last-child,
.pending-row:last-child,
.task-row:last-child,
.person-row:last-child,
.submission-student-row:last-child {
  border-bottom: 0;
}

.upcoming-item:hover,
.pending-row:hover,
.task-row:hover,
a.submission-student-row:hover {
  background: #faf7f3;
}

.course-accent {
  align-self: stretch;
  border-radius: 0 5px 5px 0;
  background: var(--course-color);
}

.upcoming-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.upcoming-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-date {
  color: var(--wine);
  font-size: 12px;
  font-weight: 800;
}

.row-arrow {
  color: var(--muted);
  font-size: 18px;
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 25px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 253, 249, 0.58);
}

.empty-state-inline {
  min-height: 98px;
}

.empty-state-large {
  min-height: 220px;
  justify-content: center;
}

.empty-state h1,
.empty-state h2,
.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h1,
.empty-state h2,
.empty-state h3 {
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  margin-top: 4px;
}

.empty-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 19px;
  font-weight: 750;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.course-card {
  --course-color: var(--wine);
  display: flex;
  min-width: 0;
  min-height: 214px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.course-card:hover {
  border-color: var(--course-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.course-card-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  gap: 12px;
  padding: 11px 15px;
  color: #fff;
  background: var(--course-color);
}

.course-card-band > span:first-child {
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-badge,
.hero-role {
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
}

.course-card-content {
  display: grid;
  align-content: start;
  min-height: 105px;
  padding: 17px 16px 10px;
}

.course-card-content h3 {
  display: -webkit-box;
  margin: 0 0 7px;
  overflow: hidden;
  font-size: 18px;
  letter-spacing: -0.025em;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-card-content p {
  margin: 0 0 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--course-color);
  font-size: 12px;
  font-weight: 800;
}

.course-tone-1 { --course-color: #681f2a; }
.course-tone-2 { --course-color: #244f40; }
.course-tone-3 { --course-color: #285566; }
.course-tone-4 { --course-color: #806329; }
.course-tone-5 { --course-color: #975143; }
.course-tone-6 { --course-color: #58636a; }

.pending-row,
.task-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 80px 22px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.task-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--course-color);
}

.task-icon::before {
  width: 14px;
  height: 16px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
  content: "";
}

.pending-row-copy,
.task-row-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pending-row-copy small,
.task-row-copy small,
.pending-row-copy span,
.task-row-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-row-copy strong,
.task-row-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-points,
.task-points {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.status-pill,
.task-status,
.submission-state {
  display: inline-flex;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.status-pill.success,
.task-status.upcoming,
.submission-state.submitted {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.danger,
.task-status.expired,
.submission-state.late {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-pill.neutral,
.task-status.undated,
.submission-state.pending {
  color: #5f5752;
  background: #eee9e3;
}

.status-pill.graded,
.submission-state.graded {
  color: #684f1b;
  background: var(--gold-soft);
}

.course-hero {
  position: relative;
  min-height: 235px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #fff;
  background: var(--course-color);
  box-shadow: var(--shadow-md);
}

.course-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 235px;
  max-width: 850px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 34px;
}

.course-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.course-hero-meta > span:not(.hero-role) {
  opacity: 0.8;
}

.hero-role {
  background: rgba(255, 255, 255, 0.16);
}

.course-hero h1 {
  max-width: 850px;
  margin: 10px 0 8px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.course-hero p {
  margin: 0;
  opacity: 0.82;
  font-size: 13px;
}

.course-hero-mark {
  position: absolute;
  z-index: 1;
  right: 37px;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 120px;
  line-height: 1;
}

.course-hero-pattern::before,
.course-hero-pattern::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.course-hero-pattern::before {
  top: -110px;
  right: -40px;
  width: 310px;
  height: 310px;
}

.course-hero-pattern::after {
  top: -40px;
  right: 70px;
  width: 190px;
  height: 190px;
}

.course-tabs {
  display: flex;
  gap: 26px;
  margin: 18px 0 31px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.course-tabs a {
  position: relative;
  padding: 13px 2px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.course-tabs a:hover,
.course-tabs a.active {
  color: var(--wine);
}

.course-tabs a.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--wine);
  content: "";
}

.classwork-toolbar {
  margin-top: 0;
}

.people-heading {
  margin: 8px 0 24px;
}

.people-heading h2 {
  font-family: inherit;
  font-size: 29px;
  font-weight: 700;
}

.people-section {
  margin-top: 26px;
}

.people-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 5px;
}

.people-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.people-section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.person-row {
  display: flex;
  align-items: center;
  min-height: 65px;
  gap: 13px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.person-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--slate);
  font-size: 10px;
  font-weight: 850;
}

.people-section.teachers-group .person-avatar {
  background: var(--wine);
}

.person-copy {
  min-width: 0;
}

.person-copy h4,
.person-copy p {
  margin: 0;
}

.person-copy h4 {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.person-copy p {
  color: var(--muted);
  font-size: 11px;
}

.you-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  vertical-align: 1px;
}

.empty-row {
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.task-form-heading {
  margin: 5px 0 23px;
}

.task-form {
  padding: clamp(22px, 4vw, 35px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.form-field {
  margin-bottom: 20px;
}

.form-field > label,
.grade-input-row label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}

.form-field input:not([type="checkbox"]):not([type="hidden"]),
.form-field textarea,
.grade-input-row input {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  background: var(--paper-strong);
}

.form-field textarea {
  resize: vertical;
  line-height: 1.55;
}

.form-field input:focus,
.form-field textarea:focus,
.grade-input-row input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(104, 31, 42, 0.1);
}

.form-field input[type="file"] {
  padding: 9px;
  background: #faf7f3;
}

.form-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 14px;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.current-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  margin-bottom: 9px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f2ede7;
  font-size: 11px;
}

.current-file > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--wine);
  font-weight: 750;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 3px;
}

.task-detail-layout {
  display: grid;
  align-items: start;
  gap: 22px;
}

.task-detail-layout.student-layout {
  grid-template-columns: minmax(0, 1fr) 345px;
}

.task-detail-card,
.student-work-panel,
.teacher-submissions-panel,
.submission-review-card,
.grade-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.task-detail-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 36px);
}

.task-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.task-detail-header > div:first-child {
  min-width: 0;
}

.task-detail-header h1 {
  margin: 10px 0 6px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.task-detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.task-owner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.task-owner-actions form {
  margin: 0;
}

.task-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.task-meta-grid div {
  padding: 13px;
  border-radius: 10px;
  background: #f7f3ee;
}

.task-meta-grid dt,
.review-meta dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-meta-grid dd,
.review-meta dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.task-description,
.task-resources {
  padding-top: 24px;
}

.task-description h2,
.task-resources h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.task-description p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.resource-card {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7f3;
}

.resource-card:hover {
  border-color: var(--wine);
}

.resource-card strong,
.resource-card span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-card span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.student-work-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  padding: 21px;
}

.student-work-heading,
.teacher-submissions-heading,
.review-heading,
.submitted-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.student-work-heading h2,
.teacher-submissions-heading h2,
.grade-form h2 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.student-work-empty {
  margin: 18px 0;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: #faf7f3;
  font-size: 12px;
}

.submitted-file-card {
  align-items: flex-start;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7f3;
}

.submitted-file-card > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.submitted-file-card strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submitted-file-card div > span:last-child,
.late-message,
.late-inline {
  color: var(--muted);
  font-size: 10px;
}

.late-message,
.late-inline {
  color: var(--danger);
  font-weight: 750;
}

.student-grade-card {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 15px;
  border-left: 3px solid var(--gold);
  border-radius: 3px 10px 10px 3px;
  background: var(--gold-soft);
}

.student-grade-card > span {
  color: #684f1b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.student-grade-card > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.student-grade-card h3,
.student-grade-card p {
  margin: 0;
}

.student-grade-card h3 {
  margin-top: 5px;
  font-size: 11px;
}

.student-grade-card p {
  font-size: 12px;
  line-height: 1.55;
}

.submission-form,
.unsubmit-form,
.submission-locked-message {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.submission-form {
  display: grid;
  gap: 9px;
}

.submission-file-picker {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #faf7f3;
}

.submission-file-picker:hover {
  border-color: var(--wine);
}

.submission-file-picker span {
  color: var(--wine);
  font-size: 12px;
  font-weight: 800;
}

.submission-file-picker small,
.selected-file-name {
  color: var(--muted);
  font-size: 10px;
}

.submission-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.submission-form input[type="file"]:focus + .submission-file-picker {
  outline: 3px solid rgba(181, 138, 59, 0.48);
  outline-offset: 2px;
}

.selected-file-name {
  overflow-wrap: anywhere;
}

.submission-locked-message {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.unsubmit-form .button,
.submission-form .button {
  width: 100%;
}

.teacher-submissions-panel {
  margin-top: 22px;
  padding: clamp(20px, 3vw, 28px);
}

.teacher-submissions-heading {
  align-items: flex-end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.teacher-submissions-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.submission-summary {
  display: flex;
  gap: 22px;
}

.submission-summary div {
  display: grid;
  min-width: 58px;
  gap: 1px;
}

.submission-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.submission-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.submission-student-list {
  margin-top: 7px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.submission-student-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 135px 110px 20px;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}

.student-list-name {
  min-width: 0;
}

.student-list-name strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-list-grade {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.submission-student-row.no-submission {
  color: var(--muted);
}

.late-inline {
  display: block;
  margin-top: 2px;
}

.review-heading {
  align-items: flex-end;
  margin: 4px 0 22px;
}

.review-heading h1 {
  margin: 4px 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.review-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.review-navigation {
  display: flex;
  gap: 7px;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 20px;
}

.submission-review-card,
.grade-form {
  padding: clamp(20px, 3vw, 28px);
}

.submission-review-card h2 {
  margin: 18px 0 14px;
  overflow-wrap: anywhere;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.late-note {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 750;
}

.review-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 9px;
  background: #f7f3ee;
}

.submission-review-card .button {
  width: 100%;
}

.grade-form h2 {
  margin-bottom: 18px;
}

.grade-input-row {
  display: grid;
  grid-template-columns: 120px auto;
  align-items: end;
  width: max-content;
  max-width: 100%;
  gap: 7px;
  margin-bottom: 5px;
}

.grade-input-row label {
  grid-column: 1 / -1;
  margin: 0;
}

.grade-input-row input {
  width: 120px;
}

.grade-input-row strong {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.grade-form > .field-error {
  margin-bottom: 17px;
}

.confirmation-dialog {
  width: min(100% - 28px, 480px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 25px 75px rgba(42, 27, 22, 0.28);
}

.confirmation-dialog::backdrop {
  background: rgba(35, 25, 22, 0.5);
  backdrop-filter: blur(2px);
}

.confirmation-dialog-body {
  padding: 26px;
}

.confirmation-dialog h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.confirmation-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}































@media (max-width: 1120px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-detail-layout.student-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    z-index: 60;
    top: 0;
    width: min(84vw, 310px);
    padding-top: max(var(--topbar-height), env(safe-area-inset-top));
    box-shadow: var(--shadow-md);
    transform: translateX(-105%);
  }

  .sidebar-collapse {
    display: none;
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 55;
    inset: 0;
    display: block;
    border: 0;
    visibility: hidden;
    background: rgba(35, 25, 22, 0.46);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-open {
    overflow: hidden;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
  }

  .app-content,
  .sidebar-collapsed .app-content {
    margin-left: 0;
  }

  .task-detail-layout.student-layout,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .student-work-panel {
    position: static;
    grid-row: 2;
  }

  .teacher-submissions-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .submission-summary {
    width: 100%;
    justify-content: space-between;
  }

  

  
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 58px;
  }

  .topbar,
  .login-topbar {
    min-height: var(--topbar-height);
    padding-right: 12px;
    padding-left: 9px;
  }

  .login-topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand span {
    max-width: 155px;
    font-size: 13px;
  }

  .user-name,
  .user-menu summary > svg {
    display: none;
  }

  .user-menu summary {
    padding-right: 4px;
  }

  #installApp {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-shell {
    width: min(100% - 28px, 1220px);
    padding: 25px 0 55px;
  }

  .page-heading,
  .section-heading-row,
  .review-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-heading {
    margin-bottom: 22px;
  }

  .page-heading h1,
  .page-heading h2,
  .task-form-heading h1 {
    font-size: 32px;
  }

  .count-badge {
    align-self: flex-start;
  }

  .dashboard-section {
    margin-top: 28px;
  }

  .upcoming-item {
    grid-template-columns: 4px minmax(0, 1fr) 20px;
    gap: 11px;
    min-height: 78px;
    padding-right: 12px;
  }

  .upcoming-date {
    grid-column: 2;
    font-size: 10px;
  }

  .upcoming-item .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .course-card {
    min-height: 196px;
  }

  .pending-row,
  .task-row {
    grid-template-columns: 37px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 88px;
    padding: 12px;
  }

  .pending-row .status-pill,
  .task-row .status-pill {
    grid-column: 2;
    grid-row: 2;
  }

  .pending-points,
  .task-points {
    grid-column: 2;
    grid-row: 3;
    text-align: left;
  }

  .pending-row .row-arrow,
  .task-row .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

  .task-icon {
    align-self: start;
  }

  .course-hero,
  .course-hero-copy {
    min-height: 215px;
  }

  .course-hero-copy {
    padding: 25px 22px;
  }

  .course-hero h1 {
    font-size: 35px;
  }

  .course-hero-mark {
    right: 16px;
    bottom: 12px;
    font-size: 76px;
  }

  .course-tabs {
    gap: 17px;
    margin-bottom: 25px;
    padding: 0 3px;
  }

  .classwork-toolbar .button {
    width: 100%;
  }

  .form-grid,
  .task-meta-grid,
  .resource-list {
    grid-template-columns: 1fr;
  }

  .task-form,
  .task-detail-card,
  .student-work-panel,
  .teacher-submissions-panel,
  .submission-review-card,
  .grade-form {
    padding: 20px 17px;
  }

  .task-detail-header {
    flex-direction: column;
  }

  .task-owner-actions {
    width: 100%;
    flex-direction: column;
  }

  .task-owner-actions .button,
  .task-owner-actions form {
    width: 100%;
  }

  .submitted-file-card {
    flex-direction: column;
  }

  .submitted-file-card .button {
    width: 100%;
  }

  .submission-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .submission-student-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    min-height: 78px;
    padding: 12px 3px;
  }

  .submission-student-row > div:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .student-list-grade {
    grid-column: 1;
    grid-row: 3;
  }

  .submission-student-row > span:last-child {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .review-navigation {
    width: 100%;
  }

  .review-navigation .button {
    flex: 1;
  }

  .current-file,
  .confirmation-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .confirmation-dialog-actions {
    flex-direction: column-reverse;
  }

  .confirmation-dialog-actions .button {
    width: 100%;
  }

  

  

  

  

  

  .toast-message {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 390px) {
  .brand span {
    max-width: 125px;
  }

  #installApp {
    max-width: 75px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .login-topbar #installApp {
    max-width: 100px;
  }

  .page-shell {
    width: min(100% - 22px, 1220px);
  }

  .empty-state {
    align-items: flex-start;
    padding: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   UNAMIS Campus - Premium Login Suite (Phase 2.1)
   Modern University Glassmorphism, Ambient Orbs & Micro-Interactions
   ========================================================================== */

:root {
  --campus-bg: #F4F6F9;
  --campus-wine: #681F2A;
  --campus-wine-glow: rgba(104, 31, 42, 0.28);
  --campus-wine-light: #852735;
  --campus-gold: #B58A3B;
  --campus-gold-light: #D4A853;
  --campus-gold-glow: rgba(181, 138, 59, 0.25);
  --campus-emerald: #244F40;
  --campus-glass-bg: rgba(255, 255, 255, 0.74);
  --campus-glass-border: rgba(255, 255, 255, 0.85);
  --campus-glass-shadow: 0 30px 60px -15px rgba(104, 31, 42, 0.12), 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  --campus-input-bg: rgba(255, 255, 255, 0.75);
}

/* Preload state prevents initial animation flicker */
.preload * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
}

body.login-body {
  min-height: 100vh;
  background-color: var(--campus-bg);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

/* ==========================================================================
   1. DYNAMIC BACKGROUND & AMBIENT ORBS
   ========================================================================== */

#login-dynamic-bg {
  position: fixed;
  inset: -15%;
  width: 130%;
  height: 130%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  will-change: transform;
}

.bg-mesh-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(104, 31, 42, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  -webkit-filter: blur(85px);
  opacity: 0.65;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.orb-wine {
  width: min(600px, 45vw);
  height: min(600px, 45vw);
  background: radial-gradient(circle, var(--campus-wine) 0%, rgba(104, 31, 42, 0) 70%);
  top: 5%;
  left: 2%;
  animation: orbDrift1 24s ease-in-out infinite alternate;
}

.orb-gold {
  width: min(520px, 40vw);
  height: min(520px, 40vw);
  background: radial-gradient(circle, var(--campus-gold) 0%, rgba(181, 138, 59, 0) 70%);
  bottom: 8%;
  right: 5%;
  animation: orbDrift2 28s ease-in-out infinite alternate;
}

.orb-emerald {
  width: min(420px, 35vw);
  height: min(420px, 35vw);
  background: radial-gradient(circle, var(--campus-emerald) 0%, rgba(36, 79, 64, 0) 70%);
  top: 48%;
  left: 42%;
  opacity: 0.45;
  animation: orbDrift3 20s ease-in-out infinite alternate;
}

.orb-accent {
  width: min(340px, 30vw);
  height: min(340px, 30vw);
  background: radial-gradient(circle, #E6C887 0%, rgba(230, 200, 135, 0) 70%);
  top: 12%;
  right: 28%;
  opacity: 0.5;
  animation: orbDrift4 22s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 35px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

@keyframes orbDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-45px, -30px) scale(1.06); }
  100% { transform: translate(35px, -45px) scale(0.92); }
}

@keyframes orbDrift3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.1); }
  100% { transform: translate(-40px, 30px) scale(0.96); }
}

@keyframes orbDrift4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-35px, 35px) scale(1.05); }
  100% { transform: translate(25px, -25px) scale(0.94); }
}

/* ==========================================================================
   2. TOPBAR & SHELL LAYOUT
   ========================================================================== */

.login-topbar {
  position: relative;
  z-index: 10;
  background: transparent;
  border: none;
  padding: 20px 32px;
}

.login-topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1A1A1A;
  transition: transform 0.2s ease;
}

.login-topbar .brand:hover {
  transform: translateY(-1px);
}

.login-shell {
  flex-grow: 1;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 10;
  padding: 30px 24px 60px;
}

.login-layout {
  display: grid;
  width: min(100%, 1080px);
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(40px, 7vw, 85px);
}

/* ==========================================================================
   3. INTRO / BRANDING (LEFT SIDE)
   ========================================================================== */

.login-intro {
  max-width: 540px;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(104, 31, 42, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.intro-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--campus-gold);
  box-shadow: 0 0 8px var(--campus-gold);
  animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 12px var(--campus-gold); }
}

.intro-badge .eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--campus-wine);
}

.login-intro h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 4.8vw, 54px);
  font-weight: 400;
  color: #18181B;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.login-intro > p {
  color: #4A4A52;
  font-size: 17.5px;
  line-height: 1.62;
  max-width: 490px;
  margin: 0;
}

.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.login-features span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #2D2D35;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.25s ease;
}

.login-features span:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  border-color: rgba(104, 31, 42, 0.15);
}

.feat-icon {
  width: 15px;
  height: 15px;
  color: var(--campus-wine);
  flex-shrink: 0;
}

/* ==========================================================================
   4. PREMIUM GLASSMORPHISM LOGIN CARD
   ========================================================================== */

.login-card-wrapper {
  perspective: 1200px;
  width: 100%;
}

.login-card {
  position: relative;
  background: var(--campus-glass-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--campus-glass-border);
  border-radius: 28px;
  padding: clamp(32px, 5vw, 46px);
  box-shadow: var(--campus-glass-shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.login-card:hover {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 35px 75px -15px rgba(104, 31, 42, 0.16), 0 12px 30px -6px rgba(0, 0, 0, 0.06), 0 0 0 1px #FFFFFF inset;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.35s ease;
  z-index: 5;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--campus-wine), var(--campus-gold), var(--campus-wine));
  background-size: 200% 100%;
  animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-card-heading {
  margin-bottom: 28px;
}

.login-card-heading .eyebrow {
  display: block;
  font-size: 11px;
  color: var(--campus-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card-heading h2 {
  font-size: 27px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #121214;
  letter-spacing: -0.025em;
}

.login-card-heading p {
  color: #666670;
  font-size: 14px;
  margin: 0;
}

.login-alert {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #B91C1C;
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: campusShake 0.4s ease;
}

/* ==========================================================================
   5. FORM FIELDS & MICRO-INTERACTIONS
   ========================================================================== */

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  position: relative;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-field label {
  position: absolute;
  top: 19px;
  left: 18px;
  font-size: 14.5px;
  color: #7A7A85;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.22s ease;
  z-index: 2;
}

.form-field input {
  width: 100%;
  padding: 24px 44px 8px 18px;
  font-size: 15.5px;
  font-weight: 500;
  color: #18181B;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: var(--campus-input-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) inset;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.field-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  pointer-events: none;
  transition: color 0.25s ease, transform 0.25s ease;
}

/* Dynamic Focus & Populated States */
.form-field.is-focused label,
.form-field.has-value label {
  transform: translateY(-12px) scale(0.78);
  color: var(--campus-wine);
  font-weight: 700;
}

.form-field.is-focused input {
  border-color: var(--campus-wine);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px var(--campus-wine-glow), 0 8px 20px -4px rgba(104, 31, 42, 0.08);
  outline: none;
}

.form-field.is-focused .field-icon {
  color: var(--campus-wine);
  transform: translateY(-50%) scale(1.08);
}

/* Invalid State */
.form-field.is-invalid input {
  border-color: #EF4444;
  background: #FEF2F2;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.form-field.is-invalid label {
  color: #DC2626;
}

.form-field.is-invalid .field-icon {
  color: #EF4444;
}

/* Card Shake on Error */
.login-card.shake {
  animation: campusShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes campusShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  15%, 45%, 75% { transform: translate3d(-7px, 0, 0); }
  30%, 60%, 90% { transform: translate3d(7px, 0, 0); }
}

/* ==========================================================================
   6. SUBMIT BUTTON WITH LIGHT SWEEP & SPINNER
   ========================================================================== */

.btn-login {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--campus-wine) 0%, var(--campus-wine-light) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 8px 22px -4px var(--campus-wine-glow), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-shine {
  position: absolute;
  top: -50%;
  left: -70%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  pointer-events: none;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(104, 31, 42, 0.42), 0 4px 8px rgba(0, 0, 0, 0.12);
}

.btn-login:hover .btn-shine {
  left: 150%;
  transition: left 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-login:active {
  transform: scale(0.975);
}

.btn-loading {
  pointer-events: none !important;
  opacity: 0.92;
}

.btn-spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spinnerRotate 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

.privacy-note {
  margin-top: 22px;
  font-size: 11.5px;
  color: #71717A;
  text-align: center;
  line-height: 1.45;
}

/* ==========================================================================
   7. STAGGERED CASCADE ENTRANCE ANIMATIONS
   ========================================================================== */

@keyframes campusFadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes campusSlideInRight {
  from {
    opacity: 0;
    transform: translate3d(36px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.login-topbar {
  animation: campusFadeInUp 0.75s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-badge {
  animation: campusFadeInUp 0.75s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-intro h1 {
  animation: campusFadeInUp 0.75s 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-intro > p {
  animation: campusFadeInUp 0.75s 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-features span:nth-child(1) {
  animation: campusFadeInUp 0.65s 0.40s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-features span:nth-child(2) {
  animation: campusFadeInUp 0.65s 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-features span:nth-child(3) {
  animation: campusFadeInUp 0.65s 0.56s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card {
  animation: campusSlideInRight 0.85s 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.field-username {
  animation: campusFadeInUp 0.65s 0.44s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.field-password {
  animation: campusFadeInUp 0.65s 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#submit-btn {
  animation: campusFadeInUp 0.65s 0.60s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.privacy-note {
  animation: campusFadeInUp 0.65s 0.68s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ==========================================================================
   8. ACCESSIBILITY & RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .login-topbar,
  .intro-badge,
  .login-intro h1,
  .login-intro > p,
  .login-features span,
  .login-card,
  .field-username,
  .field-password,
  #submit-btn,
  .privacy-note,
  .bg-orb {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 850px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .login-intro {
    text-align: center;
    max-width: 100%;
  }
  .intro-badge {
    margin-left: auto;
    margin-right: auto;
  }
  .login-intro > p {
    margin: 0 auto;
  }
  .login-features {
    justify-content: center;
  }
  .login-shell {
    padding: 20px 16px 40px;
  }
}

@media (max-width: 500px) {
  .login-topbar {
    padding: 16px 20px;
  }
  .login-card {
    padding: 26px 18px;
    border-radius: 22px;
  }
  .login-intro h1 {
    font-size: 31px;
  }
  .login-intro > p {
    font-size: 15.5px;
  }
  .form-field input {
    padding: 22px 38px 6px 16px;
    font-size: 15px;
  }
}
