/* The public website on statecontrolsystem.com (Home, About, Products, Contact, and the shared
   header, navigation and footer added to Terms and Privacy). One look for all of them: the site's
   Montserrat and navy header, a white page (dark when the device or the member's choice says so),
   square corners everywhere. Every class starts with "ps-" so it never touches the member area,
   the admin or the legal text. The only script is public-site.js (the phone menu). */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400..800&display=swap');

:root {
  --ps-navy: #0f3a63;
  --ps-navy-deep: #0b2c4b;
  --ps-accent: #0e7e4e;
  --ps-accent-hover: #0b6a41;
  --ps-bg: #ffffff;
  --ps-bg-soft: #f4f6f9;
  --ps-text: #1b2430;
  --ps-text-muted: #4f5b69;
  --ps-border: #d9dee5;
  --ps-link: #0b5cad;
  --ps-focus: #f2a33a;
  --ps-on-navy: #ffffff;
  --ps-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ps-navy: #17395c;
    --ps-navy-deep: #112c47;
    --ps-accent: #2fa56f;
    --ps-accent-hover: #3dba80;
    --ps-bg: #121417;
    --ps-bg-soft: #1b1f24;
    --ps-text: #e9edf1;
    --ps-text-muted: #b3bcc6;
    --ps-border: #333a43;
    --ps-link: #7cb8ff;
  }
}

:root[data-theme="dark"] {
  --ps-navy: #17395c;
  --ps-navy-deep: #112c47;
  --ps-accent: #2fa56f;
  --ps-accent-hover: #3dba80;
  --ps-bg: #121417;
  --ps-bg-soft: #1b1f24;
  --ps-text: #e9edf1;
  --ps-text-muted: #b3bcc6;
  --ps-border: #333a43;
  --ps-link: #7cb8ff;
}

/* ---------- The new pages' own page (Terms and Privacy keep styles.css for theirs) ---------- */
.ps-page {
  margin: 0;
  background: var(--ps-bg);
  color: var(--ps-text);
  font-family: var(--ps-font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.ps-page *,
.ps-page *::before,
.ps-page *::after {
  box-sizing: border-box;
}

.ps-header *,
.ps-footer *,
.ps-header *::before,
.ps-footer *::before {
  box-sizing: border-box;
  border-radius: 0;
}

.ps-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ps-bg);
  color: var(--ps-text);
  font-family: var(--ps-font);
  font-weight: 700;
}

.ps-skip:focus {
  left: 16px;
  top: 8px;
}

/* Visible keyboard focus everywhere on these pages */
.ps-page a:focus-visible,
.ps-page button:focus-visible,
.ps-header a:focus-visible,
.ps-header button:focus-visible,
.ps-footer a:focus-visible {
  outline: 3px solid var(--ps-focus);
  outline-offset: 2px;
}

/* ---------- Header and navigation ---------- */
.ps-header {
  background: var(--ps-navy);
  color: var(--ps-on-navy);
  font-family: var(--ps-font);
  font-size: 16px;
  line-height: 1.4;
}

.ps-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 20px;
}

.ps-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ps-on-navy);
  text-decoration: none;
}

.ps-brand img {
  display: block;
  width: 171px;
  height: 42px;
}

.ps-brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}

.ps-menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0;
  background: transparent;
  color: var(--ps-on-navy);
  font: 600 16px/1 var(--ps-font);
  cursor: pointer;
}

.ps-menu-icon,
.ps-menu-icon::before,
.ps-menu-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.ps-menu-icon {
  position: relative;
}

.ps-menu-icon::before,
.ps-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.ps-menu-icon::before {
  top: -6px;
}

.ps-menu-icon::after {
  top: 6px;
}

