
/* =========================================
   XEBN - DANG KY CANH BAO PHAT NGUOI
   FULL CSS - DESKTOP + MOBILE + POPUP FIX
   ========================================= */

.xebn-alert,
.xebn-alert * { box-sizing: border-box; }

.xebn-alert {
  --xebn-navy: #08243d;
  --xebn-blue: #14517e;
  --xebn-blue-soft: #eef6fb;
  --xebn-red: #d2343e;
  --xebn-red-dark: #ae222d;
  --xebn-green: #17613f;
  --xebn-amber: #8b5b00;
  --xebn-line: #d7e2e9;
  --xebn-text: #1d2b36;
  --xebn-muted: #5d6f7c;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--xebn-line);
  border-radius: 24px;
  background: #fff;
  color: var(--xebn-text);
  box-shadow: 0 20px 55px rgba(8, 36, 61, .13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* HEADER FORM */

.xebn-alert__header {
  padding: clamp(22px, 5vw, 38px);
  background: linear-gradient(135deg, var(--xebn-navy), #134a73);
  color: #fff;
}

.xebn-alert__eyebrow {
  color: #ffd8da;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.xebn-alert__header h2 {
  margin: 7px 0 9px;
  color: #fff;
  font-size: clamp(25px, 5vw, 38px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.xebn-alert__header p {
  max-width: 680px;
  margin: 0;
  color: #dcebf5;
}

/* CAC BUOC DANG KY */

.xebn-alert__steps {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px clamp(22px, 5vw, 38px);
  border-bottom: 1px solid var(--xebn-line);
  background: #fbfdfe;
  color: var(--xebn-muted);
  font-size: 14px;
  font-weight: 700;
}

.xebn-alert__steps span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.xebn-alert__steps b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #dfe8ee;
  color: #617480;
}

.xebn-alert__steps i {
  flex: 1;
  max-width: 90px;
  height: 2px;
  background: #dce5ea;
}

.xebn-alert__steps .is-active {
  color: var(--xebn-navy);
}

.xebn-alert__steps .is-active b {
  background: var(--xebn-red);
  color: #fff;
}

.xebn-alert__steps .is-done b {
  background: var(--xebn-green);
  color: #fff;
}

/* FORM */

.xebn-alert__form,
.xebn-alert__payment,
.xebn-alert__thanks {
  padding: clamp(22px, 5vw, 38px);
}

.xebn-alert__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.xebn-alert label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--xebn-navy);
  font-weight: 750;
}

.xebn-alert label em {
  color: var(--xebn-red);
  font-style: normal;
}

.xebn-alert input[type="text"],
.xebn-alert input[type="tel"],
.xebn-alert input[type="email"] {
  width: 100%;
  min-height: 52px;
  margin: 0;
  border: 1.5px solid #afc1ce;
  border-radius: 11px;
  background: #fff;
  color: var(--xebn-text);
  padding: 11px 13px;
  font: inherit;
  box-shadow: none;
}

.xebn-alert input:focus {
  outline: none;
  border-color: var(--xebn-blue);
  box-shadow: 0 0 0 4px rgba(20, 81, 126, .12);
}

/* DONG Y DIEU KHOAN */

.xebn-alert__consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: 21px;
  color: #40525f;
  font-size: 14px;
}

.xebn-alert__consent input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--xebn-blue);
}

.xebn-alert__consent span {
  margin: 0 !important;
  font-weight: 500 !important;
  color: inherit !important;
}

