/* Built by app-shared/scripts/build-signal.mjs from app-shared/signal. Edit the sources, not this file. */
/* Geist and Geist Mono, SIL Open Font License 1.1 (fonts/OFL.txt), from the geist npm package 1.9.0. */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Centryx Signal design tokens. DESIGN.md holds the rules for using them. */
.cx-signal {
  --sg-ground: #E6E8EB;
  --sg-panel: #F5F6F7;
  --sg-surface: #FFFFFF;
  --sg-sunken: #EAECEE;
  --sg-segment-track: #DCDFE3;
  --sg-line: #ECEEF0;
  --sg-line-strong: #D2D5D9;

  --sg-ink: #0F1115;
  --sg-ink-raised: #262A31;
  --sg-ink-hover: #1B1E24;
  --sg-ink-2: #3D434B;
  --sg-ink-3: #5C636C;
  --sg-hollow: #8A9099;
  --sg-rail-text: #A9AEB6;

  --sg-signal: #D3F24A;
  --sg-signal-soft: #EEF8C6;
  --sg-signal-ink: #3F5200;
  /* Healthy, done and paid: a fixed lime tint, so an admin's accent choice cannot make it look like a warning. */
  --sg-healthy-soft: #EEF8C6;
  --sg-healthy-ink: #3F5200;

  --sg-danger: #E5484D;
  --sg-danger-ink: #B02A2F;
  --sg-danger-soft: #FCEBEB;
  --sg-warn: #F0A530;
  --sg-warn-ink: #8F5600;
  --sg-warn-soft: #FFF2DB;
  --sg-ok-ink: #2E7D4F;
  --sg-ok-soft: #E7F3EC;

  --sg-font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sg-font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --sg-radius-tag: 6px;
  --sg-radius-field: 10px;
  --sg-radius-card: 16px;
  --sg-radius-panel: 22px;
  --sg-radius-pill: 999px;

  --sg-shadow-panel: 0 0 0 1px rgba(15, 17, 21, 0.06), 0 1px 2px rgba(15, 17, 21, 0.04), 0 18px 40px -26px rgba(15, 17, 21, 0.25);
  --sg-shadow-raised: 0 0 0 1px rgba(15, 17, 21, 0.05), 0 1px 2px rgba(15, 17, 21, 0.06), 0 6px 14px -8px rgba(15, 17, 21, 0.18);
  --sg-shadow-selected: 0 0 0 1.5px #0F1115, 0 12px 26px -16px rgba(15, 17, 21, 0.4);
  --sg-shadow-overlay: 0 0 0 1px rgba(15, 17, 21, 0.08), 0 30px 80px -20px rgba(15, 17, 21, 0.55);
  --sg-top-light: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --sg-halo: color-mix(in srgb, var(--sg-signal) 55%, transparent);
  --sg-focus: 0 0 0 1.5px #0F1115, 0 0 0 4px var(--sg-halo);

  --sg-ease: cubic-bezier(0.2, 0, 0, 1);
  --sg-duration: 160ms;
}

/* The staff sign-in screens (sign in, emailed or app code, forgot, reset and set password), in the Signal language
   whatever the new-look setting. Built into modules/signal_ui/assets/auth.css after the fonts and tokens. The page is a
   split: the form on the ground, and a white panel where a field of texture dots settles from scattered to ordered,
   with one lime dot (the person) that lights once the form is complete (auth.js). Everything is scoped to
   body.cx-auth and outranks the tenant colours theme_style prints into the head. */

body.cx-auth {
  margin: 0;
  min-height: 100vh;
  background: var(--sg-panel);
  color: var(--sg-ink);
  font-family: var(--sg-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.cx-auth > * {
  font-size: inherit;
}

body.cx-auth ::selection {
  background: var(--sg-signal);
  color: var(--sg-ink);
}

body.cx-auth *,
body.cx-auth *::before,
body.cx-auth *::after {
  box-sizing: border-box;
}

.cx-auth-page {
  display: grid;
  grid-template-columns: minmax(440px, 44%) minmax(0, 1fr);
  min-height: 100vh;
}

/* The form side: brand, form and footer share one 380px track, so every left edge lines up. */
.cx-auth-side {
  display: flex;
  justify-content: center;
  padding: 32px 40px;
}

.cx-auth-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
}

.cx-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  color: var(--sg-ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.cx-auth-tile {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--sg-ink-raised);
  box-shadow: var(--sg-top-light), 0 0 0 1px rgba(15, 17, 21, 0.06);
  color: #F8F9FD;
}

.cx-auth-tile svg {
  display: block;
  width: 15px;
  height: 20px;
}

.cx-auth-tile .spark {
  fill: var(--sg-signal);
}

.cx-auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 56px;
}

