/* Nền tảng cho Contact Form 7; CSS từng form được nạp sau để ghi đè. */
.wpcf7-form {
  position: relative;
  width: 100%;
  margin: 0;
}

.wpcf7 label {
  display: block;
  margin: 0;
  color: var(--form-label-color, #14233d);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.wpcf7 label + label,
.wpcf7 form > p + p {
  margin-top: 12px;
}

.wpcf7 form > p {
  margin-bottom: 0;
}

/* Specificity thấp để class hoặc Section riêng có thể đổi kiểu dễ dàng. */
:where(.wpcf7) :is(input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="month"], input[type="week"], input[type="time"], select, textarea) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: var(--form-control-height, 46px);
  margin: var(--form-control-margin, 4px 0 0);
  padding: var(--form-control-padding, 0 12px);
  border: 1px solid var(--form-control-border, #cdd5e0);
  border-radius: var(--form-control-radius, 10px);
  background-color: var(--form-control-bg, #fff);
  box-shadow: none;
  color: var(--form-control-color, #14233d);
  font-size: 16px;
  line-height: 1.6;
}

/* Các ô có icon dùng cùng một khoảng chừa chữ, không đặt padding riêng từng trang. */
:where(.wpcf7) :is(.input-wrap__hotline, .apply-input) {
  --form-control-padding: 0 12px 0 36px;
}

.wpcf7 select {
  padding-right: 32px;
}

:where(.wpcf7) select[multiple] {
  height: auto;
  min-height: 120px;
  padding: 8px 12px;
  background-image: none;
}

.wpcf7 textarea {
  height: 120px;
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

:where(.wpcf7) :is(input, textarea)::placeholder {
  color: var(--form-placeholder-color, #718096);
  opacity: 1;
}

:where(.wpcf7) :is(input[type="checkbox"], input[type="radio"]) {
  width: auto;
  height: auto;
  accent-color: var(--primary, #ff7a00);
}

.wpcf7 .wpcf7-list-item label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

:where(.wpcf7) input[type="file"] {
  max-width: 100%;
  color: var(--form-control-color, #14233d);
  font-size: 16px;
}

:where(.wpcf7) :is(input[type="submit"], button[type="submit"], button:not([type])) {
  box-sizing: border-box;
  width: 100%;
  height: var(--form-control-height, 46px);
  margin: var(--form-submit-margin, 16px 0 0);
  padding: 8px 20px;
  border: 0;
  border-radius: var(--form-control-radius, 10px);
  background: var(--form-submit-bg, var(--button-primary-bg, #ff7a00));
  box-shadow: none;
  color: var(--form-submit-color, var(--button-primary-text, #fff));
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

/* Nút bọc trong p dùng khoảng cách của p, không cộng thêm margin của nút. */
.wpcf7 form > p:has(> .wpcf7-submit) {
  margin-top: 16px;
}

:where(.wpcf7 form > p) > :is(input, button).wpcf7-submit {
  margin-top: 0;
}

:where(.wpcf7) :is(input[type="submit"], button[type="submit"], button:not([type])):where(:hover) {
  background: var(--form-submit-hover-bg, #df5d00);
}

/* Bỏ bóng hover mặc định của theme; biến thể riêng vẫn có thể đặt bóng khác. */
:where(.wpcf7) :is(input[type="submit"], button[type="submit"], button:not([type])):hover {
  box-shadow: none;
}

:where(.wpcf7) :is(input[type="submit"], button[type="submit"], button:not([type])):where(:active) {
  background: var(--form-submit-active-bg, var(--primary-active, #c2410c));
}

.wpcf7 :is(input, select, textarea, button):disabled {
  opacity: .55;
  cursor: not-allowed;
}

.wpcf7 .wpcf7-not-valid:not(:focus) {
  border-color: var(--form-error-color, #b42318);
}

/* Không hiện chấm chờ riêng của CF7; trạng thái nút gửi vẫn do plugin quản lý. */
.wpcf7 .wpcf7-spinner {
  display: none;
}

.wpcf7 form.wpcf7-form .wpcf7-not-valid-tip {
  display: block;
  position: static;
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  margin: 6px 0 0;
  padding: 6px 10px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  background: #fff4f2;
  color: var(--form-error-color, #b42318);
  opacity: 1;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  z-index: auto;
}

/* Bỏ tam giác tooltip của theme để lỗi luôn nằm dưới trường, trong luồng trang. */
.wpcf7 form.wpcf7-form .wpcf7-not-valid-tip::after {
  display: none;
  content: none;
}

.wpcf7 form.wpcf7-form .wpcf7-response-output {
  position: static;
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  background: #fff4f2;
  color: var(--form-error-color, #b42318);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}

.wpcf7 form.wpcf7-form.sent .wpcf7-response-output {
  border-color: #a6f4c5;
  background: #ecfdf3;
  color: #027a48;
}
