/* Form design system (Contact Form 7) - condiviso da tutti i blocchi che ospitano un form.
   Riproduce i campi del sito originale (.form-field a etichetta assoluta a sinistra, select con
   freccia custom, textarea senza label, file, checkbox privacy, submit tondo).
   Lo scope e` .wpcf7-form (il <form> generato da CF7), non il singolo blocco.
   Asset freccia: assets/img/select-arrow.svg. */

/* contenitore del form */
.wpcf7-form { margin: 0; }
.wpcf7-form .row { --bs-gutter-x: 1.875rem; }

/* ------------------------------------------------------------------
   CAMPI
------------------------------------------------------------------ */
.wpcf7-form .form-field {
  position: relative;
  display: block;
  min-height: 3.75rem;
  margin-bottom: 1.875rem;
  font-size: .75rem;
  line-height: 1.25;
  font-weight: 500;
  color: #0d47a1;
}
@media (min-width: 992px) {
  .wpcf7-form .form-field { margin-bottom: 3.75rem; }
}
.wpcf7-form .form-field.no-height { min-height: 0; }

/* etichette (a sinistra, sovrapposte: gli input hanno padding-left 33%+30px) */
.wpcf7-form label {
  padding-left: .125rem;
  position: absolute;
  bottom: 1.40625rem;
  margin: 0;
  color: #0d47a1;
  font-size: .75rem;
  line-height: 1.25;
  font-weight: 500;
  cursor: pointer;
}

/* etichetta di sezione ("le tue referenze", "REPORT DETAILS", ...) */
.wpcf7-form .field-type--label { min-height: 0; margin-bottom: 0; }
.wpcf7-form .field-type--label small {
  display: inline-block;
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 500;
}