.cx-auth-title {
  margin: 0 0 10px;
  color: var(--sg-ink);
  font-family: var(--sg-font);
  font-size: 40px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.cx-auth-lede {
  margin: 0 0 28px;
  max-width: 38ch;
  color: var(--sg-ink-3);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.cx-auth-title + .cx-auth-form,
.cx-auth-title + .row {
  margin-top: 22px;
}

/* Flash alerts and validation errors from the controller, as soft callouts. */
.cx-auth .row {
  margin: 0;
}

.cx-auth #alerts {
  float: none;
  width: auto;
  padding: 0;
}

.cx-auth .alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  text-align: left !important;
  text-shadow: none;
  box-shadow: none;
}

.cx-auth .alert p {
  margin: 0;
}

.cx-auth .alert p + p {
  margin-top: 4px;
}

.cx-auth .alert-success {
  background: var(--sg-healthy-soft);
  color: var(--sg-healthy-ink);
}

.cx-auth .alert-danger {
  background: var(--sg-danger-soft);
  color: var(--sg-danger-ink);
}

.cx-auth .alert-warning {
  background: var(--sg-warn-soft);
  color: var(--sg-warn-ink);
}

.cx-auth .alert-info {
  background: var(--sg-sunken);
  color: var(--sg-ink-2);
}

/* Fields */
.cx-auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}

.cx-auth-field {
  display: grid;
  gap: 7px;
}

.cx-auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.cx-auth-label {
  margin: 0;
  color: var(--sg-ink-2);
  font-size: 13px;
  font-weight: 500;
}

body.cx-auth .cx-auth-input {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--sg-line-strong);
  border-radius: 10px;
  background: var(--sg-surface);
  color: var(--sg-ink);
  font-family: var(--sg-font);
  font-size: 15px;
  box-shadow: none;
  caret-color: var(--sg-ink);
  transition: border-color var(--sg-duration) var(--sg-ease), box-shadow var(--sg-duration) var(--sg-ease);
}

body.cx-auth .cx-auth-input:hover {
  border-color: #B9BEC4;
}

body.cx-auth .cx-auth-input:focus {
  outline: none;
  border-color: var(--sg-ink);
  box-shadow: 0 0 0 0.5px var(--sg-ink), 0 0 0 4px var(--sg-halo);
}

body.cx-auth .cx-auth-input::placeholder {
  color: var(--sg-ink-3);
  opacity: 1;
}

body.cx-auth .cx-auth-input[aria-invalid="true"] {
  border-color: var(--sg-danger);
}

/* Browsers paint autofilled fields their own yellow or blue; keep the field white. */
body.cx-auth .cx-auth-input:-webkit-autofill {
  -webkit-text-fill-color: var(--sg-ink);
  box-shadow: 0 0 0 40px var(--sg-surface) inset;
}

body.cx-auth .cx-auth-input:-webkit-autofill:focus {
  box-shadow: 0 0 0 40px var(--sg-surface) inset, 0 0 0 0.5px var(--sg-ink), 0 0 0 4px var(--sg-halo);
}

/* The emailed or app code is a measured value: mono, spaced. */
body.cx-auth .cx-auth-code {
  height: 54px;
  font-family: var(--sg-font-mono);
  font-size: 20px;
  letter-spacing: 0.14em;
}

.cx-auth-secret {
  position: relative;
}

body.cx-auth .cx-auth-secret .cx-auth-input {
  padding-right: 50px;
}

.cx-auth-reveal {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sg-ink-3);
  cursor: pointer;
  transition: background-color var(--sg-duration) var(--sg-ease), color var(--sg-duration) var(--sg-ease);
}

.cx-auth-reveal:hover {
  background: var(--sg-panel);
  color: var(--sg-ink);
}

.cx-auth-reveal:focus-visible {
  outline: none;
  box-shadow: var(--sg-focus);
}

.cx-auth-reveal svg {
  width: 18px;
  height: 18px;
}

.cx-auth-reveal .is-shown,
.cx-auth-reveal[aria-pressed="true"] .is-hidden {
  display: none;
}

