/* AssignmentBox - portal stylesheet.

   No external fonts, no CSS framework and no build step: the portal stays
   usable when the machine has no internet connection.
*/

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #16203a;
  --ink-soft: #5b6883;
  --line: #e2e7f1;
  --brand: #2447a8;
  --brand-dark: #1b357c;
  --brand-soft: #eaf0ff;
  --success-bg: #e7f7ee;
  --success-ink: #12633a;
  --error-bg: #fdecec;
  --error-ink: #99231f;
  --warn-bg: #fff4e2;
  --warn-ink: #8a5300;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(24, 39, 75, 0.06);
  --focus: #ffb020;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; }
p { margin: 0 0 12px; }
a { color: var(--brand); }

/* ---------- accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- layout ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topnav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 15px; }
.topnav a:hover { color: var(--brand); }
.topnav .nav-cta {
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 9px;
}
.topnav .nav-cta:hover { color: #fff; background: var(--brand-dark); }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover { color: var(--brand); }

.container { max-width: 1140px; margin: 0 auto; padding: 32px 24px 64px; }

.footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 24px;
  color: var(--ink-soft);
  font-size: 14px;
}
.footer-inner p { margin: 0 0 4px; }
.footer-note { font-size: 13px; }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 8px;
}
.muted { color: var(--ink-soft); font-size: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -1.2px; font-weight: 800; }
.hero h1 span { color: var(--brand); }
.intro { color: var(--ink-soft); max-width: 640px; font-size: 16px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 36px 0 18px;
  flex-wrap: wrap;
}
.section-heading h2, .panel h2 { font-size: 21px; margin: 0; }
.dashboard-heading { margin-bottom: 24px; }
.dashboard-heading h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }

.count {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- hero and features ---------- */
.hero { padding: 18px 0 10px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.feature h2 { font-size: 17px; }
.feature p { color: var(--ink-soft); font-size: 14px; margin: 0; }

/* ---------- cards and panels ---------- */
.assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card, .panel, .auth-card, .error-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 22px; }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.deadline { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.deadline.open { color: var(--success-ink); }
.deadline.closed { color: var(--error-ink); }
.card h3 { font-size: 19px; margin: 16px 0 8px; }
.description { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.text-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #38445e;
  margin-bottom: 6px;
}
.field-help { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd3e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
input[type="file"] { padding: 8px; background: #fbfcfe; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

button, .button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.secondary-button { background: var(--brand-soft); color: var(--brand-dark); border-color: #cfdbfb; }
.secondary-button:hover { background: #dde6ff; color: var(--brand-dark); }
.ghost-button { background: transparent; color: var(--brand); }
.ghost-button:hover { background: var(--brand-soft); color: var(--brand-dark); }

.auth-card { max-width: 480px; margin: 24px auto; }
.auth-card h1, .error-card h1 { font-size: 26px; font-weight: 800; }
.form-footer { margin: 16px 0 0; font-size: 14px; color: var(--ink-soft); }
.error-card { max-width: 560px; margin: 32px auto; text-align: center; }
.error-code { font-size: 46px; font-weight: 800; color: var(--brand); margin: 0; }

.upload-form { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.create-form .wide { grid-column: 1 / -1; }
.review-form { min-width: 220px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.file-line { word-break: break-all; }
.feedback-box {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 10px 0;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }
tbody tr:last-child td { border-bottom: none; }
td a { word-break: break-all; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-value { display: block; font-size: 28px; font-weight: 800; color: var(--brand); }
.stat-label { font-size: 13px; color: var(--ink-soft); }

/* ---------- status labels ---------- */
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-submitted { background: var(--brand-soft); color: var(--brand-dark); }
.status-reviewed { background: var(--success-bg); color: var(--success-ink); }
.status-needs-changes { background: var(--warn-bg); color: var(--warn-ink); }
.status-pending { background: #eef1f7; color: var(--ink-soft); }

/* ---------- flash messages ---------- */
.flash-stack { margin-bottom: 20px; display: grid; gap: 10px; }
.flash {
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: var(--success-ink); border-color: #bfe6cf; }
.flash-error { background: var(--error-bg); color: var(--error-ink); border-color: #f4c6c4; }
.flash-message, .flash-info { background: var(--brand-soft); color: var(--brand-dark); border-color: #cfdbfb; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar-inner { padding: 12px 16px; }
  .container { padding: 24px 16px 48px; }
  .feature-grid { grid-template-columns: 1fr; }
  .create-form { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .panel, .auth-card { padding: 18px; }
  .hero-actions .button { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
