/* Toyota DT — Popup Đăng ký lái thử.
 * Layout/tokens replicated from toyota.com.vn .car_popup:
 *  - overlay rgba(0,0,0,.6) + darker .popup__blur rgba(0,0,0,.8) combined
 *  - dialog 980×639 centered, z-index 99993
 *  - close btn top-right 40×40 white bg, × glyph 24px
 *  - banner flex:1 left, form 300px right with white card
 */

.tdt-popup-register {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  z-index: 99993;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
.tdt-popup-register.is-open { display: flex; }
.tdt-popup-register *,
.tdt-popup-register *::before,
.tdt-popup-register *::after { box-sizing: border-box; }

.tdt-popup-register__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.tdt-popup-register__dialog {
  position: relative;
  width: 100%;
  max-width: min(980px, calc(100vw - 40px));
  height: 639px;
  max-height: 92vh;
  background: transparent;
  z-index: 1;
  display: block;
  animation: tdtPopupIn 0.28s ease-out both;
}
@keyframes tdtPopupIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.tdt-popup-register__close {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 1px 6px;
  background: #fff;
  color: #000;
  border: 0;
  font-size: 24px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.tdt-popup-register__close:hover { background: #EB0A1E; color: #fff; }

.tdt-popup-register__split {
  display: flex;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
}

.tdt-popup-register__banner {
  flex: 1;
  background: #0b0d10;
  position: relative;
  min-height: 240px;
}
.tdt-popup-register__banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tdt-popup-register__form-wrap {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  background: #fff;
}

.tdt-popup-register__form {
  width: 100%;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  position: relative;
}

.tdt-popup-register__head { text-align: center; margin-bottom: 10px; }
.tdt-popup-register__title {
  font-size: 20px;
  font-weight: 400;
  color: #212529;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tdt-popup-register__subtitle {
  font-size: 13px;
  color: #6c757d;
  margin: 0;
  line-height: 1.4;
}

.tdt-popup-register__field {
  margin: 0;
}
.tdt-popup-register__field input,
.tdt-popup-register__field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #212529;
  font-size: 13px;
  font-family: inherit;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.tdt-popup-register__field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path fill='%23666' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  padding-right: 28px;
}
.tdt-popup-register__field input:focus,
.tdt-popup-register__field select:focus {
  border-color: #EB0A1E;
  outline: none;
}

.tdt-popup-register__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: #6c757d;
  line-height: 1.45;
  margin: 4px 0 2px;
}
.tdt-popup-register__consent input { margin-top: 2px; accent-color: #EB0A1E; }
.tdt-popup-register__consent a { color: #EB0A1E; text-decoration: underline; }

.tdt-popup-register__submit {
  margin-top: 4px;
  width: 100%;
  height: 44px;
  border: 0;
  background: #EB0A1E;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 0.15s;
  text-transform: uppercase;
}
.tdt-popup-register__submit:hover { background: #c5091a; }
.tdt-popup-register__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.tdt-popup-register__feedback {
  margin-top: 10px !important;
  font-size: 12px;
  padding: 8px 10px !important;
}

/* Floating trigger — căn chỉnh cùng kích thước/trục phải với .float-contact
   (nằm trên nút liên hệ, cùng trục dọc). float-contact: w-14 h-14 right-6 bottom-6
   → 56×56, right 24px, bottom 24px. Popup trigger nằm ngay trên, cách 12px. */
.tdt-popup-register__trigger {
  position: fixed;
  right: 24px;
  bottom: 92px; /* 24 (float-contact bottom) + 56 (float-contact height) + 12 gap */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #EB0A1E;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 40; /* same layer as .float-contact (z-40) */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.15s;
}
.tdt-popup-register__trigger:hover { background: #c5091a; transform: scale(1.06); }
.tdt-popup-register__trigger.is-available { display: flex; }

/* Mobile — giữ cùng cách nhau với float-contact mobile (chưa responsive riêng, nên để default). */
@media (max-width: 820px) {
  .tdt-popup-register__dialog { height: auto; max-height: 94vh; }
  .tdt-popup-register__split { flex-direction: column; height: auto; }
  .tdt-popup-register__banner { min-height: 160px; max-height: 180px; }
  .tdt-popup-register__form-wrap { width: 100%; }
  .tdt-popup-register__form { max-height: calc(94vh - 180px); }
  /* Trên mobile float-contact vẫn w-14 h-14 bottom-6 right-6 → giữ nguyên offsets */
}
