/*
 * The sign-in page's own skin. Every colour, radius, font and motion value is a
 * token from @radixia/brand (loaded before this file); nothing here restates a
 * brand value. Page chrome is a per-surface decision, which is why it lives
 * here and not in the brand package.
 */

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  background: var(--paper-2);
}

main {
  box-sizing: border-box;
  width: min(100% - 2rem, 28rem);
  margin: 12vh 0 4rem;
  padding: 2.25rem 2rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-img {
  display: block;
  width: 9.5rem;
  height: auto;
  margin: 0 0 2rem;
}

.brand-img--ondark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand-img--onlight {
    display: none;
  }

  .brand-img--ondark {
    display: block;
  }
}

h1 {
  font-size: 1.75rem;
  letter-spacing: var(--track-display);
  margin: 0 0 0.5rem;
}

p {
  color: var(--ink-2);
  margin: 0 0 1rem;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  color: var(--ink-2);
  margin: 1.25rem 0 0.4rem;
}

/* A checkbox beside its label, on the label's own line. */
label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

label.check input {
  width: auto;
  margin: 0;
}

input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
}

input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#otp {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
}

.cf-turnstile {
  margin-top: 1.25rem;
}

form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 1.5rem;
}

.error {
  color: var(--ink);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
}

.small {
  font-size: 0.875rem;
  color: var(--ink-3);
  margin: 1.75rem 0 0;
}

/*
 * Shown only after a delay: the Continue link on the page that hands the
 * browser back to an app (`continuePage`, which says why). A step from hidden to shown, not motion, so it is kept under
 * reduced motion too, where base.css removes every animation: without it the
 * link would never appear.
 */
.later {
  visibility: hidden;
  animation: show-later 0s 5s forwards;
}

@media (prefers-reduced-motion: reduce) {
  main .later {
    animation: show-later 0s 5s forwards !important;
  }
}

@keyframes show-later {
  to {
    visibility: visible;
  }
}

/* ---------- Admin console ---------- */

main.wide {
  width: min(100% - 2rem, 72rem);
  margin-top: 4vh;
}

h2 {
  font-size: 1.125rem;
  margin: 2.25rem 0 0.75rem;
}

.muted {
  color: var(--ink-3);
  font-weight: 400;
}

.notice {
  color: var(--ink);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
}

form.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
  align-items: end;
}

form.grid .btn {
  width: auto;
  margin-top: 1.25rem;
}

form.inline {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
  margin: 0 0.75rem 0.25rem 0;
}

button.link {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

select {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  color: var(--ink-3);
}

code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  word-break: break-all;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  color: var(--ink-2);
  margin: 1.25rem 0 0.25rem;
}

code.secret {
  display: block;
  padding: 0.75rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
}
