*,
*::before,
*::after { box-sizing: border-box; }

html {
  height: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background:
    radial-gradient(circle at top right, rgba(232,160,160,.18), transparent 28%),
    radial-gradient(circle at left 15%, rgba(253,237,236,.9), transparent 35%),
    var(--color-background);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.72)),
    url("../assets/illustrations/dashboard-glow.svg") center top / 1200px auto no-repeat;
  pointer-events: none;
  z-index: -2;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.15; }
p { margin: 0; }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0);
}

.meta {
  color: var(--color-muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.subtle-help {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--color-muted);
}

.output {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
  background: #0F172A;
  color: #D6E1FF;
  border-radius: var(--radius-md);
  padding: 16px;
}

.notice,
.empty-state {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: rgba(255,255,255,.85);
  color: var(--color-text-soft);
  font-size: 0.92rem;
}

.empty-state ol {
  margin: 10px 0 0;
  padding-left: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip.success { background: var(--color-success-soft); color: var(--color-success); }
.chip.warning { background: var(--color-warning-soft); color: var(--color-warning); }
.chip.info { background: var(--color-info-soft); color: var(--color-info); }

.form-error,
.form-success {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.form-error {
  color: var(--color-danger);
  border-color: #F5C2C7;
  background: #FFF3F4;
}

.form-success {
  color: var(--color-success);
  border-color: #B7E4DC;
  background: var(--color-success-soft);
}

.field-invalid {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.truncate-2,
.truncate-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.truncate-2 { -webkit-line-clamp: 2; }
.truncate-3 { -webkit-line-clamp: 3; }

.student-only,
.teacher-only { display: none; }

body[data-role="student"] .student-only { display: initial; }
body[data-role="teacher"] .teacher-only,
body[data-role="admin"] .teacher-only { display: initial; }

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 110;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: white;
  box-shadow: var(--shadow-card);
  background: linear-gradient(135deg, rgba(32,48,64,.95), rgba(18,26,39,.95));
}

.toast[data-tone="success"] { background: linear-gradient(135deg, #15803D, #0F766E); }
.toast[data-tone="error"] { background: linear-gradient(135deg, #C0392B, #922B21); }
.toast[data-tone="info"] { background: linear-gradient(135deg, #1D4ED8, #1E40AF); }

.toast strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.toast p { font-size: 0.84rem; color: rgba(255,255,255,.88); }


html { scroll-behavior: auto; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

.page-section {
  opacity: 1;
  transform: translateX(0);
}

.page-section.page-enter-active {
  animation: page-slide-in 240ms cubic-bezier(.2,.8,.2,1);
}

@keyframes page-slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.meta, .subtle-help {
  color: var(--color-text-soft);
}

.notice,
.empty-state,
.summary-card,
.list-item,
.stat-card,
.student-stat-card,
.teacher-quick-card,
.dashboard-list-item,
.student-item,
.schedule-row,
.dual-panel,
.wizard-panel {
  color: var(--color-text);
}

.hero-banner,
.teacher-home-hero,
.action-button.primary,
.sidebar button.active,
.segment-toggle.active,
.bottom-nav-button.active,
.auth-toggle-row button.active {
  color: #fff;
}

.hero-banner .meta,
.teacher-home-hero .meta {
  color: rgba(255,255,255,0.86);
}


@media (max-width: 980px) {
  html { font-size: 16px; }
}

/* Shared status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 11px 4px 7px;
  border: 1px solid rgba(100, 116, 139, .22);
  border-radius: 999px;
  background: rgba(248, 250, 252, .96);
  color: #334155;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: currentColor;
  font-size: .68rem;
  line-height: 1;
}

.status-badge-opened {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(240, 253, 244, .96);
  color: #166534;
}

.status-badge-closed,
.status-badge-not-submitted {
  border-color: rgba(100, 116, 139, .28);
  background: rgba(241, 245, 249, .96);
  color: #334155;
}

.status-badge-submitted {
  border-color: rgba(37, 99, 235, .28);
  background: rgba(239, 246, 255, .96);
  color: #1d4ed8;
}

.status-badge-graded {
  border-color: rgba(147, 51, 234, .28);
  background: rgba(250, 245, 255, .96);
  color: #7e22ce;
}

.status-badge-draft,
.status-badge-scheduled {
  border-color: rgba(217, 119, 6, .30);
  background: rgba(255, 251, 235, .98);
  color: #92400e;
}
