/*
 * Digital Trust Monitor web app -- shared styles.
 *
 * Palette and type extracted from scripts/status_page.py's Navy design
 * (see that file's own comments for why Navy: the register of banks,
 * insurers and law firms the actual buyer persona -- a non-technical
 * owner at a small real-estate/insurance/legal/accounting practice --
 * already reads as trustworthy). Kept as CSS custom properties so the
 * status pages and the app chrome stay visually one product, not two.
 */

:root {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef2f6;
  --text: #16202b;
  --text-muted: #55606d;
  --primary: #174c8c;
  --primary-hover: #133e72;
  --primary-soft: #dae2ed;
  --focus-ring: #2c6fbb;
  --accent: #2c6fbb;
  --border: #d3dae1;
  --border-strong: #728497;
  --nav-bg: #0f2948;
  --nav-bg-raised: #15335a;
  --nav-text: #ffffff;
  --nav-muted: #9fb3c8;
  --success: #1a6b4a;
  --success-bg: #e1ece7;
  --warning: #855015;
  --warning-bg: #efe8e1;
  --danger: #b02216;
  --danger-bg: #f5e2e1;

  --font-body: "Avenir Next", Inter, system-ui, sans-serif;
  --font-heading: "Avenir Next", Inter, system-ui, sans-serif;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;

  --radius-card: 12px;
  --radius-sm: 8px;
  --radius-btn: 6px;
  --shadow-card: 0 1px 2px rgba(20, 45, 36, 0.04);
  --container-max: 960px;
  --speed: 140ms;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-wrap: balance;
  margin: 0 0 var(--space-2);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-bar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--speed) ease, border-color var(--speed) ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/*
 * Checkbox/radio OPTION labels (a label directly wrapping its own
 * checkbox/radio, e.g. /signup/site's "monthly_report"/"consent"
 * checkboxes and its plan radio buttons) are the actual tap target --
 * the browser toggles the input when ANY part of the whole label is
 * tapped, not just the native control's own tiny box. Left as a plain
 * inline label, though, that clickable box was only as tall as a single
 * line of text (well under 24px), far short of the 44px minimum every
 * other control on this page already meets (see .btn's own min-height
 * above). Real, measured gap found building J18 (mobile tap-target
 * checks, docs/launch/PLAN.md §8's own E2E table) --
 * tests/e2e/journeys/mobile-signup.spec.js asserts these labels'
 * bounding boxes are >=44x44px. inline-block (not flex) so the long
 * consent sentence keeps wrapping normally at the viewport's own width
 * instead of being laid out as rigid, non-reflowing flex items.
 */
.field label:has(> input[type="checkbox"]),
.field label:has(> input[type="radio"]) {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  box-sizing: border-box;
}

.field input,
.field select {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
}

.field .error {
  color: var(--danger);
  font-size: 13px;
}

.banner {
  border-radius: var(--radius-sm);
  padding: 12px var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 14px;
}

.banner-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.banner-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.banner-success {
  background: var(--success-bg);
  color: var(--success);
}

.error-page {
  text-align: center;
  padding: var(--space-5) var(--space-3);
}

.error-page h1 {
  font-size: 28px;
}

.error-page p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto var(--space-4);
}

footer.app-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-3);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .app-bar-inner,
  main {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}

/*
 * Small utility classes -- exist specifically so form pages
 * (auth/*.html, signup/*.html) never need an inline style="" attribute.
 * A CSP style-src directive restricts inline style ATTRIBUTES the same
 * way it restricts <style> blocks, and a nonce only ever covers the
 * latter -- confirmed live: the browser's own console reported real
 * style-src violations (report-only, non-blocking) for every inline
 * style="" this app shipped with, the first time these pages were
 * actually opened in a browser under the app's CSP. Fixing this at the
 * source (real classes) rather than working around it is what actually
 * closes the gap WP6.4's later CSP-enforcement switch depends on.
 */
.card-form {
  max-width: 440px;
  margin: 0 auto;
}

.btn-block {
  width: 100%;
}

.hidden {
  display: none;
}

.text-small {
  font-size: 13px;
}

.text-small-muted {
  font-size: 13px;
  color: var(--text-muted);
}

.mt-space-3 {
  margin-top: var(--space-3);
}

.mb-space-3 {
  margin-bottom: var(--space-3);
}
