/* ===================================================
   CONTAINER
   =================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-primary {
  color: #ffffff;
  background-color: var(--color-primary);
}

.btn-primary:hover {
  background: #fff;
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(57, 166, 83, 0.4);
}

/* ===================================================
   CT7
   =================================================== */
/* Container của nút */
.submit-wrapper {
  position: relative;
  width: 100%;
  margin-top: 10px;
}

/* Nút Submit chính */
.custom-submit-btn {
  width: 100%;
  position: relative; /* Làm gốc cho spinner */
  background: linear-gradient(135deg, #2bb673 0%, #23a065 100%);
  color: #fff;
  font-weight: 700;
  padding: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.custom-submit-btn span {
  display: inline-block;
  transition: all 0.3s ease;
}

/* Spinner - Căn giữa tuyệt đối */
.loader-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #ffffff;
  opacity: 0; /* Mặc định ẩn */
  visibility: hidden;
  transition: all 0.3s ease;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* --- TRẠNG THÁI ĐANG LOAD (SUBMITTING) --- */

/* 1. Ẩn chữ đi khi đang gửi */
.wpcf7-form.submitting .custom-submit-btn span {
  opacity: 0;
  transform: translateY(-10px);
}

/* 2. Hiện Spinner lên */
.wpcf7-form.submitting .loader-spinner {
  opacity: 1;
  visibility: visible;
}

/* 3. Hiệu ứng Hover khi bình thường */
.custom-submit-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 182, 115, 0.4);
}

/* Vô hiệu hóa nút khi đang gửi */
.wpcf7-form.submitting .custom-submit-btn {
  pointer-events: none;
  cursor: not-allowed;
}

/* Ẩn spinner mặc định của CF7 */
.wpcf7-spinner {
  display: none !important;
}

/* Xóa bỏ border mặc định dựa trên các trạng thái form của CF7 */
.wpcf7 form .wpcf7-response-output {
    border: none !important; /* Triệt tiêu cái border Duy vừa thấy */
    margin: 20px 0 0 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    text-align: center !important;
}

/* Chỉ giữ lại màu chữ (Color) theo từng trạng thái */

/* 1. Khi gửi thành công (.sent) */
.wpcf7 form.sent .wpcf7-response-output {
    color: #2bb673 !important;
    background-color: rgba(43, 182, 115, 0.1) !important;
}

/* 2. Khi có lỗi nhập liệu (.invalid) hoặc không chấp nhận (.unaccepted) */
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
    color: #ffb900 !important; /* Màu vàng cam */
    background-color: rgba(255, 185, 0, 0.1) !important;
}

/* 3. Khi gửi thất bại (.failed) hoặc bị chặn (.spam) */
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
    color: #dc3232 !important; /* Màu đỏ */
    background-color: rgba(220, 50, 50, 0.1) !important;
}

/* Reset cái thông báo lỗi nhỏ dưới mỗi ô input cho đồng bộ */
.wpcf7-not-valid-tip {
    color: #dc3232 !important;
    font-size: 0.85em !important;
    margin-top: 5px !important;
    font-weight: 500 !important;
}

/* ===================================================
  END CT7
   =================================================== */