.cx-auth-reveal[aria-pressed="true"] .is-shown {
  display: block;
}

.cx-auth-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
}

.cx-auth-hint[hidden] {
  display: none;
}

.cx-auth-hint svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.cx-auth-hint--warn {
  color: var(--sg-warn-ink);
}

.cx-auth-hint--danger {
  color: var(--sg-danger-ink);
}

/* Remember me, and the link beside it. */
.cx-auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cx-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--sg-ink-2);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

body.cx-auth .cx-auth-check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--sg-line-strong);
  border-radius: 5px;
  background: var(--sg-surface) no-repeat center / 12px 12px;
  cursor: pointer;
  transition: background-color var(--sg-duration) var(--sg-ease), border-color var(--sg-duration) var(--sg-ease);
}

body.cx-auth .cx-auth-check input:hover {
  border-color: var(--sg-ink-3);
}

body.cx-auth .cx-auth-check input:checked {
  border-color: var(--sg-ink);
  background-color: var(--sg-signal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F1115' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

body.cx-auth .cx-auth-check input:focus-visible {
  outline: none;
  box-shadow: var(--sg-focus);
}

/* Links read as ink with a quiet underline. */
body.cx-auth a {
  color: var(--sg-ink);
  text-decoration: underline;
  text-decoration-color: var(--sg-line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--sg-duration) var(--sg-ease);
}

body.cx-auth a:hover,
body.cx-auth a:focus {
  color: var(--sg-ink);
  text-decoration-color: var(--sg-ink);
}

body.cx-auth a:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--sg-focus);
}

.cx-auth-small {
  font-size: 13px;
}

.cx-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 14px;
}

body.cx-auth .cx-auth-back {
  text-decoration: none;
}

body.cx-auth .cx-auth-back:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cx-auth-back svg {
  width: 16px;
  height: 16px;
}

/* The one primary action: an ink pill. While the request is out its label gives way to three dots filling in turn. */
body.cx-auth .cx-auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin: 4px 0 0;
  padding: 0 20px;
  border: 0;
  border-radius: var(--sg-radius-pill);
  background: var(--sg-ink);
  color: #F8F9FD;
  font-family: var(--sg-font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: var(--sg-top-light);
  cursor: pointer;
  transition: background-color var(--sg-duration) var(--sg-ease);
}

body.cx-auth .cx-auth-submit:hover {
  background: var(--sg-ink-raised);
}

body.cx-auth .cx-auth-submit:focus-visible {
  outline: none;
  box-shadow: var(--sg-focus);
}

.cx-auth-busy {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cx-auth-busy i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.4px #F8F9FD;
  animation: cx-auth-busy 900ms var(--sg-ease) infinite;
}

.cx-auth-busy i:nth-child(2) {
  animation-delay: 150ms;
}

.cx-auth-busy i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes cx-auth-busy {
  0%, 100% { background: transparent; }
  35%, 60% { background: #F8F9FD; }
}

body.cx-auth .cx-auth-submit.is-busy {
  color: transparent;
  cursor: progress;
}

.cx-auth-submit.is-busy .cx-auth-busy {
  display: flex;
}

.cx-auth .g-recaptcha {
  margin: 0;
}

/* Whatever modules print at the foot of the form (perfshield's reset-session link). */
.cx-auth-extra:empty {
  display: none;
}

.cx-auth-extra {
  font-size: 13px;
}

.cx-auth-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--sg-ink-3);
  font-size: 12.5px;
}

/* The stage: a white panel holding the field and the one line the brand stands on. */
.cx-auth-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin: 12px 12px 12px 0;
  padding: 56px 56px 52px;
  overflow: hidden;
  border-radius: var(--sg-radius-panel);
  background: var(--sg-surface);
  box-shadow: var(--sg-shadow-panel);
}

