/* === FORM CF7 v3.0 === */

/* ----------------------------------------
   FLEXBOX LAYOUT
---------------------------------------- */

.flex-form .flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.flex-form .form-field {
  box-sizing: border-box;
}

/* Colonne Desktop */
.col-1 { flex: 0 0 100%; }
.col-2 { flex: 0 0 calc(50% - 0.5rem); }
.col-3 { flex: 0 0 calc(33.333% - 0.6666rem); }
.col-4 { flex: 0 0 calc(25% - 0.75rem); }

/* Colonne speciali in sidebar */
.sidebar .col-3 { flex: 0 0 calc(50% - 0.5rem); }
.sidebar .col-3:last-child { flex: 0 0 100%; }

/* Tablet */
@media (max-width: 1024px) {
  .col-md-1 { flex: 0 0 100%; }
  .col-md-2 { flex: 0 0 calc(50% - 0.5rem); }
  .col-md-3 { flex: 0 0 calc(33.333% - 0.6666rem); }
  .col-md-4 { flex: 0 0 calc(25% - 0.75rem); }
}

/* Mobile */
@media (max-width: 768px) {
  .col-sm-1 { flex: 0 0 100%; }
  .col-sm-2 { flex: 0 0 calc(50% - 0.5rem); }
  .col-sm-3 { flex: 0 0 calc(33.333% - 0.6666rem); }
  .col-sm-4 { flex: 0 0 calc(25% - 0.75rem); }
}

/* ----------------------------------------
   CAMPI FORM - STILIZZAZIONE BASE
---------------------------------------- */

form *::placeholder {
  font-family: var(--global-body-font-family);
}

.wpcf7 form .wpcf7-response-output {
  margin: 0;
  padding: 0.5rem;
}

.wpcf7-not-valid-tip {
  font-size: 0.8rem;
}

.wpcf7 form.sent .wpcf7-response-output {
  text-align: center;
  border-radius: 0;
}
.flex-form label {
  display: block;
}
.flex-form label.hidden {
  display: none;
}

.flex-form input[type="text"], 
.flex-form input[type="number"], 
.flex-form input[type="email"],
.flex-form input[type="tel"],
.flex-form input[type="file"],
.flex-form input[type="date"],
.flex-form textarea,
.flex-form select {
  box-sizing: border-box;
  width: 100%;
  padding: 0.8rem 1rem !important;
  border-radius: 0 !important;
  border: 1px solid var(--global-palette3);
  background: transparent;
  color: var(--global-palette3) !important;
}
.flex-form select {
  /* nasconde la freccia native */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* sfondo del campo */
  background-color: var(--global-palette8) !important;

  /* freccia SVG (destra) */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6 L8 11 L13 6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 16px;

  /* spazio per la freccia */
  padding-right: 2.5rem;
}

.flex-form select,
.flex-form input[type="file"] {
  color: var(--global-palette3) !important;
  border: 1px solid var(--global-palette3);
}

.flex-form textarea {
  border-radius: 10px !important;
}

.flex-form .wpcf7-list-item-label {
  display: flex;
  align-items: center;
}
.flex-form .privacy .wpcf7-list-item-label {
  font-size: 0.7rem;
}

/* ----------------------------------------
   CHECKBOX PERSONALIZZATI (PRIVACY)
---------------------------------------- */

/* Nasconde la checkbox nativa */
.privacy input[type="checkbox"],
.checkbox-group input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* Stile visivo personalizzato */
.privacy .custom-check,
.checkbox-group .custom-check {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid var(--global-palette3);
  margin-right: 0.5rem;
  vertical-align: middle;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

/* Stato selezionato: sfondo colorato */
.privacy input[type="checkbox"]:checked + .wpcf7-list-item-label .custom-check,
.checkbox-group input[type="checkbox"]:checked + .wpcf7-list-item-label .custom-check {
  background-color: var(--global-palette3);
  border-color: var(--global-palette3);
}

/* Spunta visiva */
.privacy input[type="checkbox"]:checked + .wpcf7-list-item-label .custom-check::after,
.checkbox-group input[type="checkbox"]:checked + .wpcf7-list-item-label .custom-check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 40%;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Hover */
.privacy .custom-check:hover,
.checkbox-group .custom-check:hover {
  cursor: pointer;
}


/* ----------------------------------------
   VARI ELEMENTI DI LAYOUT
---------------------------------------- */

.mail-protetta {
  display: flex;
  align-items: center;
}

.mail-protetta > svg {
  margin-right: 0.5rem;
  width: 1.5rem;
  min-width: 1.5rem;
  height: auto;
}

.wpcf7-list-item {
  margin: 0;
}
.checkbox-group .wpcf7-list-item {
  margin: 0 1em 0 0;
}

.wpcf7-list-item > label {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 1rem;
}

.accettazione {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 100% !important;
}

/* Responsive Button Align */
@media (max-width: 992px) {
  .flex-button-submit {
    text-align: left;
  }
}

/* Button Style */
.flex-form button {
    text-transform: uppercase;
    font-weight: 600;
    border-radius: 9rem;
    font-size: .9rem;
    padding: .5rem 2rem;
}

/* Newsletter */
#newsletterForm input {
	color: white!important;
	border:0;
	border-bottom: 1px solid white;
	height: 57px;
	padding-left: 0!important;
}
#newsletterForm .wpcf7-form-control-wrap {
	width: calc(100% - 57px)
}
#newsletterForm .form-field {
	display: flex;
	align-items: flex-start;
	width: 100%
}
#newsletterForm .wpcf7-submit {
	padding: 1rem 0!important;
	border-bottom: 1px solid white;
	border-radius: 0!important;
	height: 57px;
	opacity: 1!important;
	font-size: 20px;
}
#newsletterForm .accettazione {
	color: white!important;
	font-size: 14px;
}
#newsletterForm .privacy .wpcf7-list-item-label {
    font-size:14px;
}
#newsletterForm .accettazione a{
	color: white!important;
}
#newsletterForm .custom-check {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: transparent;
    border-radius: 0;
    border: 1px solid white;
    margin-right: 0.5rem;
    vertical-align: middle;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    flex-shrink: 0;
}