/* ==========================================================================
   The /auth/ page, in the look of the app (v12, dev/mockups/redesign/v12.html,
   "Konto i logowanie"): the page near black (near white-grey in light), one
   desk a clear step above it, tiles a step above that, the lead colour only
   on the main button and the focus. The tokens are css/variables.css's (the
   page links it), so a theme or a lead colour chosen in the app is the one
   seen here. No gradient, no glow, no shadow on a resting layer, no motion.
   ========================================================================== */

:root {
  /* The app's own stacks (css/variables.css, Inter from "TB Figures" + "TB Text"): one typeface with the app. */
  --auth-font: var(--font-family);
  --auth-display: var(--font-family-display);
}

html {
  background: var(--page);
  color-scheme: dark light;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text-1);
  font-family: var(--auth-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.desk {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--desk);
  border-radius: 28px;
  padding: 20px 26px 22px;
}

.top {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--auth-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tile);
  display: grid;
  place-items: center;
  flex: none;
}

.mark svg {
  display: block;
  height: 22px;
  width: auto;
  color: var(--text-1);
}

/* ---- the screen ---- */

.stage {
  width: 100%;
  max-width: 340px;
  margin: auto;
  padding: 24px 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

h1 {
  margin: 0 0 4px;
  font-family: var(--auth-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}

h1:focus {
  outline: none; /* focus lands here to announce a new screen; it is not a control */
}

.lede {
  margin: 0 0 6px;
  color: var(--text-2);
  text-align: center;
  text-wrap: pretty;
}

.notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--tile);
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}

/* ---- fields ---- */

.field {
  position: relative;
  background: var(--tile);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: inset 0 0 0 1.5px transparent;
}

.field:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--text-1);
}

.field.err {
  box-shadow: inset 0 0 0 1.5px var(--loss);
}

.field label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-3);
  font-size: 13px;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text-1);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
}

.field select {
  appearance: none;
  cursor: pointer;
}

.field:has(.reveal) input {
  padding-right: 64px;
}

.reveal {
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  min-width: 56px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.reveal:hover {
  color: var(--text-1);
}

.field .codebox {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

.hint,
.errt {
  margin: -4px 4px 0;
  font-size: 13px;
}

.hint {
  color: var(--text-3);
}

.errt {
  color: var(--loss);
}

.form[data-form="inbox"] .hint {
  margin: 0 4px;
  text-align: center;
}

.errt:focus {
  outline: none;
}

.form-err {
  margin: 0 4px;
  text-align: center;
}

/* ---- consent ---- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 13px;
}

.check.err {
  box-shadow: inset 0 0 0 1.5px var(--loss);
}

.check input {
  appearance: none;
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 6px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
}

.check input:checked {
  background: var(--lead);
  box-shadow: none;
}

.check input:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--on-lead);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.check label {
  flex: 1;
  min-height: 24px;
  padding-top: 2px;
  cursor: pointer;
}

.check a,
.legal a,
.foot a {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal {
  margin: 0 4px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.ts {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

/* ---- buttons and links ---- */

.go,
.ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 6px 0 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
}

.go {
  background: var(--lead);
  color: var(--on-lead);
  font-weight: 600;
}

.go:hover {
  background: color-mix(in srgb, var(--lead) 86%, var(--text-1));
}

.ghost {
  background: var(--tile);
  color: var(--text-1);
  font-weight: 500;
}

.ghost:hover {
  background: var(--tile-2);
}

.go[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.lk {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.lk:hover {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lk.quiet {
  color: var(--text-3);
  font-weight: 400;
}

/* The copy of the journal left on this device, under the sign-in form. */
.wipe {
  margin-top: 6px;
}

.wipe:focus {
  outline: none; /* focus lands here to announce the step; it is not a control */
}

.wipe .errt {
  text-align: center;
}

.go:focus-visible,
.ghost:focus-visible,
.lk:focus-visible,
.reveal:focus-visible,
.foot a:focus-visible,
.check a:focus-visible,
.legal a:focus-visible,
.check input:focus-visible {
  outline: 2px solid var(--lead);
  outline-offset: 2px;
}

/* ---- the bottom row ---- */

.foot {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  min-height: 44px;
  color: var(--text-3);
  font-size: 13px;
}

.foot .lk {
  padding-left: 0;
  justify-content: flex-start;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-3);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grow {
  flex: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- a phone ---- */

@media (max-width: 560px) {
  .page {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .desk {
    border-radius: 28px;
    padding: 16px 18px 14px;
  }

  .stage {
    max-width: none;
    padding: 20px 0;
  }

  h1 {
    font-size: 24px;
  }
}
