/* Popup form "Liên hệ tư vấn" — dùng CHUNG cho mọi trang.
   Markup do assets/js/contact-modal.js chèn vào cuối <body> lúc chạy.
   Self-contained: không phụ thuộc style.css hay <style> inline của trang. */

.sota-cm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
  background: rgba(2, 10, 24, 0.72);
  backdrop-filter: blur(6px);
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

.sota-cm-overlay.is-open {
  display: flex;
}

.sota-cm-overlay * {
  box-sizing: border-box;
}

.sota-cm-dialog {
  position: relative;
  width: min(600px, 100%);
  margin: auto;
  padding: 40px clamp(20px, 5vw, 48px) 36px;
  border: 1px solid rgba(94, 195, 255, 0.22);
  border-radius: 4px;
  background: #061a33;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  color: #d7ecff;
  animation: sotaCmIn 0.24s ease;
}

@keyframes sotaCmIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* 4 góc mảnh trang trí (giống khung ảnh mockup) */
.sota-cm-dialog::before,
.sota-cm-dialog::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  border: 1px solid rgba(126, 206, 255, 0.55);
}

.sota-cm-dialog::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.sota-cm-dialog::after {
  top: -1px;
  right: -1px;
  border-width: 1px 1px 0 0;
}

.sota-cm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a9c7e3;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sota-cm-close:hover {
  background: rgba(94, 195, 255, 0.12);
  color: #ffffff;
}

.sota-cm-close svg {
  width: 17px;
  height: 17px;
}

.sota-cm-kicker {
  margin: 0 0 10px;
  color: #37d5ff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sota-cm-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.sota-cm-intro {
  margin: 0 0 26px;
  max-width: 46ch;
  color: #9fbed9;
  font-size: 0.9rem;
  line-height: 1.65;
}

.sota-cm-field {
  margin-bottom: 16px;
}

.sota-cm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sota-cm-field label {
  display: block;
  margin-bottom: 8px;
  color: #cfe6ff;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sota-cm-field input,
.sota-cm-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(94, 195, 255, 0.22);
  border-radius: 3px;
  background: rgba(3, 18, 38, 0.72);
  color: #eaf5ff;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sota-cm-field textarea {
  min-height: 130px;
  resize: vertical;
}

.sota-cm-field input::placeholder,
.sota-cm-field textarea::placeholder {
  color: #63809d;
}

.sota-cm-field input:focus,
.sota-cm-field textarea:focus {
  outline: none;
  border-color: rgba(55, 213, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(55, 213, 255, 0.13);
}

.sota-cm-field.has-error input,
.sota-cm-field.has-error textarea {
  border-color: #ff8080;
}

.sota-cm-error {
  display: none;
  margin-top: 6px;
  color: #ffab8f;
  font-size: 0.78rem;
}

.sota-cm-field.has-error .sota-cm-error,
.sota-cm-consent.has-error .sota-cm-error {
  display: block;
}

.sota-cm-consent {
  margin: 20px 0 22px;
}

.sota-cm-consent-line {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #bcd6ee;
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: pointer;
}

.sota-cm-consent input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #0a79e7;
  cursor: pointer;
}

.sota-cm-submit {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(145deg, #0a79e7 0%, #0646aa 55%, #03246f 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.sota-cm-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 97, 218, 0.34);
}

.sota-cm-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Honeypot chống spam bot — ẩn khỏi cả mắt người lẫn screen reader */
.sota-cm-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Trạng thái gửi */
.sota-cm-status {
  display: none;
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 3px;
  font-size: 0.87rem;
  line-height: 1.55;
}

.sota-cm-status.is-ok {
  display: block;
  border: 1px solid rgba(76, 214, 138, 0.4);
  background: rgba(29, 120, 74, 0.18);
  color: #b9f2d2;
}

.sota-cm-status.is-fail {
  display: block;
  border: 1px solid rgba(255, 128, 128, 0.4);
  background: rgba(140, 40, 40, 0.18);
  color: #ffcfc4;
}

/* Khoá cuộn nền khi modal mở */
body.sota-cm-lock {
  overflow: hidden;
}

@media (max-width: 560px) {
  .sota-cm-overlay {
    padding: 0;
  }

  .sota-cm-dialog {
    min-height: 100%;
    border-radius: 0;
  }

  .sota-cm-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
