
  </style>
</head>

<body>

  <div style="max-width: 500px; margin-left: auto; margin-right: auto; padding: 15px;">

    <h1>Оформление input в зависимости от состояния проверки</h1>

    <form id="form" action="#" novalidate>
      <div class="text-field">
        <label class="text-field__label" for="firstname">First name*</label>
        <input class="text-field__input" type="text" name="firstname" id="firstname" required>
        <div class="text-field__message"