/* ========================================
   SYNTO CONTACT FORM 7 - PREMIUM DARK THEME
   CSS Universale per tutti i moduli CF7
   Coordinated with #090909 background
   ======================================== */

/* === CONTAINER PRINCIPALE CF7 === */
.wpcf7 {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  padding: 40px 35px;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

/* Effetto glow sottile sul container */
.wpcf7::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wpcf7:hover::before {
  opacity: 1;
}

/* === LAYOUT A DUE COLONNE (universale) === */
.row-two-columns {
  display: flex;
  gap: 24px;
  width: 100%;
  margin-bottom: 4px;
}

.column-left,
.column-right {
  flex: 1;
  min-width: 0;
}

/* === FIELD GROUPS === */
.wpcf7 .field-group {
  margin-bottom: 4px;
  position: relative;
}

/* === LABELS === */
.wpcf7 label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.wpcf7 label span[style*="color:red"] {
  color: #ff4757 !important;
  margin-left: 4px;
  font-size: 14px;
}

/* === TITOLI SEZIONE === */
.wpcf7 h3,
.wpcf7 h4 {
  margin: 35px 0 25px 0;
  padding-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #2196f3;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #2a2a2a;
  position: relative;
}

.wpcf7 h3::after,
.wpcf7 h4::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #2196f3, #1976d2);
  border-radius: 2px;
}

/* === INPUT FIELDS COMUNI === */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: 12px 16px;
  background: #292929;
  border: 1.5px solid #2a2a2a;
  border-radius: 8px;
  color: #c8c8c8;
  font-size: 14px;
  font-weight: 400;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 0 0 rgba(33, 150, 243, 0);
}

/* Placeholder styling */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: #6a6a6a;
  opacity: 1;
  font-style: italic;
}

/* === FOCUS STATES === */
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 input[type="date"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  outline: none;
  background: #2a2a2a;
  border-color: #2196f3;
  color: #d8d8d8;
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(33, 150, 243, 0.15),
    0 4px 12px rgba(33, 150, 243, 0.1);
  transform: translateY(-1px);
}

/* === HOVER STATES === */
.wpcf7 input[type="text"]:hover:not(:focus),
.wpcf7 input[type="email"]:hover:not(:focus),
.wpcf7 input[type="tel"]:hover:not(:focus),
.wpcf7 input[type="url"]:hover:not(:focus),
.wpcf7 input[type="number"]:hover:not(:focus),
.wpcf7 input[type="date"]:hover:not(:focus),
.wpcf7 select:hover:not(:focus),
.wpcf7 textarea:hover:not(:focus) {
  border-color: #3a3a3a;
  background: #2a2a2a;
}