.xebn-alert__honey {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* GHI CHU */

.xebn-alert__note {
  margin: 20px 0;
  border-left: 4px solid #e5a817;
  border-radius: 9px;
  background: #fff8e7;
  color: #5d4a1c;
  padding: 13px 15px;
  font-size: 14px;
}

/* BUTTON */

.xebn-alert__primary,
.xebn-alert__secondary {
  min-height: 50px;
  border-radius: 11px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.xebn-alert__primary {
  border: 1px solid var(--xebn-red);
  background: var(--xebn-red);
  color: #fff;
  box-shadow: 0 8px 18px rgba(174, 34, 45, .18);
}

.xebn-alert__primary:hover {
  border-color: var(--xebn-red-dark);
  background: var(--xebn-red-dark);
  color: #fff;
}

.xebn-alert__secondary {
  border: 1px solid #9fb2bf;
  background: #fff;
  color: var(--xebn-navy);
}

.xebn-alert__secondary:hover {
  background: var(--xebn-blue-soft);
}

.xebn-alert button:focus-visible {
  outline: 3px solid rgba(20, 81, 126, .25);
  outline-offset: 3px;
}

.xebn-alert button:disabled {
  opacity: .62;
  cursor: not-allowed;
}

/* THONG BAO */

.xebn-alert__message {
  margin: 20px clamp(22px, 5vw, 38px) 0;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
}

.xebn-alert__message.is-success {
  background: #ecf8f1;
  color: var(--xebn-green);
  border: 1px solid #b9dec9;
}

.xebn-alert__message.is-error {
  background: #fff0f1;
  color: #a51e29;
  border: 1px solid #efbdc1;
}

/* THANH TOAN QR */

.xebn-alert__payment-layout {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 42px);
  align-items: center;
}

.xebn-alert__qr-wrap {
  text-align: center;
}

.xebn-alert__qr-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
  margin: auto;
  object-fit: contain;
  border: 1px solid var(--xebn-line);
  border-radius: 15px;
  background: #f7fbfd;
}

.xebn-alert__qr-wrap p {
  margin: 9px 0 0;
  color: var(--xebn-amber);
  font-size: 12px;
  font-weight: 700;
}

.xebn-alert__success-mark {
  display: inline-block;
  border-radius: 999px;
  background: #eaf7ef;
  color: var(--xebn-green);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.xebn-alert__payment-info h3 {
  margin: 11px 0 9px;
  color: var(--xebn-navy);
  font-size: 25px;
  line-height: 1.2;
}

.xebn-alert__payment-info p {
  margin: 9px 0;
  color: #475a67;
}

.xebn-alert__payment-info dl {
  margin: 18px 0;
  border: 1px solid var(--xebn-line);
  border-radius: 12px;
  overflow: hidden;
}

.xebn-alert__payment-info dl div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  padding: 10px 12px;
}

.xebn-alert__payment-info dl div + div {
  border-top: 1px solid var(--xebn-line);
}

.xebn-alert__payment-info dt {
  color: var(--xebn-muted);
  font-size: 13px;
  font-weight: 700;
}

.xebn-alert__payment-info dd {
  margin: 0;
  color: var(--xebn-navy);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.xebn-alert__payment-warning {
  border-radius: 9px;
  background: #fff7e6;
  color: #664b13 !important;
  padding: 10px 12px;
  font-size: 13px;
}

.xebn-alert__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}

/* TRANG CAM ON */

.xebn-alert__thanks {
  text-align: center;
}

.xebn-alert__thanks-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: #eaf7ef;
  color: var(--xebn-green);
  font-size: 31px;
  font-weight: 900;
}

.xebn-alert__thanks h3 {
  margin: 0;
  color: var(--xebn-navy);
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.2;
}

.xebn-alert__thanks-message {
  max-width: 670px;
  margin: 12px auto 22px;
  color: #405561;
}

.xebn-alert__summary {
  margin: 0;
  border: 1px solid var(--xebn-line);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
}

.xebn-alert__summary div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 14px;
}

.xebn-alert__summary div + div {
  border-top: 1px solid var(--xebn-line);
}

.xebn-alert__summary dt {
  color: var(--xebn-muted);
  font-size: 14px;
  font-weight: 700;
}

.xebn-alert__summary dd {
  margin: 0;
  color: var(--xebn-navy);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.xebn-alert__thanks .xebn-alert__payment-warning {
  margin-top: 18px;
  text-align: left;
}

.xebn-alert [hidden] {
  display: none !important;
}

/* =========================================
   POPUP - DESKTOP
   ========================================= */

body.xebn-alert-popup-open {
  overflow: hidden !important;
}

.xebn-alert-popup,
.xebn-alert-popup * {
  box-sizing: border-box;
}

.xebn-alert-popup[hidden] {
  display: none !important;
}

.xebn-alert-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.xebn-alert-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 20, 33, .72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.xebn-alert-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 85px rgba(0, 0, 0, .3);
  animation: xebn-alert-popup-in .2s ease-out;
}

