/* login: the AANMELDEN window. It sits high on the screen so the phone keyboard never covers the input.
   Selectors are prefixed .scr-login. */

.scr-login {
  justify-content: flex-start;
  padding-top: 4px;
}

@media (min-height: 760px) {
  .scr-login { padding-top: clamp(4px, 3.5vh, 48px); }
}

.scr-login .login-wrap {
  position: relative;
  width: 100%;
  max-width: var(--win-max);
  padding-top: 33px; /* room for Henk's ears and eyes above the window */
}

/* ---- Henk peeks over the top edge: head behind the window, paws in front of it ---- */
.scr-login .login-peek {
  position: absolute;
  top: 0;
  right: 72px;
  width: 79px;
  height: 45px;
  pointer-events: none;
}

.scr-login .login-peek__head {
  position: absolute;
  top: 0;
  left: 14px;
  z-index: 0;
  animation: login-peek-up calc(330ms / var(--speed)) steps(3) calc(250ms / var(--speed)) both;
}

.scr-login .login-win {
  position: relative;
  z-index: 1;
}

.scr-login .login-peek__paw {
  position: absolute;
  top: 22px;
  z-index: 2;
  animation: pop-in var(--t-fast) steps(3) calc(520ms / var(--speed)) both;
}

.scr-login .login-peek__paw--l { left: 0; }
.scr-login .login-peek__paw--r { right: 0; }

@keyframes login-peek-up {
  from { transform: translateY(36px); }
  to { transform: translateY(0); }
}

/* ---- the window ---- */
.scr-login .login-win .win__body {
  padding: 12px 14px 14px;
}

.scr-login .login-win .win__body > * + * {
  margin-top: 10px;
}

.scr-login .login-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scr-login .login-lock {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 54px;
  background: var(--lav-l);
  border: var(--bw) solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.scr-login .login-win.is-granted .login-lock {
  background: var(--mint);
}

.scr-login .login-user__text {
  min-width: 0;
  margin: 0;
  line-height: 1.2;
}

.scr-login .login-user__label {
  display: block;
  font-size: var(--fs-s);
}

.scr-login .login-user__name {
  display: block;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--fs-m);
  text-transform: uppercase;
}

.scr-login .login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scr-login .login-label {
  font-size: var(--fs-l);
  font-weight: 700;
  line-height: 1.1;
}

.scr-login .login-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.scr-login .login-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  font-size: max(18px, var(--fs-m));
}

.scr-login .login-input[readonly] {
  background: var(--shade);
}

.scr-login .login-ok {
  flex: none;
  min-width: 68px;
  min-height: 48px;
}

/* "Wachtwoord vergeten?": right under the input, or under the reply once there is one */
.scr-login .login-win .win__body > .login-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.scr-login .login-win .win__body > .login-reply:not([hidden]) + .login-forgot-row {
  margin-top: 2px;
}

.scr-login .login-forgot {
  min-height: var(--tap);
  padding: 4px 2px;
}

/* ---- reply bubble right under the input, with a pixel tail pointing up at it ---- */
.scr-login .login-reply {
  --bubble-bg: var(--paper);
  position: relative;
  margin-bottom: 0;
  background: var(--bubble-bg);
  font-size: var(--fs-s);
  line-height: 1.3;
}

.scr-login .login-win .win__body > .login-reply {
  margin-top: 14px; /* room for the tail */
}

.scr-login .login-reply[data-kind="forgot"] { --bubble-bg: var(--lav-l); }
.scr-login .login-reply[data-kind="ok"] { --bubble-bg: var(--mint); }

/* a 7x5 art-pixel triangle; its bottom row opens the bubble's top border */
.scr-login .login-reply::before {
  content: "";
  position: absolute;
  left: 16px;
  top: -15px;
  width: 21px;
  height: 15px;
  background:
    linear-gradient(var(--ink), var(--ink)) 9px 0 / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 6px 3px / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 12px 3px / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 3px 6px / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 15px 6px / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 9px / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 18px 9px / 3px 3px no-repeat,
    linear-gradient(var(--bubble-bg), var(--bubble-bg)) 9px 3px / 3px 3px no-repeat,
    linear-gradient(var(--bubble-bg), var(--bubble-bg)) 6px 6px / 9px 3px no-repeat,
    linear-gradient(var(--bubble-bg), var(--bubble-bg)) 3px 9px / 15px 6px no-repeat;
}

/* ---- the hint ladder: a yellow sticky note ---- */
.scr-login .login-tip {
  padding: 8px 12px 12px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.scr-login .login-tip__label {
  margin: 0 0 2px;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  text-transform: uppercase;
}

.scr-login .login-tip__text {
  margin: 0 0 8px;
  font-size: var(--fs-s);
  line-height: 1.3;
}

.scr-login .login-tip__text:empty {
  display: none;
}

/* 7 tiles + gaps = 218px: fits a 320px-wide phone without wrapping */
.scr-login .login-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.scr-login .login-tiles__word {
  display: inline-flex;
  gap: 4px;
}

.scr-login .login-tile {
  position: relative;
  width: 26px;
  height: 32px;
  line-height: 1;
  background: var(--paper);
}

/* an empty tile shows a drawn underline, not a font character */
.scr-login .login-tile:not(.is-on)::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 3px;
  background: var(--ink);
}

.scr-login .login-tile.is-on {
  background: var(--pink-l);
}

.scr-login .login-tile.is-new {
  background: var(--pink);
  animation: pop-in var(--t-med) steps(4) both;
}

.scr-login .login-escape {
  margin-top: 12px;
  font-size: var(--fs-s);
  line-height: 1.25;
  text-wrap: balance;
}

/* ---- success ---- */
.scr-login .login-granted {
  margin-bottom: 0;
  padding: 10px 12px;
  background: var(--mint);
  border: var(--bw) solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-size: var(--fs-m);
  line-height: 1.25;
  text-align: center;
}

.scr-login .login-granted strong {
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--fs-m);
  text-transform: uppercase;
}

/* Short phones (an iPhone SE in Safari is about 375x553): a smaller padlock and tighter gaps lift the
   input, and the reply right under it, further away from the keyboard. */
@media (max-height: 700px) {
  .scr-login .login-win .win__body > * + * {
    margin-top: 8px;
  }

  .scr-login .login-lock {
    width: 42px;
    height: 42px;
  }

  .scr-login .login-lock .sprite {
    width: 22px;
    height: 26px;
  }
}