/* input / select / textarea */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="url"],
.wpcf7-form select,
.wpcf7-form textarea {
  display: block;
  width: 100%;
  height: 3.75rem;
  background: transparent;
  padding: 0 .3125rem 0 calc(33.3333333% + 30px);
  font-size: .75rem;
  line-height: 1.5em;
  font-weight: 500;
  transition: all .5s cubic-bezier(.77, 0, .175, 1);
  border: none;
  border-bottom: 1px solid #0d47a1;
  border-radius: 0 !important;
  color: #0d47a1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.wpcf7-form textarea { resize: vertical; }

/* placeholder */
.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder { color: rgba(13, 71, 161, .5); opacity: 1; }

/* select: freccia custom */
.wpcf7-form select,
.wpcf7-form select:active,
.wpcf7-form select:focus,
.wpcf7-form select:hover {
  background-image: url("../img/select-arrow.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: .9375rem .9375rem;
}

/* textarea: etichetta nascosta, usa il placeholder */
.wpcf7-form .field-type--textarea { position: relative; }
.wpcf7-form .field-type--textarea label { opacity: 0; }
.wpcf7-form .field-type--textarea textarea {
  min-height: 6.25rem;
  padding-left: .125rem;
  padding-top: 1.25rem;
}
.wpcf7-form .field-type--textarea textarea::placeholder { color: #0d47a1; }
@media (min-width: 992px) {
  .wpcf7-form .field-type--textarea label { top: 0; bottom: auto; }
}

/* wrapper CF7 */
.wpcf7-form .wpcf7-form-control-wrap { display: block; }
.wpcf7-form .wpcf7-not-valid { border-bottom-color: #d31f26 !important; }
.wpcf7-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: .3125rem;
  font-size: .6875rem;
  font-weight: 700;
  color: #d31f26;
}

/* ------------------------------------------------------------------
   FILE
------------------------------------------------------------------ */
.wpcf7-form .field-type--file { position: relative; }
.wpcf7-form .file-text { width: 70%; position: absolute; left: 0; }
@media (min-width: 992px) {
  .wpcf7-form .file-text { bottom: .9375rem; }
}
.wpcf7-form .file-text span { display: block; color: #0d47a1; }
.wpcf7-form .file-text small {
  display: block;
  color: rgba(13, 71, 161, .3);
}
.wpcf7-form .field-type--file input[type="file"] {
  display: block;
  width: 100%;
  height: 6.875rem;
  background: transparent;
  padding: 5rem 0 0 0;
  font-size: .75rem;
  line-height: 1.5em;
  border: none;
  border-radius: 0 !important;
  color: #0d47a1;
  position: absolute;
  cursor: pointer;
  z-index: 2;
}
@media (min-width: 992px) {
  .wpcf7-form .field-type--file input[type="file"] { padding-top: 2.8125rem; height: 4.375rem; }
}
.wpcf7-form .field-type--file input[type="file"]::file-selector-button { display: none; }
.wpcf7-form .field-type--file input[type="file"]::-webkit-file-upload-button { display: none; }

.wpcf7-form .file-upload-button {
  text-transform: uppercase;
  display: inline-block;
  color: #0d47a1;
  position: absolute;
  right: 0;
  top: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-bottom: .9375rem;
  z-index: 1;
  font-size: .75rem;
  font-weight: 500;
}
.wpcf7-form .file-upload-button span { position: relative; }
.wpcf7-form .file-upload-button span:after {
  content: "";
  background: #0d47a1;
  width: 100%;
  position: absolute;
  bottom: -5px;
  right: 0;
  height: 1px;
  z-index: 3;
  transition: all .5s cubic-bezier(.77, 0, .175, 1);
}
.wpcf7-form .field-type--file:active .file-upload-button span:after,
.wpcf7-form .field-type--file:focus .file-upload-button span:after,
.wpcf7-form .field-type--file:hover .file-upload-button span:after { bottom: -2.5px; }

/* ------------------------------------------------------------------
   CHECKBOX PRIVACY (CF7 acceptance)
------------------------------------------------------------------ */
.wpcf7-form .form-field--checkbox { position: relative; }
.wpcf7-form .checkbox-wrapper {
  position: relative;
  top: 0;
  left: 0;
  padding-left: 2.1875rem;
  min-height: 1.125rem;
  display: flex;
  align-items: center;
}
.wpcf7-form .checkbox-wrapper a {
  color: inherit;
  text-decoration: underline !important;
}
.wpcf7-form .checkbox-wrapper .text--xs,
.wpcf7-form .checkbox-wrapper > span:first-child {
  font-size: .75rem;
  line-height: 1.25;
  font-weight: 500;
}
/* appiattisce i wrapper CF7 */
.wpcf7-form .checkbox-wrapper .wpcf7-form-control-wrap,
.wpcf7-form .checkbox-wrapper .wpcf7-acceptance,
.wpcf7-form .checkbox-wrapper .wpcf7-list-item,
.wpcf7-form .checkbox-wrapper label { display: contents; }

/* il checkbox vero e proprio fa da "checkmark" */
.wpcf7-form .checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 2px solid #0d47a1;
  cursor: pointer;
  transition: all .5s cubic-bezier(.77, 0, .175, 1);
  z-index: 2;
}
.wpcf7-form .checkbox-wrapper input[type="checkbox"]:checked { background-color: #0d47a1; }
.wpcf7-form .checkbox-wrapper input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: .3125rem;
  top: .0625rem;
  width: .3125rem;
  height: .625rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ------------------------------------------------------------------
   SUBMIT (bottone tondo)
------------------------------------------------------------------ */
.wpcf7-form .form-field--submit { position: relative; }
.wpcf7-form .btn {
  text-transform: uppercase;
  font-size: .75rem;
  line-height: 1.5;
  outline: none;
  -webkit-appearance: none;
  transition: all .5s cubic-bezier(.77, 0, .175, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: none;
  text-decoration: none;
  padding: .9375rem 1.875rem;
  margin: 0;
  color: #fff;
  cursor: pointer;
}
.wpcf7-form .btn--l { width: 100%; height: 3.125rem; }
.wpcf7-form .btn--round {
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 50%;
  border: .0625rem solid #0d47a1;
  background: transparent;
  color: #0d47a1;
  text-decoration: none;
}
.wpcf7-form .btn--round:active,
.wpcf7-form .btn--round:focus,
.wpcf7-form .btn--round:hover {
  text-decoration: none !important;
  font-style: normal;
}
.wpcf7-form input[type="submit"].submit {
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 50%;
  border: .0625rem solid #0d47a1;
  background: transparent;
  color: #0d47a1;
}
.wpcf7-form input[type="submit"].submit:hover,
.wpcf7-form input[type="submit"].submit:focus {
  background: transparent;
  color: #0d47a1;
}

/* ------------------------------------------------------------------
   RISPOSTA CF7
------------------------------------------------------------------ */
.wpcf7-form .wpcf7-response-output {
  margin: 1.875rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid #0d47a1;
  color: #0d47a1;
  font-size: .8125rem;
}
.wpcf7-form.invalid .wpcf7-response-output { border-color: #d31f26; color: #d31f26; }
.wpcf7-form .wpcf7-spinner { margin: 0 1rem; }

