/* Haladir Nomos sign-in. Carbon monochrome with the blue #0f62fe action accent,
   IBM Plex Sans self-hosted, light + dark via prefers-color-scheme. No external
   assets: fonts are served from this same origin. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #161616;
  --secondary: #595959;
  --hairline: #e0e0e0;
  --field: #f4f4f4;
  --field-border: #8d8d8d;
  --action: #0f62fe;
  --action-hover: #0353e9;
  --on-action: #ffffff;
  --focus: #0f62fe;
  --error: #da1e28;
  --grid: rgba(22, 22, 22, 0.045);
  --shadow: 0 1px 3px rgba(22, 22, 22, 0.09), 0 4px 16px rgba(22, 22, 22, 0.05);
  --radius: 6px;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #161616;
    --card: #262626;
    --ink: #f4f4f4;
    --secondary: #c6c6c6;
    --hairline: #393939;
    --field: #393939;
    --field-border: #6f6f6f;
    --focus: #ffffff;
    --error: #fa4d56;
    --grid: rgba(255, 255, 255, 0.03);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: var(--font-sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

.auth {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wordmark {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--secondary);
}

/* The mount is the sizing authority for the card column: it fills the flex
   column and caps its width. Without an explicit width here the card's
   width:100% resolves against a shrink-wrapped parent and collapses to its
   content width. */
#auth-root {
  width: 100%;
  max-width: 420px;
}

.card {
  width: 100%;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-note {
  margin: -8px 0 20px;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.45;
}

.card-message {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.5;
}

.card-code {
  margin: -12px 0 20px;
  font-size: 12px;
  color: var(--secondary);
  opacity: 0.75;
}

.auth-form {
  display: block;
}

.fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary);
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field);
  border: none;
  border-bottom: 1px solid var(--field-border);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background-color 0.12s ease;
}

.field input:hover {
  background: color-mix(in srgb, var(--field) 92%, var(--ink));
}

.field input:focus {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.field input:autofill {
  box-shadow: inset 0 0 0 100px var(--field);
  -webkit-text-fill-color: var(--ink);
}

.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--error);
  line-height: 1.4;
}

.form-error,
.form-note {
  margin: 0 0 20px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  border-radius: var(--radius);
}

.form-error {
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 45%, transparent);
  background: color-mix(in srgb, var(--error) 8%, transparent);
}

.form-note {
  color: var(--ink);
  border: 1px solid var(--hairline);
  background: var(--field);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.btn-primary {
  color: var(--on-action);
  background: var(--action);
}

.btn-primary:hover {
  background: var(--action-hover);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.fieldset:disabled .btn,
.btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid color-mix(in srgb, var(--on-action) 40%, transparent);
  border-top-color: var(--on-action);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation: none;
  }
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 20px;
}

.link {
  padding: 4px 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--action);
  background: none;
  border: 0;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

.link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
  .link {
    color: #78a9ff;
  }
}

.foot {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  opacity: 0.7;
}

.card[data-mode="fatal"] .btn,
.card[data-mode="signed-out"] .btn {
  margin-top: 4px;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
    box-shadow: none;
  }
  .auth {
    gap: 20px;
    padding: 24px 16px;
  }
}
