/*
 * MA-UP look: the Mora Associates design kit (version 1.0.0), applied on top
 * of CO-UP's stylesheet.
 *
 * How it works: the pages are the SAME for CO-UP and MA-UP, and so is
 * css/coup.css. On a Mora Associates server (COUP_COMPANY=mora), this file is
 * loaded AFTER coup.css and changes only what differs:
 *   - colours: navy instead of black, graphite text, mist page, ocean links;
 *   - one font: Plus Jakarta Sans (800 titles, 700 labels and buttons, 400 text);
 *   - the brand's short green rule above the page title, a leaf rule on the
 *     current menu entry, a green top on the login box (no gradients: the
 *     brand book forbids them);
 *   - square cards, 4 px buttons and fields, round tags (brand book);
 *   - status colours: OK forest on mint, warning on a pale solar tint with a
 *     solar dot, error in alert red. Always with a word, never colour alone.
 *
 * Source of every value: mora-associates-design-kit/css/mora.css and its README.
 * To change the look of MA-UP: change the kit first, then copy the values here.
 */

/* ---- Fonts (bundled: no call to Google from users' browsers) ---- */
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans-Regular.woff2") format("woff2");   font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans-Medium.woff2") format("woff2");    font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans-Bold.woff2") format("woff2");      font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ---- Tokens ----
 * The first block REDEFINES CO-UP's own variables, so every rule of coup.css
 * that says "black" now draws in navy, every "muted" in slate, and so on.
 * The second block adds the Mora Associates colours used further down. */
:root {
  --black: #051C40;        /* navy: titles, side menu, borders, primary button */
  --primary: #1D4F91;      /* ocean: links */
  --magenta: #1D4F91;      /* focus ring: ocean (CO-UP's was magenta) */
  --grey-light: #D9DDE3;   /* line-grey: hairlines */
  --input: #FFFFFF;        /* fields are white */
  --muted: #5E6878;        /* slate: secondary text */
  --error: #B42318;        /* alert red (addition to the brand book, errors only) */
  --font-display: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --gradient: #159A30;     /* where CO-UP draws its gradient, MA-UP draws plain green */

  --navy: #051C40; --navy-raised: #0B2550; --navy-line: #1E3A66;
  --green: #159A30; --forest: #0E7A26; --leaf: #2EBD4E; --ocean: #1D4F91;
  --solar: #F2B43A; --ice: #E7EDF6; --mint: #D8F0DD; --mist: #F6F6F6;
  --graphite: #3D4757; --slate: #5E6878; --fog: #C9D3E3;
  --alert: #B42318; --alert-tint: #FDECEA; --solar-tint: #FCEFD2;
  /* Corners (brand book): cards square, buttons and fields 4 px, tags round. */
  --radius: 4px; --radius-card: 0px; --radius-pill: 999px;
}

/* ---- Base: graphite text on a mist page, navy titles ---- */
body { background: var(--mist); color: var(--graphite); font-weight: 400; }
a:hover { color: var(--navy); }
:focus-visible { outline-width: 2px; }
h1, h2, h3 { color: var(--navy); }
h1 { font-weight: 800; letter-spacing: -0.015em; }
h2 { font-weight: 700; font-size: 18px; }
strong, b { color: var(--navy); }

/* ---- Page title: the brand's short green rule ABOVE it (instead of the gradient under) ---- */
.main > h1::after, .page-head h1::after { display: none; }
.main > h1::before, .page-head h1::before { content: ""; display: block; width: 48px; height: 4px;
  background: var(--green); border-radius: var(--radius-pill); margin-bottom: var(--space-3); }

/* ---- Side menu: navy, fog text, white + leaf rule for the current entry ---- */
.sidebar { background: var(--navy); }
.sidebar a { color: var(--fog); }
.menu a { font-weight: 500; }
.menu a:hover { background: var(--navy-raised); color: var(--white); }
.menu a[aria-current="page"] { background: var(--navy-raised); color: var(--white); }
.menu a[aria-current="page"]::before { background: var(--leaf); width: 3px; left: -4px; }
.menu .badge, .brand-sub, .sidebar-user .role { color: var(--fog); }
.sidebar-user { border-top-color: var(--navy-line); color: var(--fog); }
.sidebar-user strong { color: var(--white); }
.sidebar :focus-visible { outline-color: var(--leaf); }

