/* Scoped al form custom */

/* Sfondo scuro come screenshot */
body#contact,
body.page-contact,
body#contact #wrapper,
body.page-contact #wrapper {
  background: #2f2f2f;
}

.cc-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  color: #e9e9e9;
}

.cc-title {
  margin: 0 0 24px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  color: #7b6bb0;
  letter-spacing: -0.02em;
}

.cc-intro {
  margin-bottom: 40px;
}

.cc-intro p {
  margin: 0;
  font-size: 22px;
  line-height: 1.55;
  color: #d7d7d7;
}

.cc-link {
  color: #7b6bb0;
  text-decoration: none;
}

.cc-link:hover {
  text-decoration: underline;
}

.cc-form {
  margin-top: 10px;
}

.cc-block {
  margin: 28px 0;
}

.cc-label {
  display: block;
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.cc-required {
  color: #b04d4d;
}

.cc-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
}

@media (max-width: 560px) {
  .cc-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cc-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  color: #e9e9e9;
  cursor: pointer;
  user-select: none;
}

.cc-check input[type="checkbox"] {
  width: 28px;
  height: 28px;
  accent-color: #7b6bb0;
}

.cc-textarea-wrap {
  position: relative;
}

.cc-textarea {
  width: 100%;
  min-height: 170px;
  padding: 14px 14px 44px;
  border: 0;
  border-radius: 2px;
  background: #efefef;
  color: #111;
  font-size: 16px;
  resize: vertical;
}

.cc-counter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 14px;
  color: #6a6a6a;
}

.cc-input {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 2px;
  background: #efefef;
  color: #111;
  font-size: 16px;
}

.cc-input:focus,
.cc-textarea:focus {
  outline: 2px solid #7b6bb0;
  outline-offset: 2px;
}

.cc-actions {
  margin-top: 18px;
}

.cc-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: 0;
  border-radius: 2px;
  background: #7b6bb0;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.cc-submit:hover {
  filter: brightness(0.95);
}

/* Nasconde eventuale form originale di ps_contactform se ancora stampato sopra */
#contact .contact-form,
#contact .contact-rich,
#contact .contact-form-box {
  display: none;
}

/* =========================
   RESPONSIVE / MOBILE-FIRST
   ========================= */

/* Base: rendi tutto fluido */
.custom-contact-wrapper,
.cc-container {
  width: 100%;
  max-width: 100%;
}

.cc-container {
  padding-left: 16px;
  padding-right: 16px;
}

/* Input/textarea più comodi su touch */
.cc-input,
.cc-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* iOS zoom fix: sotto i 16px Safari zooma */
.cc-input,
.cc-textarea,
.cc-checkbox label {
  font-size: 16px;
}

/* Griglia checkbox: desktop 3 colonne, tablet 2, mobile 1 */
.cc-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}

/* Tablet */
@media (max-width: 768px) {
  .cc-title {
    font-size: 40px;
    line-height: 1.05;
  }

  .cc-description {
    font-size: 16px;
    line-height: 1.5;
  }

  .cc-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* campi uno sotto l’altro */
  .cc-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cc-textarea {
    min-height: 160px;
  }
}





/* === JS validation errors === */
.cc-error{display:none;margin-top:8px;font-size:14px;line-height:1.3;color:#ff6b6b;}
.cc-input.is-invalid,.cc-textarea.is-invalid{border-color:rgba(255,107,107,.9)!important;box-shadow:0 0 0 2px rgba(255,107,107,.15);}
.cc-check-grid.is-invalid{border:1px solid rgba(255,107,107,.7);border-radius:12px;padding:12px;}

/* === Flash message (via GET success/error) === */
.cc-alert{margin:0 0 18px;padding:14px 16px;border-radius:6px;font-size:16px;line-height:1.4;}
.cc-alert--success{background:rgba(34,197,94,.14);border:1px solid rgba(34,197,94,.35);color:#d1fae5;}
.cc-alert--error{background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.35);color:#fee2e2;}
