.drop-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  text-align: center;
  color: transparent;
  display: grid;
  transition-property: backdrop-filter;
  transition-duration: 750ms;
  z-index: -1;

  > span {
    font-weight: 650;
    font-size: 2rem;
    transition-property: color;
    transition-duration: inherit;
  }

  main.highlight > & {
    z-index: 100;
    backdrop-filter: blur(0.1rem);
    > span {
      color: var(--green);
    }
  }
}

form {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, 32rem);
  @media (width < 1024px) {
    grid-template-columns: 1fr;
  }

  &.hidden {
    display: none;
  }

  .column {
    display: grid;
    gap: 0.5rem;
    border: 1px solid var(--gray);
    padding: var(--gap);
    block-size: min-content;
  }
  .fieldset {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: inherit;
    padding: 0;
    margin: 0;
    border: none;
  }

  ul.errorlist {
    color: var(--red);
    font-weight: 550;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .field {
    display: grid;
    grid-auto-rows: min-content;
    align-items: center;
    column-gap: 0.5rem;

    ul.errorlist {
      font-size: 0.8rem;
    }

    &:has(> textarea) {
      grid-template-rows: min-content 1fr;
      textarea {
        resize: block;
      }
    }
    &:has(> input[type="checkbox"]) {
      grid-template-columns: min-content 1fr;
      > label {
        font-size: inherit;
        grid-row: 1;
        grid-column: 2;
        padding: 0.5rem;
        line-height: initial;
      }
      > input {
        grid-row: 1;
        grid-column: 1;
        margin: 0.5rem;
      }
      &:has(> :focus) {
        background: var(--bg-1);
      }
    }

    > label {
      font-size: 0.8rem;
      line-height: 0.8rem;
      z-index: 10;
    }

    > a {
      padding: 0.5rem;
    }

    input,
    select,
    textarea {
      font: inherit;
      line-height: initial;
      border: none;
      border: 1px solid transparent;
      border-bottom: 1px solid var(--gray);
      background: none;
      z-index: 1;
      padding: 0.5rem;

      &:has(~ ul.errorlist) {
        border-color: var(--red);
      }
      &.autocompleted:not(.mod) {
        border-bottom-color: var(--green);
      }

      &:not([type="checkbox"]) {
        width: 100%;
        margin: 0;
      }

      &[name*="value"] {
        text-align: right;
        font-feature-settings: var(--num);
      }
      &[name*="date"] {
        font-feature-settings: var(--num);
      }

      &:focus {
        outline: none;
        background: var(--bg-1);
      }
    }

    > .file-input {
      display: grid;

      > .current {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-columns: max-content;
        grid-auto-flow: column;
        a {
          padding: 0.5rem;
        }
      }

      input[type="file"] {
        &::file-selector-button {
          display: none;
        }
      }
    }
    > .ico-input {
      display: grid;
      grid-template-columns: min-content 1fr;
      column-gap: 0.5rem;
      align-items: center;
      span[class|="ri"] {
        padding: 0.5rem;
      }

      &:has(> :focus) {
        background: var(--bg-1);
      }
    }
  }
  .buttons {
    grid-column: 1 / -1;
    line-height: 2rem;
    input,
    a {
      font: inherit;
      cursor: pointer;
      padding: 0 var(--gap);
      border: var(--gray) 1px solid;
      margin-right: 0.5rem;
      margin-bottom: 0.5rem;
      color: inherit;

      &:hover {
        text-decoration: underline;
      }
    }

    input[type="submit"] {
      background: var(--green-1);
      border-color: var(--green);
    }
    input[type="reset"] {
      background: var(--bg-1);
    }
    a.del {
      color: var(--red);
      border-color: var(--red);
      border-style: dashed;
    }
  }
}
