/* The system's controls, as every Kairo app draws them: the signed-out card,
   fields, buttons and their variants, flashes, badges, `.visually-hidden`.
   Written for the markup Neo, the admin, Kairo Data and Kairo Tools share; an
   app restates only the spacing a particular page needs. */

/* Authentication pages */

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1.25rem;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--k-color-ink);
}

.auth__logo {
  display: block;
  width: auto;
  height: 22px;
}

.auth__card {
  width: 100%;
  max-width: 25rem;
  padding: 2rem;
  background-color: var(--k-color-paper);
  border: 1px solid var(--k-color-line);
  border-radius: var(--k-radius-panel);
}

.auth__title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth__subtitle {
  margin: 0.5rem 0 1.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--k-color-muted);
}

.auth__footer {
  margin: 1.5rem 0 0;
  text-align: center;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--k-color-ink);
}

.field__link {
  font-size: 0.8125rem;
  color: var(--k-color-muted);
  text-decoration: none;
}

.field__link:hover {
  color: var(--k-color-violet-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The system's field: an explicit border, since a line alone is never the
   sole boundary of an input, and a 48px height. */
.field__input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--k-color-ink);
  background-color: var(--k-color-paper);
  border: 1px solid var(--k-color-control-border);
  border-radius: var(--k-radius-control);
  caret-color: var(--k-color-violet-deep);
  transition: border-color var(--k-duration-fast) var(--k-ease-standard);
}

.field__input::placeholder {
  color: var(--k-color-muted);
}

.field__input:hover {
  border-color: var(--k-color-ink);
}

.field__input:focus {
  border-color: var(--k-color-violet-deep);
}

.field__input[aria-invalid="true"] {
  border-color: var(--k-color-error);
}

.field__check {
  width: 1rem;
  height: 1rem;
  accent-color: var(--k-color-violet);
}

.field__hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--k-color-muted);
}

/* The system's primary action: violet on light, deepening on hover, the 15px
   corner the brand's buttons are recognised by. A label is never shrunk or
   uppercased to fit; it wraps and the button grows. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--k-color-paper);
  background-color: var(--k-color-violet);
  border: 1px solid transparent;
  border-radius: var(--k-radius-button);
  cursor: pointer;
  transition: background-color var(--k-duration-fast) var(--k-ease-standard),
    color var(--k-duration-fast) var(--k-ease-standard),
    transform var(--k-duration-fast) var(--k-ease-standard);
}

.button:hover {
  background-color: var(--k-color-violet-deep);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  color: var(--k-color-ink-soft);
  background-color: var(--k-color-line);
  cursor: not-allowed;
  transform: none;
}

.button--compact {
  margin-top: 0;
  min-height: 36px;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  text-decoration: none;
}

/* Outlined rather than filled: findable, and never the thing a thumb lands on
   by accident. Filling on hover is the confirmation it is meant. */
.button--danger {
  color: var(--k-color-error);
  background-color: var(--k-color-paper);
  border-color: color-mix(in srgb, var(--k-color-error) 40%, transparent);
}

.button--danger:hover {
  color: var(--k-color-paper);
  background-color: var(--k-color-error);
  border-color: var(--k-color-error);
}

/* A link doing a button's job. `.button` is written for <button> and <input>,
   which the browser already gives border-box sizing and no underline; an
   anchor needs both, or it underlines itself and its padding lands on top of
   the min-height, standing half again as tall as a submit beside it. */
a.button {
  box-sizing: border-box;
  text-decoration: none;
}

/* The system's secondary button: paper with a visible border, so a Cancel
   next to a submit never looks identical to it. */
.button--quiet {
  color: var(--k-color-ink);
  background: var(--k-color-paper);
  border: 1px solid var(--k-color-control-border);
}

.button--quiet:hover {
  color: var(--k-color-ink);
  background: var(--k-color-lavender-soft);
  border-color: var(--k-color-control-border);
}

/* A submit and its way out, side by side. */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-row .button {
  margin: 0;
}

/* Off-screen, still read out: a table's tick column heading, a label the
   layout already makes plain. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A status carries its meaning in words; the colour supplements it. */
.flash {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid;
  border-radius: var(--k-radius-control);
}

.flash--alert {
  color: var(--k-color-error);
  background-color: var(--k-color-error-bg);
  border-color: color-mix(in srgb, var(--k-color-error) 25%, transparent);
}

.flash--notice {
  color: var(--k-color-success);
  background-color: var(--k-color-success-bg);
  border-color: color-mix(in srgb, var(--k-color-success) 25%, transparent);
}

/* The system's tag: a pill, bold, small, on a tinted ground. The text names
   the state; the tint supplements it. */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  border-radius: var(--k-radius-pill);
}

.badge--admin {
  color: var(--k-color-violet-deep);
  background-color: var(--k-color-lavender);
}

.badge--disabled {
  color: var(--k-color-error);
  background-color: var(--k-color-error-bg);
}

.badge--manual {
  color: var(--k-color-warning);
  background-color: var(--k-color-warning-bg);
}

/* Something done and settled, against something still in progress.
   Deliberately not green/red: in progress is not a failure state. */
.badge--validated {
  color: var(--k-color-success);
  background-color: var(--k-color-success-bg);
}

.badge--monitoring {
  color: var(--k-color-ink-soft);
  background-color: var(--k-color-lavender-soft);
}

/* Not yet taken: paper on a line, the tint of something that has not happened. */
.badge--todo {
  color: var(--k-color-ink-soft);
  background-color: var(--k-color-paper);
  box-shadow: inset 0 0 0 1px var(--k-color-line);
}
