/* Vertex Automation design tokens, direction "Console".
   Shared by the dashboard (panel.css), the sign-in page and the static pages (site.css).
   Graphite neutrals, one cobalt accent. IBM Plex Sans for the interface, IBM Plex Mono only
   where the value is machine data (IDs, counts, timestamps, slugs). */

/* ---------- Fonts (self-hosted, SIL OFL: fonts/IBM-Plex-OFL.txt) ---------- */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Neutrals: cool graphite */
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --line: #dfe2e7;
  --line-strong: #c4c9d1;
  --text: #15181d;
  --text-2: #464c57;
  --text-3: #5f6570;

  /* The one accent: cobalt */
  --accent: #1f55e0;
  --accent-hover: #1946bd;
  --accent-fg: #ffffff;
  --accent-soft: rgb(31 85 224 / 9%);
  --accent-line: rgb(31 85 224 / 35%);

  /* Status, used only for state, never decoration */
  --ok: #17714a;
  --ok-soft: rgb(23 113 74 / 10%);
  --warn: #935400;
  --warn-soft: rgb(214 140 20 / 14%);
  --danger: #b42318;
  --danger-soft: rgb(180 35 24 / 9%);

  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --shadow-pop: 0 1px 2px rgb(16 20 28 / 8%), 0 8px 24px rgb(16 20 28 / 10%);

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-xs: 0.75rem;    /* 12 meta, table heads */
  --fs-sm: 0.8125rem;  /* 13 tables, controls */
  --fs-md: 0.875rem;   /* 14 body */
  --fs-lg: 1rem;       /* 16 section titles */
  --fs-xl: 1.25rem;    /* 20 panel titles */
  --fs-2xl: 1.625rem;  /* 26 page title */
  --lh: 1.45;

  /* Space, 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Radius follows hierarchy: small things are sharper */
  --r-1: 3px;  /* chips, kbd */
  --r-2: 5px;  /* controls, buttons */
  --r-3: 8px;  /* panels */

  --sidebar-w: 236px;
  --row-h: 36px;
  --content-width: 72rem;

  /* Older names, kept so the Message Builder and not-yet-moved pages follow the new palette */
  --colour-background: var(--bg);
  --colour-surface: var(--surface);
  --colour-surface-raised: var(--surface);
  --colour-hover: var(--surface-3);
  --colour-border: var(--line);
  --colour-border-strong: var(--line-strong);
  --colour-text: var(--text);
  --colour-muted: var(--text-3);
  --colour-accent: var(--accent);
  --colour-accent-strong: var(--accent-hover);
  --colour-accent-soft: var(--accent-soft);
  --colour-on-accent: var(--accent-fg);
  --colour-success: var(--ok);
  --colour-success-soft: var(--ok-soft);
  --colour-warning: var(--warn);
  --colour-warning-soft: var(--warn-soft);
  --colour-danger: var(--danger);
  --colour-danger-soft: var(--danger-soft);
  --shadow-raised: var(--shadow-pop);
  --radius: var(--r-3);
  --radius-small: var(--r-2);
  --font-body: var(--font-sans);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131519;
    --surface: #1a1d22;
    --surface-2: #1f2228;
    --surface-3: #262a31;
    --line: #2b3038;
    --line-strong: #3b414b;
    --text: #e5e7eb;
    --text-2: #aab0ba;
    --text-3: #8b929d;
    --accent: #7d9cff;
    --accent-hover: #9bb3ff;
    --accent-fg: #0f1730;
    --accent-soft: rgb(125 156 255 / 12%);
    --accent-line: rgb(125 156 255 / 40%);
    --ok: #5cc98f;
    --ok-soft: rgb(92 201 143 / 12%);
    --warn: #eeb558;
    --warn-soft: rgb(238 181 88 / 13%);
    --danger: #f2796e;
    --danger-soft: rgb(242 121 110 / 12%);
    --shadow-pop: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 40%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131519;
  --surface: #1a1d22;
  --surface-2: #1f2228;
  --surface-3: #262a31;
  --line: #2b3038;
  --line-strong: #3b414b;
  --text: #e5e7eb;
  --text-2: #aab0ba;
  --text-3: #8b929d;
  --accent: #7d9cff;
  --accent-hover: #9bb3ff;
  --accent-fg: #0f1730;
  --accent-soft: rgb(125 156 255 / 12%);
  --accent-line: rgb(125 156 255 / 40%);
  --ok: #5cc98f;
  --ok-soft: rgb(92 201 143 / 12%);
  --warn: #eeb558;
  --warn-soft: rgb(238 181 88 / 13%);
  --danger: #f2796e;
  --danger-soft: rgb(242 121 110 / 12%);
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 40%);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--s-5);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-1);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