.ps-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ps-nav a {
  display: inline-block;
  padding: 10px 12px;
  color: var(--ps-on-navy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.ps-nav a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.ps-nav a[aria-current="page"] {
  border-bottom-color: var(--ps-on-navy);
}

.ps-nav .ps-nav-signin {
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Phones: the navigation folds into the Menu button (public-site.js); without the script it stays open */
@media (max-width: 860px) {
  .ps-header.ps-has-menu .ps-menu-btn {
    display: inline-flex;
  }

  .ps-header.ps-has-menu .ps-nav {
    display: none;
    flex: 0 0 100%;
  }

  .ps-header.ps-has-menu.ps-menu-open .ps-nav {
    display: block;
  }

  .ps-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 8px;
  }

  .ps-nav li {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .ps-nav a {
    display: block;
    padding: 12px 4px;
    border-bottom: 0;
    border-left: 3px solid transparent;
  }

  .ps-nav a[aria-current="page"] {
    border-left-color: var(--ps-on-navy);
    padding-left: 10px;
  }

  .ps-nav .ps-nav-signin {
    margin: 8px 0 0;
    padding-left: 10px;
  }
}

/* ---------- Main content ---------- */
.ps-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.ps-main h1,
.ps-main h2,
.ps-main h3 {
  font-family: var(--ps-font);
  line-height: 1.25;
  color: var(--ps-text);
}

.ps-main h1 {
  margin: 0 0 16px;
  font-size: 40px;
  font-weight: 800;
}

.ps-main h2 {
  margin: 40px 0 12px;
  font-size: 26px;
  font-weight: 700;
}

.ps-main h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.ps-main p {
  margin: 0 0 16px;
  max-width: 70ch;
}

.ps-main a {
  color: var(--ps-link);
}

.ps-lead {
  font-size: 19px;
  color: var(--ps-text-muted);
}

.ps-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border: 2px solid var(--ps-accent);
  border-radius: 0;
  background: var(--ps-accent);
  color: #ffffff;
  font: 700 16px/1.2 var(--ps-font);
  text-decoration: none;
}

.ps-main a.ps-btn {
  color: #ffffff;
}

.ps-btn:hover {
  background: var(--ps-accent-hover);
  border-color: var(--ps-accent-hover);
}

.ps-btn-secondary,
.ps-main a.ps-btn-secondary {
  background: transparent;
  color: var(--ps-accent);
}

.ps-btn-secondary:hover {
  background: var(--ps-bg-soft);
  color: var(--ps-accent);
}

/* Home: the hero with the method diagram as its banner (dark text on a transparent image: always on white) */
.ps-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

@media (min-width: 960px) {
  .ps-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

.ps-figure {
  margin: 0;
  border: 1px solid var(--ps-border);
  background: #ffffff;
  padding: 12px;
}

.ps-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.ps-figure figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #4f5b69;
}

.ps-section {
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--ps-border);
}

.ps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--ps-border);
}

.ps-list li + li {
  border-top: 1px solid var(--ps-border);
}

.ps-list a {
  display: block;
  padding: 14px 16px;
  font-weight: 600;
  text-decoration: none;
}

.ps-list a:hover {
  background: var(--ps-bg-soft);
  text-decoration: underline;
}

/* About: the photo of Ben beside the text */
.ps-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (min-width: 860px) {
  .ps-about {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
}

.ps-photo {
  margin: 0;
  max-width: 360px;
}

@media (max-width: 859px) {
  .ps-photo {
    max-width: 220px;
  }
}

.ps-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ps-border);
  border-radius: 0;
}

/* Products: one card per course */
.ps-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.ps-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid var(--ps-border);
  border-top: 4px solid var(--ps-navy);
  border-radius: 0;
  background: var(--ps-bg);
}

.ps-main .ps-card-title {
  margin: 0;
  font-size: 21px;
}

.ps-card p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--ps-text-muted);
}

.ps-card .ps-btn {
  align-self: flex-start;
  margin-top: 8px;
}

.ps-note {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--ps-accent);
  background: var(--ps-bg-soft);
}

/* Contact: the details list and the text-updates box */
.ps-details {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 10px 20px;
  margin: 0;
}

.ps-details dt {
  font-weight: 700;
}

.ps-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .ps-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .ps-details dd {
    margin-bottom: 12px;
  }
}

.ps-box {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--ps-border);
  background: var(--ps-bg-soft);
}

.ps-box p:last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.ps-footer {
  background: var(--ps-navy-deep);
  color: var(--ps-on-navy);
  font-family: var(--ps-font);
  font-size: 15px;
  line-height: 1.6;
}

.ps-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 20px 28px;
}

@media (min-width: 860px) {
  .ps-footer-inner {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.ps-footer p {
  margin: 0 0 6px;
}

.ps-footer a {
  color: var(--ps-on-navy);
}

.ps-footer-name {
  font-weight: 700;
}

.ps-footer-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ps-footer-small {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Terms and Privacy: the shared header and footer around their own card ----------
   Their body is styles.css's centred flex row (padding 0 16px, wrapping under the card); the header
   and footer take a full-width line each, edge to edge. Nothing inside their card changes. */
body.legal-body > .ps-header,
body.legal-body > .ps-footer {
  flex: 0 0 calc(100% + 32px);
  width: calc(100% + 32px);
  max-width: none;
  margin: 0 -16px;
}

body.legal-body > .ps-footer {
  margin-top: 24px;
}
