/* spec 8.2. */
button,
input {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  height: 22px;
  padding: 3px 7px;
  border: none;
  border-radius: 5px;
  outline: none;
  box-shadow: 
    0 0.5px 2.5px 0 rgba(0, 0, 0, 0.3), 
    0 0 0 0.5px rgba(0, 0, 0, 0.05);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 14px;
  line-height: 19px;
  letter-spacing: -0.2px;
  font-weight: 475;
}

/* spec 8.2. */
button:disabled,
input:disabled {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(0, 0, 0, 0.3);
  opacity: 0.6;
}

/* spec 8.2. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  background-color: black;
  background-image:
    linear-gradient(to bottom,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0));
  color: white;
  font-weight: 525;
  transition: all var(--transition-duration) var(--transition-easing);
  cursor: pointer;
}

/* spec 8.2. */
button:active:hover,
button:focus-visible {
  background-color: #3a3a3a;
}

/* spec 10.3. */
button:active:hover,
button:focus-visible:active {
  transform: scale(var(--tap-scale));
}

/* spec 8.2. */
button:disabled {
  background-image: none;
  cursor: default;
  /* bug 2. */
  pointer-events: none;
}

/* spec 8.2. */
input {
  width: 151px;
  padding-right: 23px;
  background: white;
  color: black;
  font-weight: 900;
  letter-spacing: 2px;
  caret-color: transparent;
  transition: all var(--transition-duration) var(--transition-easing);
}

/* spec 8.2. */
input::placeholder {
  color: rgba(0, 0, 0, 0.3);
  font-weight: 525;
  letter-spacing: -0.2px;
}

/* spec 1.2., 8.1. */
.container {
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-user-select: none;
  user-select: none;
}

/* spec 6.5. */
.submit-button-wrap {
  display: inline-flex;
  align-items: center;
}

.input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* spec 6.1. */
.input-wrapper.shake {
  animation: shake 0.5s;
}

/* spec 6.2. */
.input-wrapper.shake #caret {
  animation: none;
}

/* spec 6.5. */
.input-wrapper.shake ~ .submit-button-wrap {
  cursor: pointer;
}

.input-wrapper.shake ~ .submit-button-wrap #button:disabled {
  background-color: black;
  background-image:
    linear-gradient(to bottom,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0));
  color: white;
  font-weight: 525;
  opacity: 1;
}

#caret {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 1em;
  border-radius: 1px;
  background: black;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.15);
}

/* spec 4.1. */
#caret.visible {
  opacity: 1;
}

/* spec 4.3. */
#caret.blink {
  animation: blink 1s ease-out infinite;
}

/* spec 8.2. */
#clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
  color: #bbb;
  opacity: 0;
  pointer-events: none;
  display: flex;
  transition: all var(--transition-duration) var(--transition-easing);
}

/* spec 8.2. */
#clear.visible {
  opacity: 1;
  pointer-events: auto;
}

/* spec 3.7. */
#clear:disabled {
  opacity: 0.25;
  pointer-events: none;
}

#clear svg {
  display: block;
  transition: transform var(--transition-duration) var(--transition-easing);
}

#clear:active:hover,
#clear:focus-visible:active {
  color: #999;
}

#clear:active:hover svg,
#clear:focus-visible:active svg {
  transform: scale(var(--tap-scale));
}

/* spec 7.8. */
html:has(body.login) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* spec 7.8. */
.login {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  width: 100%;
  min-height: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

@supports (-webkit-hyphens:none) {
  @media (pointer: fine) {
    input {
      padding-right: 21px;
    }
  }
}

@media (pointer: coarse) {
  button,
  input {
    font-size: 14.5px;
    line-height: 20px;
  }

  input {
    width: 155px;
    padding-right: 19px;
  }

  input::placeholder {
    font-weight: 500;
  }

  button {
    font-weight: 500;
  }

  /* spec 3.7. */
  #clear::before {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
  }

  /* bug 4. */
  button:active {
    transform: scale(var(--tap-scale));
  }

  #clear:active {
    color: rgba(0, 0, 0, 0.55);
  }

  #clear:active svg {
    transform: scale(var(--tap-scale));
  }
}

.group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logout {
  align-self: flex-start;
  margin-top: 4px;
  background-color: white;
  background-image: none;
  color: black;
  font-weight: 475;
}

.logout:active:hover,
.logout:focus-visible {
  background-color: #eee;
}

a.locked {
  cursor: text;
}

a.locked::before {
  content: '';
  display: inline-block;
  height: 11px;
  aspect-ratio: 52.39 / 75.49;
  background: url('/assets/icons/lock.svg') no-repeat center / contain;
  vertical-align: baseline;
  position: relative;
  top: 0.5px;
  margin-right: 5px;
}

a.locked:hover,
a.locked:focus {
  text-decoration-color: #eeeff2;
}

a[href^="http"]::after {
  content: '';
  display: inline-block;
  height: 13px;
  aspect-ratio: 71.48 / 71.44;
  background: url('/assets/icons/external.svg') no-repeat center / contain;
  vertical-align: baseline;
  position: relative;
  top: 1.5px;
  margin-left: 5px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.signature-link {
  display: block;
  width: fit-content;
  margin-bottom: 3px;
}

.signature {
  width: 80px;
  display: block;
}

.frame {
  aspect-ratio: 16 / 9;
  background: #fafafa;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame img {
  display: block;
}

.signature,
.frame img {
  border-radius: 0;
  outline: none;
}
