.surveys.new,
.surveys.create,
.surveys.edit,
.surveys.update {
  form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;

    h1 {
      margin: 0;
    }

    .instructions {
      display: flex;
      flex-direction: column;
      gap: 10px;

      h2,
      p,
      ol {
        margin: 0;
      }

      ol {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-left: 23px;
      }

      em {
        font-style: normal;
        font-weight: bold;
      }
    }

    .field {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 10px;

      input {
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #fff;
        color: #000;
      }

      .error {
        color: red;
      }
    }

    .actions {
      display: flex;
    }

    .name {
      display: flex;
      gap: 20px;
    }

    .departments {
      display: flex;
      flex-direction: column;
      gap: 10px;

      label {
        padding: 10px;
        border-radius: 5px;
        background-color: #ccc;
        color: #000;
        cursor: pointer;

        &.se {
          background-color: var(--color-blue-100);
        }

        &.de {
          background-color: var(--color-emerald-100);
        }

        &.ai {
          background-color: var(--color-violet-100);
        }

        &:hover,
        &:has(input:checked) {
          color: #fff;

          &.se {
            background-color: var(--color-blue-600);
          }

          &.de {
            background-color: var(--color-emerald-600);
          }

          &.ai {
            background-color: var(--color-violet-600);
          }
        }

        input {
          display: none;
        }
      }
    }

    .categories {
      display: flex;
      flex-direction: column;
      gap: 20px;

      .later {
        order: 99;
      }
    }

    .skill {
      display: flex;
      flex-direction: column;
      gap: 10px;
      justify-content: space-between;
      padding: 10px;
      background-color: #444;

      &:nth-child(odd) {
        background-color: #555;
      }

      &:first-of-type {
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
      }

      &:last-of-type {
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
      }

      .skill-details {
        display: flex;
        gap: 10px;
        justify-content: space-between;
        align-items: baseline;
        width: 100%;

        .skill-departments {
          display: flex;
          gap: 10px;
          font-size: 0.75em;

          div {
            padding: 3px 8px;
            border-radius: 10px;

            &.se {
              color: var(--color-blue-600);
              background-color: var(--color-blue-100);
            }

            &.de {
              color: var(--color-emerald-600);
              background-color: var(--color-emerald-100);
            }

            &.ai {
              color: var(--color-violet-600);
              background-color: var(--color-violet-100);
            }
          }
        }
      }

      .proficiency {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;

        .description {
          text-align: center;
          color: #999;
          font-size: 0.75em;

          &:empty {
            display: none;
          }
        }

        .proficiencies {
          display: flex;
          gap: 10px;

          label {
            flex: 1;
            padding: 5px 10px;
            border-radius: 5px;
            background-color: #ccc;
            color: #000;
            cursor: pointer;
            text-align: center;

            &:hover {
              background-color: var(--color-orange);
              color: #fff;
            }

            &:has(input:checked) {
              background-color: var(--color-orange);
              color: #fff;
            }

            input {
              display: none;
            }
          }
        }
      }
    }

    .actions {
      input[type=submit] {
        width: 100%;
      }
    }
  }

  @media screen and (min-width: 500px) {
    form {
      .departments {
        flex-direction: row;
      }

      .skill {
        flex-direction: row;

        .skill-details {
          flex-direction: column;
          width: auto;
        }

        .proficiency {
          width: auto;

          .proficiencies {

            label {
              flex: 0;
            }
          }
        }
      }

      .actions {
        flex-direction: row-reverse;

        input[type=submit] {
          width: auto;
        }
      }
    }
  }
}