code {
  padding: 1px 4px;
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--text);
}

.muted {
  color: var(--text-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* data-motion="normal" is an account setting that keeps animation on whatever the device asks */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="normal"]) *,
  :root:not([data-motion="normal"]) *::before,
  :root:not([data-motion="normal"]) *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.005em;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
}

/* The outline shield follows the text colour and the V takes the account's colour theme */
.brand__mark-shield {
  fill: currentColor;
}

.brand__mark-v {
  fill: var(--accent);
}

.brand__name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The Phoenix style's logo and wordmark; phoenix.css shows them in place of the mark and name */
.brand__logo,
.brand__wordmark,
.signin__logo {
  display: none;
}

/* ---------- Buttons (.button* are the older names, same look) ---------- */

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 32px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--text);
  font: 500 var(--fs-sm) / 1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover,
.button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn:disabled,
.btn[aria-disabled="true"],
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary,
.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn--primary:hover,
.button--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.btn--ghost,
.button--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}

.btn--ghost:hover,
.button--ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn--danger,
.button--danger {
  background: var(--surface);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.btn--danger:hover,
.button--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--sm,
.button--small {
  min-height: 26px;
  padding: 0 var(--s-2);
  font-size: var(--fs-xs);
}

.btn--lg,
.button--large {
  min-height: 44px;
  padding: 0 var(--s-5);
  font-size: var(--fs-md);
  font-weight: 600;
}

.btn svg,
.button svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.btn--lg svg,
.button--large svg {
  width: 20px;
  height: 20px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* ---------- Flash: an inline message on the page ---------- */

.flash {
  position: relative;
  margin: 0;
  padding: var(--s-3) var(--s-4) var(--s-3) 40px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.flash::before {
  content: "";
  position: absolute;
  top: calc(var(--s-3) + 1px);
  left: 14px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  -webkit-mask: url("icons/info.svg") center / 16px no-repeat;
  mask: url("icons/info.svg") center / 16px no-repeat;
}

.flash + .flash {
  margin-top: var(--s-2);
}

.flash__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.flash__title {
  font-weight: 600;
}

.flash--error {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface));
}

.flash--error::before {
  background: var(--danger);
  -webkit-mask-image: url("icons/alert.svg");
  mask-image: url("icons/alert.svg");
}

.flash--warning {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface));
}

.flash--warning::before {
  background: var(--warn);
  -webkit-mask-image: url("icons/warning.svg");
  mask-image: url("icons/warning.svg");
}

.flash--ok,
.flash--success {
  border-left-color: var(--ok);
}

.flash--ok::before,
.flash--success::before {
  background: var(--ok);
  -webkit-mask-image: url("icons/check.svg");
  mask-image: url("icons/check.svg");
}

/* ---------- Footer and cookie notice ---------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--s-4);
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.site-footer__copy {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  color: inherit;
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  inset: auto var(--s-4) var(--s-4);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  max-width: 36rem;
  margin: 0 auto;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm);
}

.cookie-banner__text {
  flex: 1 1 16rem;
  margin: 0;
  color: var(--text-2);
}
