/* account.slop.graphics: the sign-in. White and greys, no lines, no outlines,
   every control 36px. A field you are typing in gets a darker fill, not a ring. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/schibsted-grotesk-latin-wght-normal.woff2) format("woff2-variations");
}

:root {
  --backdrop: #f2f2f2;
  --paper: #ffffff;
  --fill: #f1f1f1;
  --fill-strong: #e2e2e2;
  --ink: #111111;
  --ink-2: #5e5e5e;
  --placeholder: #686868;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px -18px rgba(0, 0, 0, 0.18);
  --control: 36px;
  --spring: cubic-bezier(0.3, 1.45, 0.45, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--backdrop);
  color: var(--ink);
  font: 14px/1.5 "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  outline: 0;
}

[hidden] {
  display: none !important;
}

/* ── The card ─────────────────────────────────────────────── */

.card {
  width: min(372px, 100%);
  padding: 36px 28px 28px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* The mark is the site's own: a dot in a square. Here the dot looks at what
   you point at, and shuts while you type something secret. */
.mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #141414;
  display: grid;
  place-items: center;
  flex: none;
}

.mark i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transform: translate(var(--x, 0px), var(--y, 0px)) scale(var(--wide, 1), var(--open, 1));
  transition: transform 0.6s var(--spring);
}

.mark.shut {
  --open: 0.14;
  --wide: 1.25;
  --x: 0px !important;
  --y: 2px !important;
}

.name {
  margin-top: 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.step {
  width: 100%;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: arrive 0.5s var(--out);
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.note:empty {
  display: none;
}

.note {
  margin-top: 14px;
  color: var(--ink-2);
  text-align: center;
}

/* ── Controls ─────────────────────────────────────────────── */

.field {
  height: var(--control);
  width: 100%;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 16px; /* under 16px iOS zooms the page on focus */
  letter-spacing: -0.01em;
  transition: background-color 0.2s var(--out);
}

.field:focus {
  background: var(--fill-strong);
}

.field::placeholder {
  color: var(--placeholder);
}

/* Chrome paints saved logins pale blue. Keep them the page's grey. */
.field:-webkit-autofill,
.field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--fill) inset;
  caret-color: var(--ink);
}

.field:-webkit-autofill:focus {
  box-shadow: 0 0 0 100px var(--fill-strong) inset;
}

.field.code {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.32em;
  padding-left: calc(16px + 0.32em);
}

.field.code::placeholder {
  font-weight: 400;
  color: #9a9a9a;
}

.button {
  height: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fill);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  touch-action: manipulation;
  transition: transform 0.12s var(--out), background-color 0.15s var(--out);
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Reached with the keyboard, a button darkens the way it does under the pointer. */
.button:focus-visible {
  background: var(--fill-strong);
}

.button.primary:focus-visible {
  background: #3a3a3a;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background: var(--fill-strong);
  }
  .button.primary:hover {
    background: #303030;
  }
}

/* ── Setting up the authenticator ─────────────────────────── */

.scan {
  align-self: center;
  width: 196px;
  height: 196px;
  padding: 18px;
  border-radius: 22px;
  background: var(--fill);
}

.scan svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scan svg rect {
  fill: transparent;
}

.hint {
  margin: 6px 0 4px;
  color: var(--ink-2);
  text-align: center;
  text-wrap: balance;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The same secret as text, for an app that cannot scan. Two lines of four groups. */
.secret {
  flex: 1;
  min-width: 0;
  padding: 9px 16px;
  border-radius: 18px;
  background: var(--fill);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-align: center;
  text-wrap: balance;
  user-select: all;
}

.who {
  margin-bottom: 6px;
  color: var(--ink-2);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .mark i,
  .card,
  .button,
  .field {
    transition: none;
  }
  .step {
    animation: none;
  }
}
