/* ====================================================================
   Popup thông báo HIỆN ĐẠI dùng chung cho trang auth/landing (login,
   register, quên mật khẩu, xem thử...). Rút từ custom.css (.swx) để các
   trang không load custom.css vẫn có 1 mẫu thông báo thống nhất.
   Gắn qua customClass của SweetAlert2 (xem swal_modern.js).
   ==================================================================== */

/* ---------- SweetAlert2 popup ---------- */
.swx.swal2-popup {
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .25), 0 8px 20px -8px rgba(15, 23, 42, .12);
  font-family: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.swx .swal2-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.swx .swal2-html-container {
  font-size: 14.5px;
  line-height: 1.6;
  color: #475569;
}
.swx .swal2-input,
.swx .swal2-textarea {
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  box-shadow: none;
  font-size: 14.5px;
}
.swx .swal2-input:focus,
.swx .swal2-textarea:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .22);
}

/* ---------- Actions / buttons ---------- */
.swx-actions { gap: 10px; margin-top: 18px; }
.swx-confirm,
.swx-cancel {
  border-radius: 12px !important;
  padding: 11px 24px !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.swx-confirm:focus,
.swx-cancel:focus { box-shadow: none !important; outline: none !important; }
.swx-confirm:hover { transform: translateY(-1px); filter: brightness(1.05); }
.swx-cancel {
  background: #f1f5f9 !important;
  color: #475569 !important;
}
.swx-cancel:hover { background: #e2e8f0 !important; transform: translateY(-1px); }

/* Màu nút confirm theo ngữ nghĩa (theo loại popup) */
.swx--success .swx-confirm { background: #16a34a !important; color: #fff !important; }
.swx--success .swx-confirm:hover { box-shadow: 0 10px 22px -8px rgba(22, 163, 74, .7) !important; }
.swx--error .swx-confirm { background: #dc2626 !important; color: #fff !important; }
.swx--error .swx-confirm:hover { box-shadow: 0 10px 22px -8px rgba(220, 38, 38, .7) !important; }
.swx--warning .swx-confirm { background: #f59e0b !important; color: #fff !important; }
.swx--warning .swx-confirm:hover { box-shadow: 0 10px 22px -8px rgba(245, 158, 11, .7) !important; }
.swx--info .swx-confirm { background: #2563eb !important; color: #fff !important; }
.swx--info .swx-confirm:hover { box-shadow: 0 10px 22px -8px rgba(37, 99, 235, .7) !important; }

/* Backdrop mờ + blur nhẹ */
.swal2-container.swal2-backdrop-show { background: rgba(15, 23, 42, .45); }
@supports ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .swal2-container.swal2-backdrop-show { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
}

/* ---------- Nút trong popup HTML (swalTimeOut: đếm ngược Tiếp tục/Bỏ qua) ---------- */
.swx .swal2-html-container .btn {
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  margin: 4px 5px 0;
  box-shadow: none;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.swx .swal2-html-container .btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.swx .swal2-html-container .btn:disabled { opacity: .6; cursor: not-allowed; }
.swx .swal2-html-container .btn-success { background: #16a34a; color: #fff; }
.swx .swal2-html-container .btn-danger { background: #f1f5f9; color: #475569; }
.swx .swal2-html-container .btn-danger:hover { background: #e2e8f0; }
body.dark_mode .swx .swal2-html-container .btn-danger { background: #2f2f3f; color: #cbd5e1; }

/* ====================================================================
   Modal auth (khôi phục mật khẩu, xác thực OTP) — bo mềm hiện đại
   ==================================================================== */
.modal-content {
  border: none;
  border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .25), 0 8px 20px -8px rgba(15, 23, 42, .12);
  overflow: hidden;
  font-family: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.modal-header {
  border-bottom: 1px solid #eef2f7;
  padding: 18px 24px;
  align-items: center;
}
.modal-title { font-size: 18px; font-weight: 700; color: #0f172a; }
.modal-header .close { opacity: .5; transition: opacity .15s ease; padding: 0; }
.modal-header .close:hover { opacity: 1; }
.modal-body { padding: 22px 24px; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { font-weight: 600; color: #334155; font-size: 13.5px; margin-bottom: 7px; display: block; }
.modal-body .form-control {
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  padding: 11px 14px;
  font-size: 14.5px;
  height: auto;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.modal-body .form-control:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .22);
}
.modal-footer {
  border-top: 1px solid #eef2f7;
  padding: 16px 24px;
  gap: 10px;
}
.modal-footer .btn {
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  box-shadow: none;
  margin: 0;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.modal-footer .btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.modal-footer .btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
}
.modal-footer .btn-secondary {
  background: #f1f5f9;
  color: #475569;
}
.modal-footer .btn-secondary:hover { background: #e2e8f0; }

/* ---------- Dark mode ---------- */
body.dark_mode .swx.swal2-popup { box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .6); }
body.dark_mode .swx .swal2-title { color: #f1f5f9 !important; }
body.dark_mode .swx .swal2-html-container { color: #cbd5e1; }
body.dark_mode .swx .swal2-input,
body.dark_mode .swx .swal2-textarea {
  background: #2b2b3c;
  border-color: #3a3a4d;
  color: #e2e8f0 !important;
}
body.dark_mode .swx-cancel { background: #2f2f3f !important; color: #cbd5e1 !important; }
body.dark_mode .swx-cancel:hover { background: #3a3a4d !important; }
