/**********************************************************
 * BRAND COLOR (Tamgiaquan):
 * - Xanh brand: #7E22CE
 * - Đỏ nhấn CTA: #ec1c24
 * - Nền nhạt: #f5f7fb
 **********************************************************/

/* ================== CONTACT FORM 7 – CHUẨN HÓA ================== */

.wpcf7 {
  max-width: 100%;
}

/* Khung form chung */
.wpcf7 form {
  background-color: #f5f7fb;
  padding: 20px;
  border-radius: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #7E22CE;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Label, legend */
.wpcf7 form label,
.wpcf7 form legend {
  display: block;
  margin-bottom: 4px;
  color: #7E22CE;
  font-weight: 600;
  font-size: 14px;
}

/* Fieldset */
.wpcf7 form fieldset {
  border: 1px solid #d4dbea;
  padding: 16px;
  border-radius: 5px;
  margin-bottom: 16px;
}

/* Input & select & textarea */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea,
.wpcf7 select {
  width: 100%;
  padding: 10px 14px;
  margin: 0 0 12px;
  border: 1px solid #cbd2e1;
  border-radius: 5px;
  background-color: #ffffff;
  color: #7E22CE;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-sizing: border-box;
}

/* Placeholder */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: #7a8498;
  opacity: 1;
}

/* Focus */
.wpcf7 input:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
  border-color: #7E22CE;
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 44, 95, 0.1);
}

/* Select */
.wpcf7 select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%237E22CE' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 38px;
}

/* Option nền trắng */
.wpcf7 select option {
  background-color: #ffffff;
  color: #7E22CE;
}

/* Checkbox & radio */
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  accent-color: #7E22CEf;
  margin-right: 6px;
  transform: scale(1.05);
}

/* Group radio ngang – căn trái, wrap */
.wpcf7 .wpcf7-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 8px;
}

.wpcf7 .wpcf7-radio label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7E22CE;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
}

/* Nút submit */
.wpcf7 input[type="submit"] {
  background-color: #F59E0B;
  color: #ffffff;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.wpcf7 input[type="submit"]:hover {
  background-color: #16A34A;
  box-shadow: 0 6px 16px rgba(201, 21, 29, 0.3);
}

.wpcf7 input[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Thông báo phản hồi chung */
.wpcf7-response-output {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #7E22CE;
  background-color: #e9f0ff;
  color: #7E22CE;
  font-size: 16px;
}

/* Lỗi từng field */
.wpcf7-not-valid-tip {
  color: #c9151d;
  font-size: 12px;
  margin-top: 4px;
}

/* Trạng thái đang gửi */
.wpcf7 .ajax-loader {
  margin-left: 6px;
}

/* Căn giữa ảnh mặc định (nếu có dùng trong nội dung form) */
.aligncenter,
.wp-block-image img.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ================== POPUP WRAPPER ================== */

.popup-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup-overlay.active {
  display: flex;
  animation: dvhpFadeInScale 0.25s ease-out forwards;
}

/* Card popup */
.popup-content {
  background: #ffffff;
  color: #7E22CE;
  border-radius: 16px;
  width: 95%;
  max-width: 900px;
  position: relative;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  padding: 18px 18px 20px;
}

/* Bố cục 2 cột: ảnh + form */
.popup-inner {
  display: flex;
  gap: 18px;
  align-items: stretch;
}

/* Cột trái (Ảnh) */
.popup-left {
  flex: 1 1 45%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-banner {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Cột phải (Form + text) */
.popup-right {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
}

/* Tiêu đề + mô tả */
.popup-title {
  color: #7E22CE;
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 800;
  text-transform: uppercase;
}

.popup-subtitle {
  color: #4b556b;
  font-size: 13px;
  margin: 0 0 14px;
}

/* Thu gọn form trong popup (không cần nền nữa) */
.popup-right .wpcf7 form {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Nút đóng X */
.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  color: #4b556b;
  font-size: 24px;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease, transform 0.1s ease;
}

.popup-close:hover {
  color: #c9151d;
  transform: scale(1.1);
}

/* Hiệu ứng xuất hiện popup */
@keyframes dvhpFadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================== RESPONSIVE ================== */

@media (max-width: 991.98px) {
  .popup-content {
    max-width: 640px;
    padding: 16px;
  }

  .popup-inner {
    gap: 14px;
  }

  .popup-title {
    font-size: 18px;
  }
}

@media (max-width: 767.98px) {
  .popup-content {
    padding: 14px 12px 16px;
    border-radius: 14px;
  }

  .popup-inner {
    flex-direction: column;
  }

  .popup-left,
  .popup-right {
    flex: 1 1 100%;
  }

  .popup-title {
    font-size: 20px;
    text-align: left;
  }

  .popup-subtitle {
    font-size: 18px;
    text-align: left;
  }

  .popup-close {
    top: 6px;
    right: 8px;
  }

  .wpcf7 input[type="text"],
  .wpcf7 input[type="email"],
  .wpcf7 input[type="tel"],
  .wpcf7 textarea,
  .wpcf7 select {
    font-size: 15px;
    padding: 9px 12px;
  }

  .wpcf7 .wpcf7-radio {
    gap: 8px 14px;
  }
}

@media (max-width: 480px) {
  .popup-content {
    width: 96%;
  }

  .popup-title {
    font-size: 20px;
  }

  .wpcf7 input[type="submit"] {
    font-size: 16px;
  }
}