/* Sigilant sign-in: one white card on Keycloak's dark low-poly picture.
   The card follows the login card of Cintelis's CRM (a 3px strip across its top, a
   16px radius, bold muted labels over full-width fields, an ink button whose arrow
   recoils), in Sigilant's colours: ink #0a0b0d, accent #1499ff, accent-strong #0c6fc2.
   Served as a file: the pages' Content-Security-Policy allows styles from 'self' and a
   nonce, and no inline style attributes. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin-700-normal.woff2) format("woff2");
}

:root {
  --ink: #0a0b0d;
  --ink-soft: #535353;
  --ink-faint: #8d8d8d;
  --line: #d9dbe0;
  --edge: #b9bcc3;
  --paper: #f4f5f7;
  --accent: #1499ff;
  --accent-strong: #0c6fc2;
  --err-ink: #b42328;
  --err-soft: #fde9e9;
  --ok-ink: #107a47;
  --ok-soft: #e6f6ee;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.2px;
  -webkit-font-smoothing: antialiased;
  background: #0a0b0d url(/assets/keycloak-bg.svg) center / cover no-repeat fixed;
}

[hidden] {
  display: none !important;
}

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* The card. */
.card {
  position: relative;
  overflow: hidden;
  width: 380px;
  max-width: 100%;
  padding: 48px 40px;
  background: #fff;
  border: 0.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  z-index: 2;
}
/* A very faint network, the console's rail motif, in the card's top corner. */
.card::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -90px;
  width: 300px;
  height: 300px;
  background: url(/assets/motif.svg) center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}
.card > * {
  position: relative;
  z-index: 1;
}
@media (max-width: 420px) {
  .card {
    padding: 40px 24px;
  }
}

/* Logo row: the mark on an accent square, and the wordmark. */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.brandmark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}
.brandmark img {
  display: block;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.subtitle {
  margin: 0 0 32px;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.lede {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.lede strong {
  color: var(--ink);
}
.fine {
  margin: 16px 0 0;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* Fields. */
form {
  margin: 0;
}
label {
  display: block;
  margin: 18px 0 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
input[type="email"],
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 0.5px solid var(--ink-faint);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 153, 255, 0.18);
}
input.code {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.3em;
  text-align: center;
}
input::placeholder {
  color: var(--ink-faint);
}

.err {
  margin: 12px 0 0;
  color: var(--err-ink);
  font-size: 13px;
}
.notice {
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ok-soft);
  color: var(--ok-ink);
  font-size: 13px;
}

/* The primary button: ink, full width, the arrow recoiling on hover. */
.btn-primary {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover {
  opacity: 0.88;
}
.btn-primary svg {
  display: block;
  flex-shrink: 0;
}
.btn-primary:hover svg .arr-head {
  animation: arr-recoil 0.4s ease-out;
}
@keyframes arr-recoil {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-3px);
  }
}
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-text:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Quieter actions: an outline button and text links. */
.btn-secondary {
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: #fff;
  border: 0.5px solid var(--edge);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover {
  border-color: var(--ink-soft);
  background: var(--paper);
}
.btn-secondary svg {
  flex-shrink: 0;
}
.btn-text {
  padding: 0;
  color: var(--accent-strong);
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-text:hover {
  text-decoration: underline;
}
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 20px;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 0.5px solid var(--line);
}

/* Lists the account page shows. */
.facts {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border-top: 0.5px solid var(--line);
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--line);
  font-size: 13px;
}
.facts .k {
  color: var(--ink-soft);
}
.facts .v {
  font-weight: 600;
  text-align: right;
}
.codes {
  margin: 16px 0 0;
  padding: 14px 16px;
  list-style: none;
  columns: 2;
  background: var(--paper);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
}
.secret {
  display: block;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
}
.status {
  min-height: 1em;
}

.cf-turnstile {
  margin-top: 18px;
}

.preview-list {
  margin: 16px 0 0;
  padding-left: 18px;
  font-size: 13px;
}
.preview-list a {
  color: var(--accent-strong);
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover svg .arr-head {
    animation: none;
  }
  input,
  .btn-primary,
  .btn-secondary {
    transition: none;
  }
}

/* The passkey status line is there for "waiting for your passkey" and its errors;
   empty, it would leave a gap between the buttons. */
#passkey .status:empty {
  display: none;
}
