/* ===================================
   RESET
=================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===================================
   ESTILO GERAL
=================================== */

body {
  background-color: #f9f9f9;
  font-family: "Work Sans", sans-serif;
}

main {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

img {
  width: 100px;
  max-width: 100%;
  height: auto;
}

h1 {
  font-family: "Fjalla One", sans-serif;
}

/* ===================================
   FORMULÁRIO
=================================== */

form {
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 100px;
}

fieldset {
  min-width: 0;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 15px;
}

legend {
  font-weight: bold;
  font-size: 18px;
  padding: 0 5px;
}

label {
  display: inline-block;
  margin-bottom: 5px;
}

p {
  margin-bottom: 15px;
  font-weight: bold;
}

/* ===================================
   CAMPOS
=================================== */

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: inherit;
  font-size: 16px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===================================
   CAMPOS ESPECÍFICOS
=================================== */

/* Correção para Safari do iPhone */
input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  padding: 10px;
  margin-bottom: 20px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
}

/* Ajusta o conteúdo interno da data no Safari */
input[type="date"]::-webkit-date-and-time-value {
  min-height: 1lh;
  text-align: left;
}

input[type="radio"],
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-bottom: 0;
  vertical-align: middle;
}

input[type="color"] {
  display: inline-block;
  width: 40px;
  padding: 0 5px;
}

input[type="tel"],
input[type="file"] {
  margin-bottom: 0;
}

small {
  display: inline-block;
  margin-bottom: 20px;
}

/* ===================================
   VALIDAÇÕES
=================================== */

input:focus,
select:focus,
textarea:focus {
  border-color: cornflowerblue;
  outline: none;
}

input:invalid,
select:invalid,
textarea:invalid {
  border-color: red;
}

input:valid,
select:valid,
textarea:valid {
  border-color: green;
}

/* ===================================
   BOTÕES
=================================== */

button {
  width: 100px;
  height: 30px;
  margin-right: 10px;
  background-color: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button[type="submit"]:hover {
  background-color: green;
  color: #fff;
}

button[type="reset"]:hover {
  background-color: orangered;
  color: #fff;
}

/* ===================================
   PÁGINA DE SUCESSO
=================================== */

.sucess {
  margin: 100px auto;
  border: 2px solid green;
  border-radius: 10px;
  text-align: center;
}

.congratulations {
  font-family: "Fjalla One", sans-serif;
  padding: 100px;
}

/* ===================================
   RESPONSIVIDADE - MOBILE
=================================== */

@media (max-width: 440px) {
  main {
    width: 100%;
  }

  form {
    padding: 12px;
  }

  fieldset {
    min-width: 0;
    padding: 12px;
  }

  h1 {
    font-size: 28px;
  }

  input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 42px;
  }

  button {
    margin-bottom: 10px;
  }

  .congratulations {
    padding: 40px 15px;
  }
}
