/* ==========================================================================
   FcnDocs public site (Areas/Public) — self-contained stylesheet.
   Deliberately independent of site.css/Bootstrap and of per-tenant theming:
   the brochure pages carry the fixed FcnDocs brand only, and the whole area
   (views + this file) can be lifted into a separate codebase.
   Contrast: all text/background pairs meet WCAG 2.1 AA.
   ========================================================================== */

:root {
  /* Fixed FcnDocs brand — matches BrandTheme.Default, never per-tenant. */
  --pub-primary: #2b5c8a;
  --pub-primary-dark: #234b71;
  --pub-primary-tint: #eaf1f7;
  --pub-accent: #3d7156;      /* darkened brand green; AA on white for small text */
  --pub-accent-tint: #ebf3ee;

  --pub-ink: #1c2a38;
  --pub-body-color: #3b4a59;
  --pub-muted: #55677a;       /* 4.6:1 on white — AA */
  --pub-border: #d8e0e8;
  --pub-bg: #ffffff;
  --pub-bg-alt: #f4f7fa;

  --pub-radius: 10px;
  --pub-shadow: 0 1px 2px rgb(28 42 56 / 0.06), 0 8px 24px rgb(28 42 56 / 0.07);
  --pub-container: 1100px;

  --pub-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.pub {
  margin: 0;
  font-family: var(--pub-font);
  font-size: 1.0625rem; /* ≥16px body text */
  line-height: 1.65;
  color: var(--pub-body-color);
  background: var(--pub-bg);
  -webkit-font-smoothing: antialiased;
}

.pub img,
.pub svg {
  max-width: 100%;
  vertical-align: middle;
}

.pub h1,
.pub h2,
.pub h3 {
  color: var(--pub-ink);
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.pub h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.pub h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.pub h3 { font-size: 1.2rem; }

.pub p { margin: 0 0 1em; }

.pub a {
  color: var(--pub-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.pub a:hover { color: var(--pub-primary-dark); }

.pub :focus-visible {
  outline: 3px solid var(--pub-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.pub-container {
  max-width: var(--pub-container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* --- Skip link ---------------------------------------------------------- */
/* Component color rules are scoped under .pub so they outrank the generic
   `.pub a` link color (class+element) — a bare single-class selector loses
   that specificity contest and renders blue-on-blue. */

.pub .pub-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--pub-primary);
  color: #fff;
  border-radius: 0 0 var(--pub-radius) 0;
}

.pub .pub-skip-link:focus {
  left: 0;
  color: #fff;
}

/* --- Header ------------------------------------------------------------- */

.pub-header {
  border-bottom: 1px solid var(--pub-border);
  background: var(--pub-bg);
}

.pub-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 0.9rem;
}

.pub .pub-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--pub-ink);
}

.pub-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pub-primary);
  color: #fff;
}

.pub-logo__name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pub-ink);
}

.pub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  margin-inline-end: auto;
}

.pub .pub-nav__link {
  color: var(--pub-body-color);
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.35rem;
}

.pub .pub-nav__link:hover { color: var(--pub-primary-dark); }

.pub .pub-nav__link--active {
  color: var(--pub-primary);
  box-shadow: inset 0 -2px 0 var(--pub-primary);
}

.pub-header__actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* --- Buttons ------------------------------------------------------------ */

.pub .pub-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.pub .pub-btn--primary {
  background: var(--pub-primary);
  color: #fff;
}

.pub .pub-btn--primary:hover {
  background: var(--pub-primary-dark);
  color: #fff;
}

.pub .pub-btn--ghost {
  border-color: var(--pub-primary);
  color: var(--pub-primary);
  background: transparent;
}

.pub .pub-btn--ghost:hover {
  background: var(--pub-primary-tint);
  color: var(--pub-primary-dark);
}

.pub .pub-btn--lg {
  padding: 0.8rem 1.7rem;
  font-size: 1.1rem;
}

/* --- Hero ---------------------------------------------------------------- */

.pub-hero {
  background:
    radial-gradient(1000px 400px at 85% -10%, var(--pub-primary-tint), transparent 70%),
    var(--pub-bg);
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.pub-hero__inner {
  max-width: 46rem;
}

.pub-hero p.pub-lead {
  font-size: 1.25rem;
  color: var(--pub-muted);
}

.pub-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.pub-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pub-accent);
  margin-bottom: 0.9rem;
}

.pub-lead {
  font-size: 1.2rem;
  color: var(--pub-muted);
}

/* --- Sections ------------------------------------------------------------ */

.pub-section {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}

.pub-section--alt { background: var(--pub-bg-alt); }

.pub-section__intro {
  max-width: 44rem;
  margin-bottom: 2.25rem;
}

/* --- Cards / feature grid ------------------------------------------------ */

.pub-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.pub-card {
  background: var(--pub-bg);
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  box-shadow: var(--pub-shadow);
  padding: 1.5rem;
}

/* Cards title with h2 or h3 depending on the page's outline — same visual size. */
.pub-card h2,
.pub-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4em;
}

.pub-card p:last-child { margin-bottom: 0; }

