/* ==============================================================================
   MATSUYA R&D VIETNAM - LEAD CAPTURE MODAL POPUP
   Gọn gàng, nhỏ nhắn, mở tự động sau 60s & kích hoạt khi bấm Yêu cầu báo giá
   ============================================================================== */

/* Backdrop nền mờ */
.mrd-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  box-sizing: border-box;
}

.mrd-popup-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Dialog Thẻ Popup (Gọn gàng, thoáng đãng ~470px) */
.mrd-popup-dialog {
  position: relative;
  width: 100%;
  max-width: 470px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}

.mrd-popup-dialog::-webkit-scrollbar {
  display: none;
}

.mrd-popup-backdrop.is-open .mrd-popup-dialog {
  transform: scale(1) translateY(0);
}

/* Nút đóng góc phải tròn */
.mrd-popup-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.mrd-popup-close-btn:hover {
  background: rgba(225, 29, 72, 0.9);
  border-color: #e11d48;
  transform: scale(1.08) rotate(90deg);
}

.mrd-popup-close-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 1. Phần Hình Ảnh Đầu Popup */
.mrd-popup-banner {
  position: relative;
  width: 100%;
  height: 140px;
  background: #0a2540;
  overflow: hidden;
  flex-shrink: 0;
}

.mrd-popup-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  display: block;
}

/* 2. Thân Nội Dung Popup (Khoảng cách thoáng đãng, cân đối) */
.mrd-popup-body {
  padding: 24px 28px 26px 28px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* Tiêu đề kêu gọi */
.mrd-popup-heading {
  text-align: center;
  margin-bottom: 4px;
}

.mrd-popup-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.mrd-popup-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

/* Đường gạch ngang phân cách */
.mrd-popup-divider {
  width: 100%;
  height: 1px;
  background: #e2e8f0;
  margin: 16px 0;
}

/* 3. Form Điền Thông Tin */
.mrd-popup-form {
  display: flex;
  flex-direction: column;
}

#mrdPopupFormBody {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hàng 2 cột: Họ tên & SĐT cùng 1 hàng */
.mrd-popup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mrd-popup-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mrd-popup-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  line-height: 1.4;
}

.mrd-popup-label span.req {
  color: #ef4444;
}

.mrd-popup-input,
.mrd-popup-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 13px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}

.mrd-popup-input::placeholder,
.mrd-popup-textarea::placeholder {
  color: #94a3b8;
}

.mrd-popup-input:focus,
.mrd-popup-textarea:focus {
  background: #ffffff;
  border-color: #009fe3;
  box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.18);
}

.mrd-popup-textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.4;
}

/* Nút Submit Form */
.mrd-popup-submit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #009fe3 0%, #0077b6 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 159, 227, 0.35);
  margin-top: 4px;
}

.mrd-popup-submit-btn:hover {
  background: linear-gradient(135deg, #008cd0 0%, #006097 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 159, 227, 0.45);
}

.mrd-popup-submit-btn:active {
  transform: translateY(0);
}

.mrd-popup-submit-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Trạng thái gửi thành công */
.mrd-popup-success-state {
  display: none;
  text-align: center;
  padding: 24px 10px;
}

.mrd-popup-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid #22c55e;
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
}

.mrd-popup-success-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.mrd-popup-success-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.mrd-popup-success-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

/* 4. Nút Gọi Trực Tiếp Hotline (Icon Rung Rung) */
.mrd-popup-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  color: #15803d;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12);
}

.mrd-popup-call-btn:hover {
  background: #22c55e;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}

/* Icon điện thoại rung rung */
.mrd-popup-phone-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: mrdPopupPhoneVibrate 1.8s ease-in-out infinite;
}

.mrd-popup-phone-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@keyframes mrdPopupPhoneVibrate {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  10%, 30%, 50% {
    transform: rotate(-15deg) scale(1.1);
  }
  20%, 40%, 60% {
    transform: rotate(15deg) scale(1.1);
  }
  70% {
    transform: rotate(0deg) scale(1);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .mrd-popup-dialog {
    max-width: calc(100vw - 28px);
  }
  .mrd-popup-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mrd-popup-body {
    padding: 20px 18px 22px 18px;
  }
}
