/* Festive Manchester · login.css · the sign-in page
   Loaded after base.css and stage.css. The stage, the gift tag, the fields and
   the button are stage.css; this file holds only what the sign-in form has
   that no other tag does: the password's show/hide button and "Remember me". */

/* ---------- Show or hide the password ---------- */

.field__frame--peek .field__input {
  padding-right: 3.375rem;
}

.field__peek {
  position: absolute;
  right: 0.375rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--gold-deep);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.2s, color 0.2s;
}

html:not(.js) .field__peek {
  display: none;
}

.field__peek:hover {
  background: rgba(217, 178, 106, 0.2);
  color: var(--berry);
}

.field__peek:focus-visible {
  outline-offset: -0.125rem;
}

.field__peek svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The stroke through the eye draws in while the password is on show. */
.field__peek-slash {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.3s var(--ease);
}

.field__peek[aria-pressed="true"] .field__peek-slash {
  stroke-dashoffset: 0;
}

/* ---------- Remember me ---------- */

.remember {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: max-content;
  max-width: 100%;
  margin: 0.75rem auto 0;
  padding: 0.5rem 0.75rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.375rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* The real checkbox lies over the drawn one, unseen but still focusable. */
.remember__input {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.remember__box {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border: 1px solid rgba(169, 128, 63, 0.75);
  border-radius: 0.4375rem;
  background: #fffefa;
  box-shadow: inset 0 1px 0.1875rem rgba(138, 101, 38, 0.14);
  transition: border-color 0.25s, box-shadow 0.3s;
}

.remember:hover .remember__box {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 0.25rem rgba(217, 178, 106, 0.26), inset 0 1px 0.1875rem rgba(138, 101, 38, 0.14);
}

.remember__input:focus-visible + .remember__box {
  outline: 0.125rem solid var(--berry);
  outline-offset: 0.1875rem;
}

.remember__box svg {
  position: relative;
  z-index: 1;
  width: 0.9375rem;
  height: 0.9375rem;
  fill: none;
  stroke: #2a1a09;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.2s ease-in;
}

/* Ticked: the box turns to the gold of the buttons, the tick draws itself and
   a few sparks fly (the tree chooser's, when a choice lands). */
.remember__input:checked + .remember__box {
  border-color: #c39a4c;
  background: linear-gradient(180deg, #f5dea8 0%, #d9ae5f 100%);
  box-shadow: 0 0.375rem 0.875rem -0.375rem rgba(226, 180, 96, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  animation: remember-pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) 1;
}

.remember__input:checked + .remember__box svg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.32s var(--ease) 0.08s;
}

@keyframes remember-pop {
  0% {
    transform: scale(0.82);
  }

  100% {
    transform: scale(1);
  }
}

.remember__sparks {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.25rem;
  height: 0.25rem;
  margin: -0.125rem 0 0 -0.125rem;
  border-radius: 50%;
  box-shadow:
    -1.125rem -0.75rem 0 0 var(--gold),
    0.75rem -1.0625rem 0 -1px #c9953a,
    1.1875rem 0.5625rem 0 0 var(--gold),
    -0.875rem 0.875rem 0 -1px #c9953a,
    -1.5625rem 0.125rem 0 -1px var(--berry),
    1.5625rem -0.1875rem 0 -1px var(--berry);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.remember__input:checked + .remember__box .remember__sparks {
  animation: remember-sparks 0.9s ease-out 0.05s 1 both;
}

@keyframes remember-sparks {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.25) rotate(28deg);
  }
}

/* "Remember me" rises into place with the rest of the tag (stage.css). */
.remember {
  animation: tag-rise 0.7s var(--ease) calc(0.55s + var(--i, 0) * 0.07s) backwards;
}

.stage--settled .remember {
  animation: none;
}

@media (min-width: 1024px) and (max-height: 720px) {
  .remember {
    margin-top: 0.5rem;
  }
}
