.form {
  width: 100%;
  height: 100%;
  margin-inline: auto;
  padding: 1.5rem 2rem;
  border: 1px solid #e7e0d8;
  border-radius: 1rem;
  background-color: #fffdf9;
  box-shadow: 0 1rem 2.5rem rgb(63 45 31 / 0.12);
  color: #554334;
}

.form__element {
  margin-bottom: 1.25rem;
}

.form__label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.form__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cfc2b5;
  border-radius: 0.55rem;
  outline: none;
  background-color: #fff;
  color: #382b21;
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form__input::placeholder {
  color: #9b8d80;
}

.form__input:hover {
  border-color: #9f8873;
}

.form__input:focus {
  border-color: #554334;
  box-shadow: 0 0 0 0.22rem rgb(85 67 52 / 0.16);
}

.form__input--password {
  letter-spacing: 0.05em;
}

.form__text {
  display: block;
  margin: 0.25rem 0 1.25rem;
  color: #78685b;
  font-size: 0.875rem;
  text-align: center;
}

.form__link {
  color: #554334;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.form__link:hover {
  color: #8a5d3b;
}

.form__link:focus-visible,
.form__button:focus-visible {
  outline: 3px solid rgb(157 119 77 / 0.45);
  outline-offset: 3px;
}

.form__button {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  border: 1px solid #554334;
  border-radius: 0.55rem;
  background-color: #554334;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.form__button:hover {
  background-color: #3f3025;
  box-shadow: 0 0.45rem 0.9rem rgb(63 45 31 / 0.2);
  transform: translateY(-1px);
}

.form__button:active {
  transform: translateY(0);
}

.form__error {
  margin: 0.45rem 0 0;
  color: #b42318;
  font-size: 0.825rem;
  line-height: 1.35;
}

.form__input:has(+ br + br + .form__error:not([hidden])) {
  border-color: #b42318;
}

.form__error[hidden] {
  display: none;
}

@media (max-width: 30rem) {
  .form {
    width: min(100% - 1.25rem, 28rem);
    padding: 1.25rem;
    border-radius: 0.75rem;
  }
}
