@import url('shared.css');

/* spec 27.1., 27.2., 27.9., 27.11., 27.16. */
input {
  padding: 3px 23px 3px 7px;
  width: 151px;
  background: white;
  color: black;
  text-align: left;
  font-weight: 475;
}

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

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

/* spec 3.5., 27.15., 27.17. */
#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 3.5., 27.18. */
#clear.visible {
  opacity: 1;
  pointer-events: auto;
}

/* spec 3.7., 27.20. */
#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 27.16. */
@supports (-webkit-hyphens:none) {
  @media (pointer: fine) {
    input {
      padding-right: 21px;
    }
  }
}

/* spec 27.22., 27.23. */
@media (hover: none) and (pointer: coarse) {
  input {
    font-weight: 500;
    width: 155px;
    padding-right: 19px;
  }

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

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

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

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