.cx-auth-statement {
  margin: 0;
  color: var(--sg-ink);
  font-family: var(--sg-font);
  font-size: clamp(32px, 3.05vw, 48px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.cx-auth-statement span {
  display: block;
  color: var(--sg-ink-3);
}

/* The field. Texture dots are grey by the brand's rule, so nobody reads them as a count; the lime one is the person. */
body.cx-auth .cx-auth-field-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  margin-block: auto;
  overflow: visible;
}

/* Phones draw the shorter band instead (frame_close.php renders both from the same generator). */
body.cx-auth .cx-auth-field--band {
  display: none;
}

.cx-auth-field-svg .d {
  transform-box: fill-box;
  transform-origin: center;
}

.cx-auth-field-svg .ink {
  fill: var(--sg-hollow);
  stroke: transparent;
  stroke-width: 1.2;
}

.cx-auth-field-svg .ring {
  fill: transparent;
  stroke: var(--sg-line-strong);
  stroke-width: 1.2;
}

/* Arrival: every dot starts loose and pale and lands where the texture puts it, the sweep running left to right. */
.cx-auth-field-svg.is-settling .d {
  animation: cx-auth-settle 1500ms var(--sg-ease) var(--d) both;
}

@keyframes cx-auth-settle {
  from { transform: translate(var(--sx), var(--sy)) scale(0.7); opacity: 0.6; fill: transparent; stroke: var(--sg-hollow); }
  55% { fill: transparent; stroke: var(--sg-hollow); }
}

/* The person's dot lands as one more grey dot and lights once everything has settled: the arrival ends on the person.
   When the form is complete it grows and sends out one ring, a pulse for each time the form becomes ready. */
.cx-auth-field-svg .beacon {
  fill: var(--sg-hollow);
  stroke: transparent;
  stroke-width: 1.4;
  transition: scale 420ms var(--sg-ease);
}

.cx-auth-field-svg.is-settling .beacon {
  animation: cx-auth-settle 1500ms var(--sg-ease) var(--d) both, cx-auth-lit 420ms var(--sg-ease) 2300ms forwards;
}

@keyframes cx-auth-lit {
  from { fill: var(--sg-hollow); stroke: transparent; transform: none; }
  to { fill: var(--sg-signal); stroke: var(--sg-ink); transform: scale(1.2); }
}

.cx-auth-field-svg.is-ready .beacon {
  scale: 1.3;
}

.cx-auth-field-svg .beacon-halo {
  fill: var(--sg-signal);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.cx-auth-field-svg.is-ready .beacon-halo {
  animation: cx-auth-halo 1400ms var(--sg-ease) 1;
}

@keyframes cx-auth-halo {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 0; transform: scale(3.4); }
}

@media (prefers-reduced-motion: reduce) {
  .cx-auth-field-svg.is-settling .d,
  .cx-auth-busy i {
    animation: none;
  }

  .cx-auth-busy i {
    background: #F8F9FD;
  }

  .cx-auth-field-svg .beacon,
  .cx-auth-field-svg.is-settling .beacon {
    animation: none;
    fill: var(--sg-signal);
    stroke: var(--sg-ink);
    transform: scale(1.2);
    transition: none;
  }

  .cx-auth-field-svg.is-ready .beacon-halo {
    animation: none;
  }
}

/* Narrow windows: the panel becomes a short band of field above the form; the statement steps aside. */
@media (max-width: 900px) {
  .cx-auth-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .cx-auth-stage {
    order: -1;
    gap: 14px;
    margin: 12px 12px 0;
    padding: 20px 22px 18px;
  }

  body.cx-auth .cx-auth-field--panel {
    display: none;
  }

  body.cx-auth .cx-auth-field--band {
    display: block;
    max-height: none;
    margin-block: 0;
  }

  .cx-auth-statement {
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -0.01em;
  }

  .cx-auth-statement span {
    display: inline;
  }

  .cx-auth-side {
    padding: 28px 20px 24px;
  }

  .cx-auth-main {
    padding-block: 40px 48px;
  }

  .cx-auth-title {
    font-size: 34px;
  }
}

/* Short laptop screens keep the form and its footer in one view. */
@media (max-height: 760px) and (min-width: 901px) {
  .cx-auth-main {
    padding-block: 32px;
  }

  .cx-auth-stage {
    padding: 40px 48px 40px;
  }
}

[dir="rtl"] .cx-auth-stage {
  margin: 12px 0 12px 12px;
}

[dir="rtl"] body.cx-auth .cx-auth-secret .cx-auth-input {
  padding-right: 14px;
  padding-left: 50px;
}

[dir="rtl"] .cx-auth-reveal {
  right: auto;
  left: 4px;
}

[dir="rtl"] .cx-auth-back svg {
  transform: scaleX(-1);
}

@media (max-width: 900px) {
  [dir="rtl"] .cx-auth-stage {
    margin: 12px 12px 0;
  }
}
