/* ================= DANG NHAP: HIEU UNG DONG TRONG KHUNG ================= */
@property --goc { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.dn_khung { transition: transform .35s ease-out; animation: dn_hien .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes dn_hien { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
.dn_the > *:not(.dn_hieu_ung):not(.dn_vien) { position: relative; z-index: 2; }
.dn_the { overflow: hidden; --mx: 50%; --my: 0%; }

/* vien sang chay vong quanh khung */
.dn_vien { position: absolute; inset: 0; z-index: 3; pointer-events: none; padding: 1.6px;
  background: conic-gradient(from var(--goc), transparent 0 62%, rgba(110, 175, 255, .9) 82%, #fff 90%, rgba(110, 175, 255, .9) 94%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: dn_goc 6s linear infinite; }
@keyframes dn_goc { to { --goc: 360deg; } }

/* lop hieu ung ben trong */
.dn_hieu_ung { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.dn_hieu_ung .orb { position: absolute; border-radius: 50%; filter: blur(38px); opacity: .55; mix-blend-mode: screen; }
.dn_hieu_ung .o1 { width: 210px; height: 210px; background: #1f6bff; top: -70px; left: -60px; animation: dn_troi1 11s ease-in-out infinite alternate; }
.dn_hieu_ung .o2 { width: 190px; height: 190px; background: #35c1ff; right: -70px; top: 38%; opacity: .38; animation: dn_troi2 13s ease-in-out infinite alternate; }
.dn_hieu_ung .o3 { width: 170px; height: 170px; background: #5b4dff; bottom: -70px; left: 22%; opacity: .4; animation: dn_troi3 15s ease-in-out infinite alternate; }
@keyframes dn_troi1 { to { transform: translate(110px, 150px) scale(1.25); } }
@keyframes dn_troi2 { to { transform: translate(-120px, -110px) scale(.8); } }
@keyframes dn_troi3 { to { transform: translate(120px, -90px) scale(1.2); } }
/* dai sang quet cheo */
.dn_hieu_ung .quet { position: absolute; top: -20%; bottom: -20%; width: 38%; left: -60%; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .13), rgba(160, 205, 255, .22), transparent); animation: dn_quet 6.5s ease-in-out infinite; }
@keyframes dn_quet { 0%, 55% { left: -60%; } 100% { left: 130%; } }
/* den pha theo chuot */
.dn_hieu_ung .den { position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx) var(--my), rgba(120, 180, 255, .22), transparent 70%); }
/* hat sang bay len */
.dn_hieu_ung .hat { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: #bfe0ff; box-shadow: 0 0 10px 2px rgba(120, 185, 255, .9); opacity: 0; animation: dn_bay 9s linear infinite; }
.dn_hieu_ung .h1 { left: 8%; animation-delay: 0s; } .dn_hieu_ung .h2 { left: 21%; animation-delay: 2.2s; width: 3px; height: 3px; }
.dn_hieu_ung .h3 { left: 35%; animation-delay: 4.6s; } .dn_hieu_ung .h4 { left: 49%; animation-delay: 1.1s; width: 3px; height: 3px; }
.dn_hieu_ung .h5 { left: 63%; animation-delay: 5.8s; } .dn_hieu_ung .h6 { left: 76%; animation-delay: 3.3s; width: 5px; height: 5px; }
.dn_hieu_ung .h7 { left: 88%; animation-delay: 7s; } .dn_hieu_ung .h8 { left: 94%; animation-delay: .6s; width: 3px; height: 3px; }
@keyframes dn_bay { 0% { transform: translateY(0) translateX(0); opacity: 0; } 12% { opacity: .9; } 85% { opacity: .5; } 100% { transform: translateY(-560px) translateX(26px); opacity: 0; } }

/* bieu tuong co vong sang giong mau tham khao */
.dn_bieu_tuong { position: relative; width: 74px; height: 74px; margin: -6px auto 14px; display: grid; place-items: center; }
.dn_bieu_tuong img { width: 40px; height: 40px; object-fit: contain; z-index: 2; filter: drop-shadow(0 0 12px rgba(80, 160, 255, .9)); animation: dn_noi 4s ease-in-out infinite; }
.dn_bieu_tuong .vong { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(120, 180, 255, .55); box-shadow: 0 0 22px rgba(60, 140, 255, .55), inset 0 0 18px rgba(60, 140, 255, .3); animation: dn_vong 3.2s ease-out infinite; }
.dn_bieu_tuong .v2 { animation-delay: 1.6s; }
@keyframes dn_vong { 0% { transform: scale(.55); opacity: .95; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes dn_noi { 50% { transform: translateY(-3px) scale(1.06); } }
.dn_the h2, .dn_the .dn_phu { text-align: center; }

/* vao lan luot */
.dn_vao { animation: dn_len .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.25s + var(--i, 0) * 70ms); }
@keyframes dn_len { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* o nhap: sang len khi focus */
.dn_truong { transition: transform .2s; }
.dn_truong:focus-within { transform: translateY(-1px); }
.dn_truong:focus-within > svg { stroke: #fff; filter: drop-shadow(0 0 6px rgba(120, 180, 255, .9)); }
.dn_truong input { transition: border-color .25s, box-shadow .25s, background .25s; }
.dn_truong input:focus { background: rgba(6, 18, 48, .78); animation: dn_tho 2.6s ease-in-out infinite; }
@keyframes dn_tho { 50% { box-shadow: 0 0 0 5px rgba(60, 140, 255, .18), 0 0 22px rgba(60, 140, 255, .45), inset 0 2px 8px rgba(0, 0, 0, .35); } }

/* nut: anh sang chay qua */
.dn_nut { position: relative; overflow: hidden; }
.dn_nut::after { content: ""; position: absolute; top: 0; bottom: 0; width: 46%; left: -60%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: dn_nut_sang 3.8s ease-in-out infinite; }
@keyframes dn_nut_sang { 0%, 45% { left: -60%; } 100% { left: 130%; } }
.dn_nut:active { transform: translateY(0) scale(.99); }

@media (max-width: 768px) { .dn_hieu_ung .orb { filter: blur(30px); } .dn_bieu_tuong { width: 62px; height: 62px; } }

/* ===== loi: khung rung ===== */
.dn_khung.dn_rung { animation: dn_rung .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes dn_rung { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.dn_nut.dang_tai { pointer-events: none; opacity: .85; }
.dn_nut.dang_tai::before { content: ""; display: inline-block; width: 15px; height: 15px; margin-right: 9px; vertical-align: -2px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: dn_quay .7s linear infinite; }
@keyframes dn_quay { to { transform: rotate(360deg); } }

/* ===== dang nhap dung: khung cuon lai -> diem sang -> huc sang ===== */
.dn_khung.dn_cuon { animation: dn_cuon_lai 1.05s cubic-bezier(.7, 0, .3, 1) forwards; pointer-events: none; }
.dn_khung.dn_cuon .dn_the > *:not(.dn_hieu_ung):not(.dn_vien) { opacity: 0 !important; transition: opacity .3s; animation: none; }
.dn_khung.dn_cuon .dn_the { box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .9), inset 0 0 60px rgba(120, 180, 255, .55); }
@keyframes dn_cuon_lai {
  0%   { transform: scale(1, 1);        filter: drop-shadow(0 0 26px rgba(31, 107, 255, .45)) drop-shadow(0 30px 44px rgba(0, 0, 0, .55)) brightness(1); }
  22%  { transform: scale(1.02, .92);   filter: drop-shadow(0 0 40px rgba(80, 160, 255, .8)) brightness(1.15); }
  55%  { transform: scale(.98, .035);   filter: drop-shadow(0 0 46px rgba(140, 200, 255, 1)) brightness(2.2); }
  85%  { transform: scale(.05, .035);   filter: drop-shadow(0 0 60px rgba(200, 230, 255, 1)) brightness(3); opacity: 1; }
  100% { transform: scale(.02, .02);    filter: drop-shadow(0 0 70px rgba(220, 240, 255, 1)) brightness(3); opacity: 0; }
}
.dn_trang .logo_goc, .dn_trang .chuyen_ngon_ngu { transition: opacity .5s; }
body:has(.dn_cuon) .dn_trang .logo_goc, body:has(.dn_cuon) .dn_trang .chuyen_ngon_ngu { opacity: 0; }

.dn_cham { position: fixed; z-index: 50; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.3);
  background: radial-gradient(circle, #fff 0 35%, #bfe0ff 55%, rgba(80, 160, 255, 0) 72%); box-shadow: 0 0 30px 12px rgba(120, 185, 255, .9), 0 0 90px 30px rgba(60, 140, 255, .7); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.dn_cham.hien { opacity: 1; transform: scale(1.5); animation: dn_cham_xung .35s ease-in-out infinite alternate; }
@keyframes dn_cham_xung { to { transform: scale(2.1); } }

.dn_bung { position: fixed; z-index: 60; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(0);
  background: radial-gradient(circle, #fff 0 38%, #d8ecff 46%, #8cc4ff 60%, #2f7bff 80%, #0a2a8a 100%); box-shadow: 0 0 60px 20px rgba(150, 200, 255, .9); }
.dn_bung.no { opacity: 1; transform: scale(var(--s, 100)); transition: transform .7s cubic-bezier(.5, 0, .2, 1), opacity .15s; }

/* ===== trang dich: sang tan ra, noi dung hien dan ===== */
@media (max-width: 768px) { .dn_cham { width: 16px; height: 16px; margin: -8px 0 0 -8px; } }

/* logo lon hon, nen trong suot */
.dn_bieu_tuong { width: 124px; height: 112px; margin: -10px auto 8px; }
.dn_bieu_tuong img { width: 92px; height: auto; max-height: 92px; filter: drop-shadow(0 0 16px rgba(80, 160, 255, .95)) drop-shadow(0 0 4px rgba(150, 205, 255, .8)); }
.dn_bieu_tuong .vong { inset: 4px 14px; border-radius: 50%; }
@media (max-width: 768px) { .dn_bieu_tuong { width: 104px; height: 96px; } .dn_bieu_tuong img { width: 76px; } }
/* huc sang trang: vong no cuoi cung la trang tinh */
.dn_bung { background: radial-gradient(circle, #fff 0 62%, #f2f8ff 74%, #d6e9ff 88%, #a9d0ff 100%); box-shadow: 0 0 80px 30px rgba(255, 255, 255, .95); }