/* === SELECT DROPDOWN === */
.wpcf7 select {
  cursor: pointer;
  padding-right: 40px;
  background-color: #292929 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232196f3' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

.wpcf7 select:hover {
  background-color: #2a2a2a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2342a5f5' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
}

.wpcf7 select:focus {
  background-color: #2a2a2a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232196f3' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
}

/* ANNULLA COMPLETAMENTE IL RENDERING NATIVO DELLE OPTION */
.wpcf7 select option {
  background: #292929 !important;
  background-color: #292929 !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  background-size: 0 0 !important;
  color: #c8c8c8 !important;
  padding: 10px !important;
  padding-right: 10px !important;
  box-shadow: none !important;
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
}

/* CRITICO: Forza background NONE su option in TUTTI gli stati */
.wpcf7 select option,
.wpcf7 select option:not(:checked) {
  background-image: none !important;
}

.wpcf7 select option::before,
.wpcf7 select option::after {
  content: none !important;
  display: none !important;
  background-image: none !important;
}

.wpcf7 select option:hover,
.wpcf7 select option:focus {
  background: #2a2a2a !important;
  background-color: #2a2a2a !important;
  background-image: none !important;
  color: #d8d8d8 !important;
  box-shadow: none !important;
}

.wpcf7 select option:checked,
.wpcf7 select option[selected] {
  background: #2196f3 !important;
  background-color: #2196f3 !important;
  background-image: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
  .wpcf7 select option {
    background: #292929 !important;
    background-image: none !important;
  }
  .wpcf7 select option:hover {
    background: #2a2a2a !important;
    background-image: none !important;
  }
  .wpcf7 select option:checked {
    background: #2196f3 !important;
    background-image: none !important;
  }
}

/* === TEXTAREA === */
.wpcf7 textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

/* Textarea readonly (come NDA) */
.wpcf7 textarea[readonly] {
  background: #141414;
  border-color: #3a3a3a;
  color: #b8b8b8;
  cursor: default;
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.wpcf7 textarea[readonly]:hover {
  border-color: #3a3a3a;
  background: #141414;
}

/* === CHECKBOX E RADIO === */
.wpcf7 .wpcf7-list-item {
  margin: 0;
}

.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 2px 8px 0 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: #292929;
  border: 2px solid #3a3a3a;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

.wpcf7 input[type="radio"] {
  border-radius: 50%;
}

.wpcf7 input[type="checkbox"]:hover,
.wpcf7 input[type="radio"]:hover {
  border-color: #2196f3;
}

.wpcf7 input[type="checkbox"]:checked,
.wpcf7 input[type="radio"]:checked {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  border-color: #2196f3;
}

.wpcf7 input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.wpcf7 input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

/* Acceptance labels speciali */
.wpcf7 label:has(.wpcf7-acceptance) {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #141414;
  border: 1.5px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  font-weight: 400;
  font-size: 13px;
}

.wpcf7 label:has(.wpcf7-acceptance):hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
  transform: translateX(2px);
}

/* Link dentro le label */
.wpcf7 label a {
  color: #2196f3;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.wpcf7 label a:hover {
  color: #42a5f5;
  border-bottom-color: #42a5f5;
}

/* === SUBMIT BUTTON === */
.wpcf7 input[type="submit"],
.wpcf7 button[type="submit"] {
  display: inline-block;
  padding: 8px 16px;
  margin-top: 20px;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  border: none;
  border-radius: 25px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(33, 150, 243, 0.3),
    0 0 0 0 rgba(33, 150, 243, 0.5);
  position: relative;
  overflow: hidden;
}

.wpcf7 input[type="submit"]::before,
.wpcf7 button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 button[type="submit"]:hover {
  background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
  box-shadow: 
    0 6px 20px rgba(33, 150, 243, 0.4),
    0 0 0 4px rgba(33, 150, 243, 0.2);
  transform: translateY(-2px);
}

.wpcf7 input[type="submit"]:hover::before,
.wpcf7 button[type="submit"]:hover::before {
  width: 300px;
  height: 300px;
}

.wpcf7 input[type="submit"]:active,
.wpcf7 button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(33, 150, 243, 0.3),
    0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* === FILE UPLOAD === */
.wpcf7 input[type="file"] {
  padding: 10px;
  background: #292929;
  border: 1.5px dashed #2a2a2a;
  border-radius: 8px;
  color: #c8c8c8;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wpcf7 input[type="file"]:hover {
  border-color: #2196f3;
  background: #2a2a2a;
}

/* === VALIDAZIONE ERRORI === */
.wpcf7 .wpcf7-not-valid {
  border-color: #ff4757 !important;
  background: rgba(255, 71, 87, 0.05) !important;
}

.wpcf7 .wpcf7-not-valid:focus {
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(255, 71, 87, 0.2) !important;
}

.wpcf7 .wpcf7-not-valid-tip {
  color: #ff4757;
  font-size: 12px;
  margin-top: 6px;
  display: block;
}

/* === MESSAGGI RESPONSE === */
.wpcf7 .wpcf7-response-output {
  margin: 20px 0 0 0;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.wpcf7 .wpcf7-mail-sent-ok {
  background: rgba(0, 201, 99, 0.1);
  border: 1.5px solid #00c963;
  color: #00ff7f;
}

.wpcf7 .wpcf7-validation-errors,
.wpcf7 .wpcf7-mail-sent-ng {
  background: rgba(255, 71, 87, 0.1);
  border: 1.5px solid #ff4757;
  color: #ff6b7a;
}

/* === SPINNER LOADING === */
.wpcf7 .ajax-loader {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

.wpcf7-form.submitting input[type="submit"],
.wpcf7-form.submitting button[type="submit"] {
  background: #555;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.7;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .row-two-columns {
    flex-direction: column;
    gap: 0;
  }
  
  .wpcf7 {
    padding: 30px 20px;
  }
  
  .wpcf7 h3,
  .wpcf7 h4 {
    font-size: 16px;
    margin: 25px 0 20px 0;
  }
  
  .wpcf7 input[type="submit"],
  .wpcf7 button[type="submit"] {
    padding: 14px 24px;
    font-size: 14px;
  }
}

@media (max-width: 575px) {
  .wpcf7 {
    padding: 25px 15px;
  }
}

/* === ANIMAZIONI === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wpcf7 .field-group {
  animation: fadeInUp 0.4s ease backwards;
}

.wpcf7 .field-group:nth-child(1) { animation-delay: 0.05s; }
.wpcf7 .field-group:nth-child(2) { animation-delay: 0.1s; }
.wpcf7 .field-group:nth-child(3) { animation-delay: 0.15s; }
.wpcf7 .field-group:nth-child(4) { animation-delay: 0.2s; }
.wpcf7 .field-group:nth-child(5) { animation-delay: 0.25s; }

/* === ACCESSIBILITY === */
.wpcf7 *:focus-visible {
  outline: 2px solid #2196f3;
  outline-offset: 2px;
}

/* === GRUPPI CONDIZIONALI === */
.wpcf7 [data-class="wpcf7cf_group"] {
  transition: all 0.3s ease;
}

/* === COMPATIBILITÀ CON PORTO THEME === */
.wpcf7-form p {
  margin-bottom: 0;
}

.wpcf7 br {
  display: block;
  margin: 0;
  line-height: 0;
}

/* Riduci spazio tra br consecutivi nelle zone acceptance */
.wpcf7 label:has(.wpcf7-acceptance) ~ br {
  display: none;
}

.wpcf7 label:has(.wpcf7-acceptance) ~ br + br {
  display: none;
}