/* Unlimited Civil brand base for the public pages: Home, Sign in, Back Office sign in.
   Source: the marketing "Unlimited Civil Marketing System" canvas, 01 Identity.
   These pages do NOT follow the app's light/dark choice (they never load theme-init.js or the
   ADR-0095 roles): they are always the brand's Paper look (white ground, slate text, blue accent).
   "Derived" values are not on the Identity page; they are the brand page's own supporting colors
   or were derived to meet WCAG 2.2 AA, as noted. */

/* Self-hosted fonts (CSP: font-src 'self'). Files go in /assets/brand/fonts, see README there.
   Until they are present the stacks below fall back to system fonts. */
@font-face {
  font-family: 'Barlow';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/barlow-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/barlow-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/barlow-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/barlow-semi-condensed-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/barlow-semi-condensed-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Michroma';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/brand/fonts/michroma-400.woff2') format('woff2');
}

:root {
  color-scheme: light;
  /* Official: Paper ground, Slate, Blue */
  --brand-bg: #fefefe;
  --brand-slate: #2a323c;
  --brand-blue: #154a90;
  --brand-accent: #154a90; /* links, eyebrows, primary button: 8.6:1 on Paper */
  /* Derived, Identity page */
  --brand-ink: #141b22; /* body and headings, 17:1 */
  --brand-text-soft: #2a323c; /* Slate */
  --brand-text-muted: #55606e; /* captions, 6:1 */
  --brand-raised: #eef2f7; /* panels and cards */
  --brand-line: #d7dee7; /* decorative dividers and card edges */
  --brand-signal: #b4410f; /* risk call-outs only */
  /* Derived here: outline of an input or secondary button, at least 3:1 on Paper and on Raised */
  --brand-control: #6b7785;

  --brand-font-body: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --brand-font-head:
    'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --brand-font-label: 'Michroma', 'Segoe UI', system-ui, sans-serif;
  --brand-radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--brand-bg);
  color: var(--brand-ink);
  font: 400 17px/1.6 var(--brand-font-body);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--brand-font-head);
  font-weight: 700;
  color: var(--brand-ink);
}

/* Michroma, capitals, wide tracking: eyebrows and labels */
.eyebrow {
  margin: 0 0 14px;
  color: var(--brand-accent);
  font: 400 11px/1.6 var(--brand-font-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Buttons: flat, 8px radius, no gradient, no shadow. Primary is Blue with Paper text (8.6:1). */
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--brand-radius);
  font: 600 16px/1.2 var(--brand-font-body);
  cursor: pointer;
  text-decoration: none;
}
.primary {
  border: 1px solid var(--brand-accent);
  background: var(--brand-accent);
  color: var(--brand-bg);
}
.primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  text-decoration: none;
}
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.secondary {
  border: 1px solid var(--brand-control);
  background: transparent;
  color: var(--brand-ink);
}
.secondary:hover {
  border-color: var(--brand-accent);
  text-decoration: none;
}

/* Sign-in pages (Sign in, Back Office sign in) */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 20px;
}
.auth-brand {
  display: block;
  width: min(300px, 70%);
}
.auth-brand img {
  display: block;
  width: 100%;
  height: auto;
}
.auth-card {
  width: min(480px, 100%);
  padding: 32px;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius);
  background: var(--brand-raised);
}
.auth-card h1 {
  margin: 0 0 20px;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.auth-card p {
  margin: 0 0 16px;
  color: var(--brand-text-soft);
}
.auth-card label {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  color: var(--brand-ink);
  font-weight: 600;
}
.auth-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--brand-control);
  border-radius: var(--brand-radius);
  background: var(--brand-bg);
  color: var(--brand-ink);
  font: 400 17px/1.4 var(--brand-font-body);
}
.auth-card input:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
  border-color: var(--brand-accent);
}
.auth-card .primary {
  width: 100%;
}
.auth-card a.primary {
  margin-bottom: 20px;
}
/* Messages: ink text on Paper with a Signal marker (Signal is for risk call-outs only). */
.form-message {
  margin: 0 0 16px;
  padding: 0;
  color: var(--brand-ink);
}
.form-message:not(:empty) {
  padding: 10px 12px;
  border-left: 3px solid var(--brand-signal);
  background: var(--brand-bg);
}
.security-note {
  margin: 20px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--brand-line);
  color: var(--brand-text-muted) !important;
  font-size: 14px;
  line-height: 1.5;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 14px;
}
.auth-links a {
  color: var(--brand-text-muted);
}
.auth-links a:hover {
  color: var(--brand-ink);
}

@media (max-width: 520px) {
  .auth-card {
    padding: 24px 20px;
  }
  .auth-card h1 {
    font-size: 34px;
  }
}