/* The full Mora Associates lock-up (logo_wide): logo on top, the tool's name under it. */
.brand-wide { flex-direction: column; align-items: flex-start; gap: 10px; }
.brand-wide img { width: 136px; height: auto; border-radius: 0; }
.brand-wide .brand-name { font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.sidebar .brand-wide .brand-name { color: var(--white); }
.auth-box .brand-wide img, .page-head .brand-wide img { width: 160px; }
.page-head .brand-wide .brand-name { color: var(--navy); }
@media (max-width: 800px) {
  .sidebar .brand-wide { flex-direction: row; align-items: center; }
  .sidebar .brand-wide img { width: 120px; }      /* the logo's minimum width */
  .sidebar .brand-wide .brand-sub { display: none; }
  .js .sidebar .menu-toggle { background: transparent; color: var(--white); border-color: var(--fog); }
}
/* The "Menu" button on phones: outlined in fog on navy (kit). */
.sidebar .menu-toggle, .sidebar .menu-toggle:hover, .sidebar .menu-toggle:focus { background: transparent; color: var(--white); border-color: var(--fog); }

/* ---- Cards: square, white, hairline border ---- */
.card, .figure { background: var(--white); border-color: var(--grey-light); border-radius: var(--radius-card); }
.card { padding: var(--space-4); }
.figure .value { font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.warning { border-width: 1px; border-top: 4px solid var(--navy); background: var(--white); }
.confirm, .alert-item, pre.code { border-radius: var(--radius-card); }
.alert-item { background: var(--white); color: var(--graphite); }
.alert-item[aria-current="true"] { border: 1px solid var(--navy); border-left: 4px solid var(--navy); padding: 12px 12px 12px 9px; }

/* ---- Buttons: one navy primary per page, the rest outlined; 4 px corners ---- */
.btn { border-width: 1px; font-weight: 700; font-size: 15px; border-radius: var(--radius); }
.btn:hover { background: var(--ice); color: var(--navy); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-raised); border-color: var(--navy-raised); color: var(--white); }
.btn[aria-pressed="true"], .btn.is-active { background: var(--navy); color: var(--white); }
.btn-danger:hover { background: var(--alert-tint); color: var(--alert); }
.btn-quiet { border-color: var(--grey-light); }
.radio-buttons span { border-width: 1px; margin-right: -1px; font-weight: 700; }
.radio-buttons label:first-child span { border-radius: var(--radius) 0 0 var(--radius); }
.radio-buttons label:last-child span { border-radius: 0 var(--radius) var(--radius) 0; }
.tabs a { font-weight: 700; }
.pills a { border-color: var(--grey-light); background: var(--white); }
.pills a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---- Fields: white, 1 px slate edge (5.6:1), 4 px corners ---- */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number],
input[type=url], input[type=tel], input:not([type]), select, textarea {
  border: 1px solid var(--slate); border-radius: var(--radius); font-weight: 400; color: var(--graphite); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-width: 2px; }
.field label, .field legend, .label { color: var(--navy); }

/* ---- Tables: ice header, navy labels ---- */
.tbl th { background: var(--ice); color: var(--navy); border-bottom: 0; }
table.tbl th:first-child, table.tbl td:first-child { padding-left: 12px; }
table.tbl th:last-child, table.tbl td:last-child { padding-right: 12px; }
.tbl td { padding: 10px 12px; }

/* ---- Messages ---- */
.messages li { border: 1px solid var(--grey-light); border-left: 4px solid var(--green); background: var(--white);
  border-radius: var(--radius-card); color: var(--navy); }
.messages li.error { border-color: var(--alert-tint); border-left-color: var(--alert); background: var(--alert-tint); color: var(--alert); }

/* ---- Login pages: mist page, white box with the green top border ---- */
.auth { background: var(--mist); }
.auth-box { border: 1px solid var(--grey-light); border-radius: var(--radius-card); }
.auth-box::before { height: 4px; background: var(--green); }
.auth-box .brand-sub { color: var(--slate) !important; }

/* ---- Tags: round, with the kit's colours ---- */
.tag, .st, .cat { border-radius: var(--radius-pill); }
.tag { border-color: var(--grey-light); background: var(--ice); color: var(--navy); }
.tag-solid, .tag-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tag-grey { background: var(--ice); border-color: var(--ice); }
.tag-overdue { background: var(--alert-tint); border-color: var(--alert-tint); color: var(--alert); }

/* ---- Status: the only place where colour carries meaning, always with a word.
 * A small dot before the word, as in the kit's status tags. ---- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-ok   { background: var(--mint);       color: var(--forest); }   /* 4.6:1 */
.st-warn { background: var(--solar-tint); color: var(--navy); }     /* 14.8:1 */
.st-warn::before { background: var(--solar); }
.st-down { background: var(--alert-tint); color: var(--alert); }    /* 5.7:1 */
.st-none { background: var(--ice);        color: var(--navy); }
.st-none::before { background: var(--slate); }

/* Rule categories (Vital signs / Business pulse): told apart by tag and icon. */
.cat { border-color: var(--navy); }

/* ---- Small things ---- */
.quote, .diagnosis { border-left-color: var(--green); }
.steps .n { border-color: var(--navy); }
.chip { border-radius: var(--radius); }
