/* Portal-specific styles layered on top of modernist.css (the ported
   design-system file — keep that one a verbatim copy of the source). */

/* Screens override the system's default link color (see *.dc.html <style>). */
a { color: var(--color-accent-700); text-decoration: underline; }
a:hover { color: var(--color-accent-900); }

body { min-height: 100vh; display: flex; flex-direction: column; }

/* — page shell (dashboard and inner pages) — */
.page { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 var(--space-4) var(--space-8); }
.page-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: var(--space-3); padding: var(--space-6) 0 var(--space-4);
}
.page-head h1 { margin: 0; }
.page--wide { max-width: 1080px; }
.page--narrow { max-width: 720px; }

/* — centered auth card shell (Login / Register / Forgot password) — */
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.auth-card { width: 100%; max-width: 400px; padding: var(--space-6); }
.auth-card--wide { max-width: 420px; }
.auth-card form { display: grid; gap: var(--space-4); }
.auth-card .card-title { margin-bottom: var(--space-4); }
.auth-help { font-size: 13.5px; color: var(--color-text); opacity: 0.75; margin: 0 0 var(--space-4); }
.auth-footnote { margin: var(--space-5) 0 0; font-size: 13px; text-align: center; color: var(--color-text); }

/* — nav sign-out form — */
.nav form { display: inline-flex; margin: 0; }

/* — flash messages — */
.messages {
  list-style: none; width: 100%; max-width: 960px;
  margin: var(--space-4) auto 0; padding: 0 var(--space-4);
  display: grid; gap: var(--space-2);
}
.messages li {
  padding: var(--space-2) var(--space-3); font-size: 14px;
  background: var(--color-accent-100); color: var(--color-accent-800);
  border-left: 3px solid var(--color-accent);
}

/* — error pages (Error404 / ErrorInvalidToken / ErrorGeneral designs) — */
.error-body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.error-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.error-panel { max-width: 480px; }
.error-panel .card-kicker { margin-bottom: var(--space-2); }
.error-title { margin: 0 0 var(--space-4); font-size: 40px; }
.error-copy {
  margin: 0 0 var(--space-6); color: var(--color-text); opacity: 0.75;
  font-size: 15px; line-height: 1.6;
}
.error-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
.error-actions .btn { white-space: nowrap; }

/* — form errors (Django's .errorlist) — */
.errorlist {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2px;
  font-size: 12.5px; color: var(--color-accent-700);
}
.field .errorlist { margin-top: 4px; }
.errorlist.nonfield { margin: 0; }

/* — admin status picker: radios styled as stacked buttons — */
.status-opt { position: relative; }
.status-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.status-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.status-opt:has(input:checked):hover { background: var(--color-accent-600); }
.status-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* — table cell truncation (Issue column) — */
.cell-clip { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* — compatibility for {{ form.as_p }} pages that haven't had their design
     pass yet (New request): give bare inputs the .field/.input look — */
form p label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
form p input:not([type=checkbox], [type=radio], [type=submit]),
form p select,
form p textarea {
  width: 100%; max-width: 34rem; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
form p textarea { min-height: 90px; resize: vertical; }
