/*
 * Popup form liên hệ (#form-contact-footer) — giao diện mới.
 * Selector bắt đầu bằng #form-contact-footer để thắng style CF7 chung;
 * vài chỗ cần !important vì form trên live có inline style (hàng flex, chữ đỏ).
 */
#form-contact-footer.modal {
  max-width: 600px;
  padding: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px -20px rgba(8, 12, 60, 0.55);
  font-family: "SVN-Biennale", sans-serif;
}

/* ===== Phần đầu ===== */
#form-contact-footer .fcf-head {
  position: relative;
  overflow: hidden;
  padding: 26px 32px 22px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, #10096c 0%, #0a2f9d 60%, #005ae1 100%);
  color: #fff;
}

#form-contact-footer .fcf-head::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(254, 102, 37, 0.35) 0%, rgba(254, 102, 37, 0) 70%);
  pointer-events: none;
}

#form-contact-footer .fcf-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 178, 64, 0.4);
  background: rgba(255, 178, 64, 0.12);
  color: #ffb240;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

#form-contact-footer .fcf-title {
  position: relative;
  z-index: 1;
  margin: 12px 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

#form-contact-footer .fcf-sub {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

/* ===== Thân form ===== */
#form-contact-footer .fcf-body {
  padding: 24px 32px 26px;
}

/* Khoá cuộn trang khi popup mở; popup cuộn trong .blocker */
html.fcf-scroll-lock,
html.fcf-scroll-lock body {
  overflow: hidden !important;
}

html.fcf-scroll-lock .blocker {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Lưới 2 cột: ô nhập ngắn (tên, công ty, SĐT, email) chia đôi; còn lại full hàng */
#form-contact-footer .wpcf7-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#form-contact-footer .wpcf7-form > * {
  grid-column: 1 / -1;
  margin: 0;
}

#form-contact-footer .wpcf7-form > p:has(input.wpcf7-text) {
  grid-column: auto;
}

#form-contact-footer .wpcf7-form > .hidden-fields-container {
  display: none;
}

/* Hàng 2 cột (form live dùng div inline style display:flex) */
#form-contact-footer .wpcf7-form > div[style] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px !important;
  align-items: start !important;
}

#form-contact-footer .wpcf7-form > div[style] > div {
  min-width: 0;
}

#form-contact-footer label {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #1c2933;
}

#form-contact-footer label > span:not(.wpcf7-form-control-wrap) {
  color: #fe6625;
}

#form-contact-footer .wpcf7-form-control-wrap {
  display: block;
  margin-top: 8px;
}

#form-contact-footer input.wpcf7-form-control:not(.wpcf7-submit),
#form-contact-footer select.wpcf7-form-control,
#form-contact-footer textarea.wpcf7-form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e3e9f2;
  border-radius: 12px;
  background: #f3f6fb;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #1c2933;
  box-shadow: none;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

#form-contact-footer textarea.wpcf7-form-control {
  height: 96px;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

#form-contact-footer .wpcf7-form-control::placeholder {
  color: #8a97a6;
  font-style: normal;
  opacity: 1;
}

#form-contact-footer input.wpcf7-form-control:not(.wpcf7-submit):hover,
#form-contact-footer textarea.wpcf7-form-control:hover {
  border-color: #c9d3e1;
}

#form-contact-footer input.wpcf7-form-control:not(.wpcf7-submit):focus,
#form-contact-footer select.wpcf7-form-control:focus,
#form-contact-footer textarea.wpcf7-form-control:focus {
  border-color: #2b6ff3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 111, 243, 0.15);
}

#form-contact-footer .wpcf7-form-control[aria-invalid="true"] {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
}

/* ===== Dịch vụ dạng nút (JS tạo .fcf-chips, select gốc ẩn đi) ===== */
#form-contact-footer select.fcf-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

#form-contact-footer .fcf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#form-contact-footer .fcf-chip {
  padding: 9px 16px;
  border: 1px solid #e3e9f2;
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: #44515e;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

#form-contact-footer .fcf-chip:hover {
  border-color: #fe6625;
  color: #c2410c;
}

#form-contact-footer .fcf-chip:focus-visible {
  outline: 2px solid #2b6ff3;
  outline-offset: 2px;
}

#form-contact-footer .fcf-chip.is-active {
  border-color: #fe6625;
  background: #fff3ec;
  color: #c2410c;
}

/* ===== Nút gửi ===== */
#form-contact-footer .wpcf7-submit {
  width: 100%;
  height: 52px;
  padding: 0 24px 0 24px;
  border: 0;
  border-radius: 999px;
  background: #fe6625 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"), linear-gradient(90deg, #fd6624 0%, #e54600 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: calc(50% + 92px) center, 0 0;
  background-size: 20px 20px, 100% 100%;
  box-shadow: 0 12px 28px -8px rgba(254, 102, 37, 0.55);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#form-contact-footer .wpcf7-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -8px rgba(254, 102, 37, 0.65);
}

#form-contact-footer .wpcf7-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ===== Dòng cam kết =====
 * Dùng .fcf-note trong footer.php; ẩn dòng chữ đỏ có sẵn trong nội dung form CF7 trên live để không bị lặp.
 */
#form-contact-footer .wpcf7-form > p[style*="color"] {
  display: none;
}

#form-contact-footer .fcf-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: #5b6772;
}

#form-contact-footer .fcf-note svg {
  flex-shrink: 0;
}

/* ===== Spinner CF7: nằm giữa nút gửi, ẩn chữ trong lúc gửi ===== */
#form-contact-footer .wpcf7-form > p:has(.wpcf7-submit) {
  position: relative;
}

#form-contact-footer .wpcf7-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

#form-contact-footer .wpcf7-spinner::before {
  background-color: #fff;
}

#form-contact-footer .wpcf7-form.submitting .wpcf7-submit {
  color: transparent;
  background-image: linear-gradient(90deg, #fd6624 0%, #e54600 100%);
  background-size: 100% 100%;
  background-position: 0 0;
}

/* ===== Thông báo ===== */
#form-contact-footer .wpcf7-not-valid-tip {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
}

#form-contact-footer .wpcf7-response-output {
  margin: 0 !important;
  padding: 10px 14px !important;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
}

#form-contact-footer .wpcf7-response-output:empty {
  display: none;
}

/* ===== Mobile ===== */
@media (max-width: 575px) {
  #form-contact-footer .fcf-head {
    padding: 22px 20px 18px;
  }

  #form-contact-footer .fcf-title {
    font-size: 18px;
  }

  #form-contact-footer .fcf-body {
    padding: 20px 20px 22px;
  }

  #form-contact-footer .wpcf7-form,
  #form-contact-footer .wpcf7-form > div[style] {
    grid-template-columns: minmax(0, 1fr);
  }

  #form-contact-footer .wpcf7-form > p:has(input.wpcf7-text) {
    grid-column: 1 / -1;
  }

  #form-contact-footer .fcf-chip {
    padding: 8px 12px;
    font-size: 13px;
  }
}
