/* All a visitor who hasn't signed in gets: one card, one button. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #09090b;
  color: #f4f4f5;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

.card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 2rem;
}
.card > * { margin: 0; }
.card > * + * { margin-top: 1rem; }

h1 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }
a { color: inherit; }
.muted { color: #a1a1aa; }
.small { font-size: 12px; }
code { font-family: ui-monospace, monospace; font-size: .92em; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 6px;
  background: #fafafa;
  color: #09090b;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s;
}
.button:hover { opacity: .9; }
.button:focus-visible { outline: none; box-shadow: 0 0 0 2px #09090b, 0 0 0 4px #fafafa; }

.error {
  color: #ef4444;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 6px;
  padding: .75rem 1rem;
}

/* The code step of signing in */
.stack { display: flex; flex-direction: column; gap: .75rem; text-align: left; }
.stack > * { margin: 0; }
input[type=text] {
  width: 100%;
  height: 42px;
  padding: 0 .75rem;
  background: rgba(0, 0, 0, .3);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  letter-spacing: .1em;
}
input[type=text]:focus { outline: none; border-color: #fafafa; }
button.button { width: 100%; border: 0; font: inherit; cursor: pointer; }

/* A 6-digit code as six boxes (otp.js): the real field lies over them,
   invisible; without the script it is a plain box */
.otp { position: relative; display: flex; gap: .5rem; justify-content: center; width: 100%; max-width: 20rem; }
.otp-cell {
  flex: 1 1 0;
  min-width: 0;
  max-width: 3rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  color: #f4f4f5;
  font: 500 22px/1 ui-monospace, monospace;
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell:nth-child(4) { margin-left: .5rem; }
.otp:focus-within .otp-cell.is-current { border-color: #fafafa; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.otp > input[type=text] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  font-size: 16px;
  cursor: text;
}
.otp.is-plain .otp-cell { display: none; }
.otp.is-plain > input[type=text] { position: static; opacity: 1; height: 42px; padding: 0 .75rem; border: 1px solid rgba(255, 255, 255, .12); }
.otp.is-plain > input[type=text]:focus { border-color: #fafafa; }
.otp-switch { align-self: center; background: none; border: 0; padding: 0; color: #a1a1aa; font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.otp-switch:hover { color: #f4f4f5; }
