/* ============================================================
   LaixePro Shared Auth Modal & Toast (Light + Dark Mode)
   ============================================================ */
#lx-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#lx-auth-modal[hidden] {
  display: none !important;
}

.lx-auth-dialog {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: lxAuthFadeIn 0.16s ease-out;
}

html.dark .lx-auth-dialog {
  background: #1e2433;
  color: #f1f5f9;
  border-color: #334155;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

@keyframes lxAuthFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lx-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
}

.lx-auth-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.lx-auth-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

html.dark .lx-auth-sub {
  color: #94a3b8;
}

.lx-auth-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lx-auth-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

html.dark .lx-auth-close {
  background: #2b3346;
  color: #cbd5e1;
}

html.dark .lx-auth-close:hover {
  background: #374158;
  color: #ffffff;
}

.lx-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 22px 16px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f5f9;
}

html.dark .lx-auth-tabs {
  background: #141925;
}

.lx-auth-tab {
  border: none;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lx-auth-tab.is-active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

html.dark .lx-auth-tab {
  color: #94a3b8;
}

html.dark .lx-auth-tab.is-active {
  background: #283145;
  color: #34d399;
}

.lx-auth-body {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.lx-auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lx-auth-field[hidden] {
  display: none !important;
}

.lx-auth-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

html.dark .lx-auth-field label {
  color: #cbd5e1;
}

.lx-auth-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.lx-auth-input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

html.dark .lx-auth-input {
  border-color: #3b465c;
  background: #141925;
  color: #f8fafc;
}

html.dark .lx-auth-input:focus {
  border-color: #34d399;
  background: #192030;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.lx-auth-merge-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 12.5px;
  line-height: 1.45;
  cursor: pointer;
}

.lx-auth-merge-box[hidden] {
  display: none !important;
}

.lx-auth-merge-box input {
  margin-top: 2px;
  accent-color: #059669;
  cursor: pointer;
}

html.dark .lx-auth-merge-box {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
}

.lx-auth-err {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

/* LX-080: giu san cho cho dong bao loi, de khi no hien ra thi KHONG co gi xe dich.
   Truoc day dong loi chen vao giua o mat khau va nut gui => nut tut xuong 24px
   (do duoc: y=518 -> y=542), nguoi dung bam lai dung cho cu la trung dong chu loi.
   Chuyen no xuong duoi nut thi hop thoai lai dich LEN 24px vi hop can giua man.
   Nen o day giu nguyen cho bang visibility thay vi display: cao luon khong doi. */
.lx-auth-err[hidden] {
  display: block !important;
  visibility: hidden;
}

.lx-auth-err {
  min-height: 36px;
  box-sizing: border-box;
}

html.dark .lx-auth-err {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.lx-auth-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.lx-auth-submit:hover:not(:disabled) {
  opacity: 0.94;
}

.lx-auth-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.lx-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lx-auth-guest-note {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

html.dark .lx-auth-guest-note {
  color: #94a3b8;
}

#lx-auth-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  z-index: 2147483500;
  padding: 10px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#lx-auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html.dark #lx-auth-toast {
  background: #10b981;
  color: #06281e;
}

/* LX-097: o ma lop + thong bao dai (2 dong) */
.lx-auth-opt { font-weight: 500; color: #64748b; }
#lx-auth-lop { text-transform: uppercase; letter-spacing: .04em; }
#lx-auth-lop::placeholder { text-transform: none; letter-spacing: 0; }
#lx-auth-toast { max-width: min(92vw, 460px); text-align: center; line-height: 1.4; border-radius: 16px; }
