Цвет в текстовом поле не меняется после получения фокуса ввода CSS

Всем привет!

Ребята, пробовал с помощью CSS изменить цвет фона в текстовом поле при фокусе ввода, но что-то ничего не получается. Подскажите, в чём дело?

Вот мой html код:

<form action="#" method="post">
                        <div class="text-dataes">
                            <input type="text" name="userName" id="userName" placeholder="Your Name">
                            <input type="text" name="userEmail" id="userEmail" placeholder="Your Email">
                            <textarea name="userMessage" id="userMessage" cols="30" rows="10"
                                placeholder="Your Message"></textarea>
                        </div>
                        <input class="button link" type="submit" value="Send Message">
                    </form>

Вот SCSS код:

form {

        input[type="text"],
        textarea,
        ::-webkit-input-placeholder,
        textarea::-webkit-input-placeholder {
            font-size: 1.125em;
            line-height: 1;
            color: $formSeactionCommonColor;
            font-family: "Titillium Web", Roboto, Arial, sans-serif !important;
            background-color: #273a71;
            border: none;
            border-radius: 5px;
            padding: 15px;
        }

        ::-webkit-input-placeholder::after,
        textarea::-webkit-input-placeholder::after {
            content: ' \002A';
            color: #db424b;
            padding: 15px;
            padding-left: 5px;
        }



        .text-dataes {
            @include flex_row_wrap;
            justify-content: space-around;

            @include small {
                display: inline-block;
            }

            @include extra-small {
                display: inline-block;
            }

            input[type="text"] {
                width: 45%;

                @include small {
                    width: 100%;
                    margin-bottom: 20px;
                }

                @include extra-small {
                    width: 100%;
                    margin-bottom: 20px;
                }
            }

            textarea {
                width: 95%;
                margin-top: 27px;
                margin-bottom: 60px;

                @include small {
                    width: 100%;
                    margin-top: 0;
                    margin-bottom: 20px;
                }

                @include extra-small {
                    width: 100%;
                    margin-top: 0;
                    margin-bottom: 20px;
                }
            }

            input[type="text"]:focus::-webkit-input-placeholder,
            textarea:focus::-webkit-input-placeholder {
                color: transparent;
            }

            input[type="text"]:focus,
            textarea:focus {
                border: 2px solid #ffdd99;
                background-color: #a75978;

            }
        }

        input[type="submit"] {
            @include centerUppercase;
            background-color: #30bae7;
            color: $formSeactionCommonColor;
            border: none;
            transition-duration: 1s;
            align-items: center;
            white-space: normal;
            word-wrap: break-word;

            &:hover {
                background-color: #a75978;
                box-shadow: -4px 4px 20px #000;
                cursor: pointer;
            }
        }
    }

Ответы (1 шт):

Автор решения: Sevastopol'

Вариант №1

input.active:focus,
textarea.active:focus {
  background-color: red;
  color: white;
}
<form action="">
  <p><input type="text" size="30" class="active" /></p>
  <p><textarea rows="5" cols="32" name="text" class="active"></textarea></p>
  <p><input type="submit" value="Отправить" /></p>
</form>

Вариант №2

input.active:focus,
textarea.active:focus {
  background-color: red;
  color: white;
}
<form action="">
  <p><input type="text" size="30" class="" onfocus="this.className='active'" onblur="this.className=''" /></p>
  <p><textarea rows="5" cols="32" name="text" class="active" onfocus="this.className='active'" onblur="this.className=''"></textarea></p>
  <p><input type="submit" value="Отправить" /></p>
</form>

update

form {
  input[type="text"],
  textarea,
   ::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder {
    font-size: 1.125em;
    line-height: 1;
    color: $formSeactionCommonColor;
    font-family: "Titillium Web", Roboto, Arial, sans-serif !important;
    background-color: #273a71;
    border: none;
    border-radius: 5px;
    padding: 15px;
  }
   ::-webkit-input-placeholder::after,
  textarea::-webkit-input-placeholder::after {
    content: ' \002A';
    color: #db424b;
    padding: 15px;
    padding-left: 5px;
  }
  .text-dataes {
    @include flex_row_wrap;
    justify-content: space-around;
    @include small {
      display: inline-block;
    }
    @include extra-small {
      display: inline-block;
    }
    input[type="text"] {
      width: 45%;
      @include small {
        width: 100%;
        margin-bottom: 20px;
      }
      @include extra-small {
        width: 100%;
        margin-bottom: 20px;
      }
    }
    textarea {
      width: 95%;
      margin-top: 27px;
      margin-bottom: 60px;
      @include small {
        width: 100%;
        margin-top: 0;
        margin-bottom: 20px;
      }
      @include extra-small {
        width: 100%;
        margin-top: 0;
        margin-bottom: 20px;
      }
    }
    input[type="text"]:focus::-webkit-input-placeholder,
    textarea:focus::-webkit-input-placeholder {
      color: transparent;
    }
    input[type="text"]:focus,
    textarea:focus {
      border: 2px solid #ffdd99;
      background-color: #a75978;
    }
  }
  input[type="submit"] {
    @include centerUppercase;
    background-color: #30bae7;
    color: $formSeactionCommonColor;
    border: none;
    transition-duration: 1s;
    align-items: center;
    white-space: normal;
    word-wrap: break-word;
    &:hover {
      background-color: #a75978;
      box-shadow: -4px 4px 20px #000;
      cursor: pointer;
    }
  }
}
input.active:focus,
textarea.active:focus {
  background-color: red;
  color: white;
}
<form action="#" method="post">
  <div class="text-dataes">
    <input type="text" name="userName" id="userName" class="active" placeholder="Your Name">
    <input type="text" name="userEmail" id="userEmail" class="active" placeholder="Your Email">
    <textarea name="userMessage" id="userMessage" class="active" cols="30" rows="10" placeholder="Your Message"></textarea>
  </div>
  <input class="button link" type="submit" value="Send Message">
</form>

→ Ссылка