/* Ulti-Care 360 — brand layer.
 *
 * Two things live here, and both exist because the portals each invented their own:
 *
 *   1. the palette, taken from the logo (navy ink, teal action, amber signal, mint on dark) rather than
 *      the teal/orange guesses that vary per portal;
 *   2. the mark itself. The sidebar used to show a 42px crimson gradient square with a white "+" in it -
 *      a placeholder that contradicts the brand, next to an orange-and-teal interface.
 *
 * Load it after the portal's own stylesheet: it sets tokens and the brand lockup only, so a portal that
 * adopts it keeps its layout and changes its voice.
 */

:root {
  /* Logo palette. Sampled from the supplied lockup; replace with the designer's hex values when they arrive. */
  --uc-navy: #123a4d;
  --uc-navy-deep: #0b2633;
  --uc-teal: #12707c;
  --uc-teal-bright: #1b8b95;
  --uc-amber: #e3a455;
  --uc-mint: #a9c4bc;

  /* Surfaces and text */
  --uc-ink: #0f1d26;
  --uc-body: #4a5a63;
  --uc-line: #dfe6e9;
  --uc-surface: #ffffff;
  --uc-canvas: #f6f9fa;

  /* One stacking scale. The UI guide used 2,147,482,000, which outranked the portal's own toasts
     (99,999) - a help panel could hide "This consent is required to register". */
  --z-dock: 900;
  --z-dock-panel: 950;
  --z-sheet: 980;
  --z-modal: 1000;
  --z-toast: 1100;
}

[data-theme="dark"] {
  --uc-ink: #e6eef0;
  --uc-body: #a3b3ba;
  --uc-line: #223540;
  --uc-surface: #10222c;
  --uc-canvas: #0b1a21;
}

/* ── the mark ──────────────────────────────────────────────────────────────────────────────────────── */

/* The portal's stylesheets paint .brand-mark as a gradient square with `!important` - and
   `shared/health-theme.css` loads a *second* copy at runtime, so a same-specificity rule of mine loses on
   order. These selectors are deliberately one step more specific than anything that paints it
   (`:root[data-theme="light"] .brand-mark`), and they set the same properties, so the logo wins in both
   themes. It is a logo: nothing else may draw there.
   Background-image rather than an <img>, because the first attempt used two <img> elements and the portal's
   own `img` rules kept both visible. */
html .brand .brand-mark,
html .brand-mark.uc-brand-mark {
  background-image: url("./brand/mark.svg") !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: transparent !important;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

html[data-theme="dark"] .brand .brand-mark,
html[data-theme="dark"] .brand-mark.uc-brand-mark {
  background-image: url("./brand/mark-dark.svg") !important;
}

/* The light rule needs the same weight as the dark one. `html .brand .brand-mark` is (0,2,1) and loses to
   health-theme's `:root[data-theme="light"] .brand-mark` (0,3,0) - which is exactly why the mark showed in
   dark mode and a white square in light. */
html[data-theme="light"] .brand .brand-mark,
html[data-theme="light"] .brand-mark.uc-brand-mark {
  background-image: url("./brand/mark.svg") !important;
}

/* Header/mark-only use, e.g. a collapsed mobile nav. */
html .uc-mark {
  width: 28px;
  height: 28px;
  display: inline-block;
  background-image: url("./brand/mark.svg") !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

html[data-theme="dark"] .uc-mark { background-image: url("./brand/mark-dark.svg") !important; }

/* Header/mark-only use, e.g. a collapsed mobile nav. */
.uc-mark {
  width: 28px;
  height: 28px;
  display: inline-block;
  background: url("./brand/mark.svg") center / contain no-repeat;
}

[data-theme="dark"] .uc-mark { background-image: url("./brand/mark-dark.svg"); }

/* The wordmark stays text: it is a typeface, and a traced outline would be subtly off-brand.
   "360" carries the teal, and the tagline is reserved for places where it is legible. */
.brand-text strong { letter-spacing: -0.01em; }
.brand-360 { color: var(--uc-teal-bright); }
[data-theme="dark"] .brand-360 { color: #7fc4c9; }

.uc-tagline {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--uc-body);
  margin-top: 2px;
}

/* Below 140px of lockup width the tagline is illegible; keep it off the small headers. */
@media (max-width: 640px) {
  .uc-tagline { display: none; }
}

/* ── the real brand artwork (light + dark) ────────────────────────────────────────────────────────────── */

/* The logo carries the wordmark, so the text lockup next to it goes: two "Ulti-Care 360"s side by side is
   what a placeholder looks like. The mark is a background image for the same reason as before - a competing
   `img` rule cannot hide the wrong theme's artwork. */
html .brand .brand-mark {
  width: 168px !important;
  height: 42px !important;
  background-image: url("./brand/logo-light.png") !important;
  background-size: contain !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .brand .brand-mark {
  background-image: url("./brand/logo-dark.png") !important;
}

html .brand .brand-text {
  display: none !important;
}
/* The header mark lost its background-image to a more specific rule (measured: sized 168x42, image "none"),
   which would leave an empty box where the name used to be. The text lockup is restored rather than shipping a
   gap; the artwork is on the landing page, where it was asked for, and the header can take it once the winning
   rule there is identified the same way the card surface was. */
html .brand .brand-text {
  display: flex !important;
}

html .brand .brand-mark {
  background-image: none !important;
}