/* ============================================================
   CONTACT FORM 7 — STILE ITALNOLO
   ============================================================ */

/* Wrapper principale del form */
.wpcf7 {
  width: 100%;
}

.wpcf7 form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Riga con due colonne */
.cf7-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .cf7-row { grid-template-columns: 1fr; }
}

/* Label */
.wpcf7 .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* Input e textarea */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: .8rem 1.1rem;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.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 select:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(242, 96, 12, .12);
  background: var(--color-card);
}

/* Placeholder */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: var(--color-text-muted);
  opacity: .65;
}

/* Textarea */
.wpcf7 textarea {
  resize: vertical;
  min-height: 130px;
}

/* Select */
.wpcf7 select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23999' d='M4.5 6L8 9.5 11.5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Checkbox & Radio */
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-orange);
  cursor: pointer;
  flex-shrink: 0;
}

.wpcf7 .wpcf7-list-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .3rem 0;
}

.wpcf7 .wpcf7-list-item-label {
  font-size: .9rem;
  color: var(--color-text);
  cursor: pointer;
}

/* Submit button */
.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
  width: 100%;
  padding: .95rem 2rem;
  background: var(--color-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  display: block;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
  background: var(--color-orange-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(242, 96, 12, .35);
}

.wpcf7 input[type="submit"]:active {
  transform: translateY(0);
}

/* Loading spinner */
.wpcf7 .wpcf7-spinner {
  display: none;
}

.wpcf7.submitting input[type="submit"] {
  opacity: .7;
  pointer-events: none;
  background: var(--color-orange-dark);
}

/* VALIDATION ERRORS */
.wpcf7 .wpcf7-not-valid {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, .1) !important;
}

.wpcf7 .wpcf7-not-valid-tip {
  display: block;
  font-size: .78rem;
  color: #e53e3e;
  margin-top: .3rem;
  font-family: var(--font-mono);
}

/* RESPONSE OUTPUT */
.wpcf7 .wpcf7-response-output {
  margin: .75rem 0 0;
  padding: .9rem 1.25rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  border: none;
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* Success */
.wpcf7 .wpcf7-mail-sent-ok {
  background: rgba(0, 168, 84, .1);
  border-left: 3px solid #00a854;
  color: #00763a;
}

[data-theme="dark"] .wpcf7 .wpcf7-mail-sent-ok {
  background: rgba(0, 168, 84, .08);
  color: #4cd989;
}

/* Error */
.wpcf7 .wpcf7-mail-sent-ng,
.wpcf7 .wpcf7-aborted {
  background: rgba(229, 62, 62, .08);
  border-left: 3px solid #e53e3e;
  color: #c53030;
}

[data-theme="dark"] .wpcf7 .wpcf7-mail-sent-ng,
[data-theme="dark"] .wpcf7 .wpcf7-aborted {
  color: #fc8181;
}

/* Validation summary */
.wpcf7 .wpcf7-validation-errors {
  background: rgba(245, 158, 11, .08);
  border-left: 3px solid #f59e0b;
  color: #92400e;
}

[data-theme="dark"] .wpcf7 .wpcf7-validation-errors {
  color: #fbbf24;
}

/* ACCEPTANCE / GDPR */
.wpcf7 .wpcf7-acceptance {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .83rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"] {
  margin-top: 2px;
}

.wpcf7 .wpcf7-acceptance a {
  color: var(--color-orange);
  text-decoration: underline;
}

/* FIELD GROUPS con label sopra (usare <p> wrap in CF7) */
.wpcf7 p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.wpcf7 p > label,
.wpcf7 p > span > label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: .1rem;
}

/* Rimuovi margin di default p in CF7 dentro .card */
.card .wpcf7 p {
  margin: 0;
}

/* Dark mode specifics */
[data-theme="dark"] .wpcf7 input[type="text"],
[data-theme="dark"] .wpcf7 input[type="email"],
[data-theme="dark"] .wpcf7 input[type="tel"],
[data-theme="dark"] .wpcf7 input[type="url"],
[data-theme="dark"] .wpcf7 select,
[data-theme="dark"] .wpcf7 textarea {
  background: #141414;
  border-color: #2a2a2a;
  color: #f0ede8;
}

[data-theme="dark"] .wpcf7 input:focus,
[data-theme="dark"] .wpcf7 textarea:focus,
[data-theme="dark"] .wpcf7 select:focus {
  background: #1c1c1c;
  border-color: var(--color-orange);
}

/* Light mode border */
[data-theme="light"] .wpcf7 input[type="text"],
[data-theme="light"] .wpcf7 input[type="email"],
[data-theme="light"] .wpcf7 input[type="tel"],
[data-theme="light"] .wpcf7 input[type="url"],
[data-theme="light"] .wpcf7 select,
[data-theme="light"] .wpcf7 textarea {
  background: #ffffff;
  border-color: #d8d8d8;
  color: #111111;
}

[data-theme="light"] .wpcf7 input:focus,
[data-theme="light"] .wpcf7 textarea:focus,
[data-theme="light"] .wpcf7 select:focus {
  background: #ffffff;
  border-color: var(--color-orange);
}

/* Dark / Light Mode Button Fix */
button,
.btn,
input[type="submit"],
.wp-element-button {
    transition: all 0.3s ease;
}

.dark-mode button,
.dark-mode .btn,
.dark-mode .wp-element-button {
    background: #222 !important;
    color: #fff !important;
    border-color: #444 !important;
}

.light-mode button,
.light-mode .btn,
.light-mode .wp-element-button {
    background: #fff !important;
    color: #111 !important;
    border-color: #ccc !important;
}