.pub-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--pub-primary-tint);
  color: var(--pub-primary);
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
}

/* --- Split (text + panel) ------------------------------------------------ */

.pub-split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .pub-split { grid-template-columns: 1fr 1fr; }
  .pub-split--reverse > :first-child { order: 2; }
}

.pub-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}

.pub-checklist li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.65rem;
}

.pub-checklist li::before {
  content: "✓" / ""; /* alt-text syntax: decorative, keeps "check" out of screen-reader output */
  position: absolute;
  left: 0;
  top: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--pub-accent-tint);
  color: var(--pub-accent);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- CTA band ------------------------------------------------------------ */

.pub-cta {
  background: var(--pub-primary);
  color: #fff;
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
}

.pub-cta h2 { color: #fff; }

.pub-cta p {
  color: #dbe7f2; /* AA on --pub-primary */
  max-width: 40rem;
}

.pub-cta .pub-btn--primary {
  background: #fff;
  color: var(--pub-primary-dark);
}

.pub-cta .pub-btn--primary:hover { background: var(--pub-primary-tint); }

.pub-cta .pub-btn--ghost {
  border-color: #fff;
  color: #fff;
}

.pub-cta .pub-btn--ghost:hover {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

/* --- Prose pages (privacy, terms, accessibility, about) ------------------ */

.pub-prose {
  max-width: 46rem;
}

.pub-prose h2 { margin-top: 2em; }
.pub-prose h3 { margin-top: 1.6em; }

.pub-prose ul { padding-left: 1.3rem; }
.pub-prose li { margin-bottom: 0.4rem; }

.pub-updated {
  color: var(--pub-muted);
  font-size: 0.95rem;
}

/* --- FAQ ------------------------------------------------------------------ */

.pub-faq {
  max-width: 46rem;
}

.pub-faq details {
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  background: var(--pub-bg);
  margin-bottom: 0.9rem;
  padding: 0;
}

.pub-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--pub-ink);
  padding: 1rem 1.25rem;
  list-style-position: outside;
}

/* Questions are h2s (heading-navigation jumps between them) but render as plain summary text. */
.pub-faq summary h2 {
  display: inline;
  font: inherit;
  letter-spacing: normal;
  margin: 0;
}

.pub-faq details[open] summary { border-bottom: 1px solid var(--pub-border); }

.pub-faq details > div {
  padding: 1rem 1.25rem;
}

.pub-faq details > div p:last-child { margin-bottom: 0; }

/* --- Forms ---------------------------------------------------------------- */

.pub-form {
  max-width: 36rem;
}

.pub-form__field { margin-bottom: 1.25rem; }

.pub-form label {
  display: block;
  font-weight: 600;
  color: var(--pub-ink);
  margin-bottom: 0.35rem;
}

.pub-form input,
.pub-form textarea {
  width: 100%;
  font: inherit; /* ≥16px */
  color: var(--pub-ink);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--pub-border);
  border-radius: 8px;
  background: var(--pub-bg);
}

.pub-form input:focus,
.pub-form textarea:focus {
  outline: 3px solid var(--pub-primary);
  outline-offset: 1px;
  border-color: var(--pub-primary);
}

.pub-form .pub-error {
  display: block;
  color: #a4262c; /* AA on white */
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

.pub-form .pub-error-summary {
  border: 1px solid #a4262c;
  border-radius: var(--pub-radius);
  background: #fdf3f4;
  color: #a4262c;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
}

.pub-form .pub-error-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* Honeypot — off-screen for humans, present for bots. Never display:none, some
   bots skip hidden fields. */
.pub-field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pub .pub-error-summary__title {
  font-size: 1.05rem;
  letter-spacing: normal;
  color: inherit;
  margin: 0 0 0.5rem;
}

/* --- Notices --------------------------------------------------------------- */

.pub-notice {
  border: 1px solid var(--pub-border);
  border-left: 4px solid var(--pub-accent);
  border-radius: var(--pub-radius);
  background: var(--pub-bg-alt);
  padding: 1rem 1.25rem;
  margin-block: 1.5rem;
}

/* --- Footer ---------------------------------------------------------------- */

.pub-footer {
  border-top: 1px solid var(--pub-border);
  background: var(--pub-bg-alt);
  padding-top: 3rem;
  margin-top: 0;
}

.pub-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  padding-bottom: 2rem;
}

.pub-footer__brand p {
  color: var(--pub-muted);
  max-width: 18rem;
}

/* .pub-scoped so the h2 usage outranks the base `.pub h2` sizing. */
.pub .pub-footer__heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pub-muted);
  margin: 0 0 0.9rem;
}

.pub-footer nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pub-footer nav a {
  color: var(--pub-body-color);
  text-decoration: none;
}

.pub-footer nav a:hover {
  color: var(--pub-primary-dark);
  text-decoration: underline;
}

.pub-footer__legal {
  border-top: 1px solid var(--pub-border);
  padding-block: 1.25rem;
  color: var(--pub-muted);
  font-size: 0.95rem;
}

.pub-footer__legal p { margin: 0; }

/* --- Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .pub *,
  .pub *::before,
  .pub *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
