/* Doctrina Learning design tokens, shared by every page.
   Values come from doctrina-design-kit/brand-kit/tokens/hoot-app-tokens.css
   (contrast checked 2026-10-12, WCAG 2.x). Light theme only. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  /* Brand palette */
  --brand-owl-blue: #2460B7;
  --brand-navy: #173268;
  --brand-ink: #121F37;
  --brand-amber: #F2B036;      /* accent on Navy only, never text on light */
  --brand-paper: #FCFAF6;
  --brand-stone: #EFEBE4;
  --brand-sky-white: #F0F8FF;
  --brand-sky: #D5EBFE;
  --brand-line: #DADEE5;
  --brand-slate: #565E69;

  /* Semantic tokens (shadcn names) */
  --radius: 0.5rem;
  --background: var(--brand-paper);
  --foreground: var(--brand-ink);
  --card: #FFFFFF;
  --card-foreground: var(--brand-ink);
  --heading: var(--brand-navy);
  --primary: var(--brand-owl-blue);
  --primary-hover: #1D4F98;
  --primary-foreground: #FFFFFF;
  --secondary: var(--brand-sky-white);
  --secondary-foreground: var(--brand-navy);
  --sky-border: #B4D6F5;
  --muted: #F1F4F8;
  --muted-foreground: var(--brand-slate);
  --accent: var(--brand-sky);
  --accent-foreground: var(--brand-navy);
  --destructive: #C22826;
  --destructive-hover: #A11F1D;
  --border: var(--brand-line);
  --input: #7A8286;
  --ring: var(--brand-owl-blue);
  --navy: var(--brand-navy);
  --navy-foreground: var(--brand-sky-white);
  --amber: var(--brand-amber);

  /* Status: text on its subtle fill */
  --success: #287C42;  --success-subtle: #E4F8E7; --success-foreground: #0D4A22;
  --warning: #D4771A;  --warning-subtle: #FFF4D7; --warning-foreground: #7D460B;
  --info: #2460B7;     --info-subtle: #E6F4FF;    --info-foreground: #164781;
  --danger-subtle: #FFEDEB; --danger-foreground: #9B1F1D;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-sans);
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 240ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration-base: 0ms; --duration-slow: 0ms; }
}

html {
  font-family: var(--font-sans);
}
body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}
h1, h2, h3, h4 {
  color: var(--heading);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* The wordmark and headings on public pages (sign-in, sign-up) */
.font-display {
  font-family: var(--font-display);
}

/* ---------- Shared pieces used by assets/doctrina-ui.js ---------- */

/* "Skip to content": first focusable element on every page */
.dm-skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 70;
  padding: 0.5rem 1rem;
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--ring);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.dm-skip-link:focus { top: 1rem; }

/* Toasts: transient success, bottom right (bottom centre on phones) */
.dm-toasts {
  position: fixed;
  z-index: 1090;   /* above Bootstrap modals (1055) */
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}
@media (max-width: 639.98px) {
  .dm-toasts { left: 1rem; right: 1rem; max-width: none; }
}
.dm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px -8px rgb(18 31 55 / 0.25);
  font-size: 0.9375rem;
  line-height: 1.4;
  animation: dm-toast-in var(--duration-base) var(--ease-out);
}
.dm-toast-icon { flex: none; margin-top: 0.1rem; }
.dm-toast-success .dm-toast-icon { color: var(--success); }
.dm-toast-error .dm-toast-icon { color: var(--destructive); }
.dm-toast-body { flex: 1; }
.dm-toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius) - 2px);
  line-height: 1;
}
.dm-toast-close:hover { background: var(--muted); color: var(--foreground); }
@keyframes dm-toast-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Inline error under a field, or at the top of a form */
.dm-inline-error {
  color: var(--destructive);
  font-size: 0.875rem;
  margin-top: 0.375rem;
}
.dm-form-alert {
  background: var(--danger-subtle);
  color: var(--danger-foreground);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}
.dm-form-alert ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
[aria-invalid="true"] { border-color: var(--destructive) !important; }

/* Inline confirmation (unenrol and similar) */
.dm-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--warning-subtle);
  color: var(--warning-foreground);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.dm-confirm-text { flex: 1 1 12rem; }

/* Pending buttons: spinner beside the label */
.dm-spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.45em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dm-spin 0.7s linear infinite;
}
@keyframes dm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .dm-spinner { animation-duration: 2s; }
  .dm-toast { animation: none; }
}

/* Empty state (page test P12): the mark, what goes here, one action */
.dm-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) + 4px);
}
.dm-empty-state img { display: inline-block; opacity: .9; margin-bottom: .75rem; }
.dm-empty-state h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: .25rem; }
.dm-empty-state p { color: var(--muted-foreground); max-width: 32rem; margin: 0 auto 1rem; }
.dm-empty-state-inline { border: 0; padding: 2rem 1rem; background: transparent; }

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