/* THANH TIEU DE POPUP */

.xebn-alert-popup__topbar {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid #d7e2e9;
  background: #fff;
  color: #08243d;
}

.xebn-alert-popup__topbar strong {
  font-size: 15px;
  line-height: 1.3;
}

/* NUT X DONG POPUP */

.xebn-alert-popup__close {
  position: relative !important;
  z-index: 11;
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #eef4f8 !important;
  color: #08243d !important;
  font: 700 28px/1 Arial, sans-serif !important;
  box-shadow: none !important;
  cursor: pointer;
}

.xebn-alert-popup__close:hover {
  background: #dfeaf1 !important;
}

.xebn-alert-popup__close:focus-visible {
  outline: 3px solid rgba(210, 52, 62, .3);
  outline-offset: 2px;
}

/* NOI DUNG CUON */

.xebn-alert-popup__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.xebn-alert-popup .xebn-alert {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* HIEU UNG MO POPUP */

@keyframes xebn-alert-popup-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================
   MOBILE - FIX HEADER CHE POPUP
   ========================================= */

@media (max-width: 680px) {

  .xebn-alert {
    border-radius: 17px;
  }

  .xebn-alert__grid,
  .xebn-alert__payment-layout {
    grid-template-columns: 1fr;
  }

  .xebn-alert__steps {
    gap: 7px;
  }

  .xebn-alert__steps i {
    min-width: 12px;
  }

  .xebn-alert__steps span {
    flex-direction: column;
    gap: 3px;
    text-align: center;
    font-size: 13px;
  }

  .xebn-alert__qr-wrap img {
    max-width: 330px;
  }

  .xebn-alert__actions {
    display: grid;
  }

  .xebn-alert__summary div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .xebn-alert__actions button,
  .xebn-alert__form > .xebn-alert__primary {
    width: 100%;
  }

  /* POPUP CAN GIUA MAN HINH */

  .xebn-alert-popup:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 12px !important;
    padding-top: max(12px, env(safe-area-inset-top)) !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  /* KHUNG POPUP */

  .xebn-alert-popup__dialog {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    background: #fff !important;
  }

  /* THANH TIEU DE KHONG BI CUON */

  .xebn-alert-popup__topbar {
    position: relative !important;
    z-index: 10 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 58px !important;
    padding: 8px 12px 8px 16px !important;
    background: #fff !important;
  }

  .xebn-alert-popup__topbar strong {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 8px;
    font-size: 14px;
    line-height: 1.4;
  }

  /* NUT X LUON HIEN THI */

  .xebn-alert-popup__close {
    position: relative !important;
    z-index: 11 !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    opacity: 1 !important;
    visibility: visible !important;
    touch-action: manipulation;
  }

  /* CHI CUON NOI DUNG FORM */

  .xebn-alert-popup__scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* PADDING FORM MOBILE */

  .xebn-alert-popup .xebn-alert__header,
  .xebn-alert-popup .xebn-alert__form,
  .xebn-alert-popup .xebn-alert__payment,
  .xebn-alert-popup .xebn-alert__thanks {
    padding: 16px;
  }

  .xebn-alert-popup .xebn-alert__steps {
    padding: 14px 16px;
  }
}

/* =========================================
   MOBILE MAN HINH THAP
   ========================================= */

@media (max-width: 680px) and (max-height: 600px) {

  .xebn-alert-popup:not([hidden]) {
    padding: 6px !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
  }

  .xebn-alert-popup__dialog {
    max-height: calc(100vh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
  }

  .xebn-alert-popup__topbar {
    min-height: 50px !important;
  }
}

/* TAT HIEU UNG NEU NGUOI DUNG YEU CAU */

@media (prefers-reduced-motion: reduce) {
  .xebn-alert *,
  .xebn-alert *::before,
  .xebn-alert *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .xebn-alert-popup__dialog {
    animation: none !important;
  }
}
