/* ==========================================================================
   লগইন সিস্টেম — popup + logged-in user menu
   ========================================================================== */

/* ---------- Popup shell ---------- */
.dn-auth { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dn-auth[hidden] { display: none; }
.dn-auth-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 16, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s ease; }
.dn-auth-dialog {
	position: relative; width: 100%; max-width: 400px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	display: flex; flex-direction: column; background: #fff; border-radius: 20px; outline: none;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .04);
	opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .18s ease, transform .22s cubic-bezier(.2, .9, .3, 1.2);
	font-family: var(--dn-font-body); color: var(--dn-text);
}
.dn-auth.is-open .dn-auth-backdrop { opacity: 1; }
.dn-auth.is-open .dn-auth-dialog { opacity: 1; transform: none; }
.dn-auth-dialog { overflow: hidden; isolation: isolate; }
.dn-auth-dialog::before { content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--dn-accent), #ff5a5f); pointer-events: none; }
.dn-auth-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 28px 20px; scrollbar-width: thin; }
.dn-auth-x { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f3f5; color: #444; cursor: pointer; transition: all .15s ease; }
.dn-auth-x:hover { background: #111; color: #fff; transform: rotate(90deg); }

/* ---------- Brand + title ---------- */
.dn-auth-logo { display: flex; justify-content: center; margin: 2px 0 8px; line-height: 0; }
.dn-auth-logo img { width: auto; height: auto; max-height: 44px; max-width: 200px; }
.dn-auth-logo .dn-logo-text { font-size: 30px; line-height: 1.2; font-weight: 700; color: var(--dn-text); }
.dn-auth-title { margin: 0 0 16px; text-align: center; font-family: var(--dn-font-body); font-size: 16px; font-weight: 400; color: var(--dn-muted); }

/* ---------- Tabs (segmented) ---------- */
.dn-auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 16px; background: #f2f3f5; border-radius: 12px; }
.dn-auth-tabs[hidden] { display: none; }
.dn-auth-tabs button { position: relative; z-index: 1; height: 38px; border: 0; background: none; border-radius: 9px; font: inherit; font-size: 15.5px; color: #666; cursor: pointer; transition: color .2s; }
.dn-auth-tabs button.is-active { color: var(--dn-text); font-weight: 600; }
.dn-auth-tabs-ink { position: absolute; top: 4px; left: 0; height: 38px; border-radius: 9px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); transition: transform .25s cubic-bezier(.3, .8, .3, 1), width .25s; }

/* ---------- Messages ---------- */
.dn-auth-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.55; }
.dn-auth-msg--err { background: #fff1f1; color: #a40d12; border: 1px solid #ffd3d5; }
.dn-auth-msg--ok { background: #ebf8f1; color: #13724a; border: 1px solid #c4ebd6; }
.dn-auth-msg--info { background: #eef4ff; color: #1d4f9c; border: 1px solid #d3e2ff; }

/* ---------- Views ---------- */
.dn-auth-view[hidden] { display: none; }
.dn-auth-view.is-active { animation: dnAuthIn .22s ease; }
@keyframes dnAuthIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dn-auth-lead { margin: 0 0 14px; font-size: 14.5px; line-height: 1.65; color: var(--dn-text-2); text-align: center; }

/* Social */
.dn-auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dn-auth-social:has(> :only-child) { grid-template-columns: 1fr; }
.dn-auth-sbtn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 12px; border: 1.5px solid #e2e4e8; border-radius: 12px; background: #fff; font: inherit; font-size: 15px; font-family: Arial, Helvetica, sans-serif; color: #222; text-decoration: none; cursor: pointer; transition: all .15s ease; }
.dn-auth-sbtn:hover { border-color: #c9ccd2; background: #f8f9fb; color: #111; transform: translateY(-1px); }
.dn-auth-sbtn svg { flex: none; }
.dn-auth-sc { grid-column: 1 / -1; text-align: center; }
.dn-auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; font-size: 13px; color: #8a8f98; }
.dn-auth-or::before, .dn-auth-or::after { content: ""; flex: 1; height: 1px; background: #e7e8eb; }

/* Fields */
.dn-auth-field { display: block; margin-bottom: 12px; }
.dn-auth-field > span:first-child { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 600; color: var(--dn-text-2); }
.dn-auth-field input { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid #e2e4e8; border-radius: 12px; background: #fafbfc; font: inherit; font-size: 16px; color: var(--dn-text); transition: border-color .15s, box-shadow .15s, background .15s; }
.dn-auth-field input:focus { outline: none; border-color: var(--dn-accent); background: #fff; box-shadow: 0 0 0 4px rgba(209, 10, 17, .09); }
.dn-auth-field.is-invalid input { border-color: #e0383e; background: #fffafa; }
.dn-auth-pw { position: relative; display: block; }
.dn-auth-pw input { padding-right: 46px; }
.dn-auth-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: #8a8f98; cursor: pointer; }
.dn-auth-eye:hover { color: var(--dn-text); background: #f0f1f3; }
.dn-auth-eye .i-hide, .dn-auth-eye.is-on .i-show { display: none; }
.dn-auth-eye.is-on .i-hide { display: block; }
.dn-auth-meter { display: block; margin-top: 7px; }
.dn-auth-meter i { position: relative; display: block; height: 4px; border-radius: 4px; background: #eceef1; overflow: hidden; }
.dn-auth-meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: #e0383e; transition: width .25s, background .25s; }
.dn-auth-meter[data-level="1"] i::after { width: 20%; }
.dn-auth-meter[data-level="2"] i::after { width: 45%; background: #f08c00; }
.dn-auth-meter[data-level="3"] i::after { width: 72%; background: #2f9e44; }
.dn-auth-meter[data-level="4"] i::after { width: 100%; background: #13824a; }
.dn-auth-meter em { display: block; margin-top: 5px; font-style: normal; font-size: 12.5px; color: #8a8f98; }
.dn-auth-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.dn-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 16px; }
.dn-auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dn-text-2); cursor: pointer; }
.dn-auth-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--dn-accent); }
.dn-auth-link { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--dn-accent); cursor: pointer; }
.dn-auth-link:hover { text-decoration: underline; }

.dn-auth-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; border: 0; border-radius: 12px; background: var(--dn-accent); color: #fff; font: inherit; font-size: 16.5px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 22px rgba(209, 10, 17, .25); transition: all .18s ease; }
.dn-auth-submit:hover { background: #b0080e; transform: translateY(-1px); }
.dn-auth-submit:disabled { cursor: progress; transform: none; }
.dn-auth-submit--ghost { background: #111; box-shadow: none; }
.dn-auth-submit--ghost:hover { background: #333; }
.dn-auth-spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: dnAuthSpin .7s linear infinite; }
.is-busy .dn-auth-spin { display: inline-block; }
.dn-auth-submit.is-done { background: #13824a; box-shadow: none; }
@keyframes dnAuthSpin { to { transform: rotate(360deg); } }
.dn-auth-switch { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--dn-muted); }

.dn-auth-sent { text-align: center; padding: 6px 0 2px; }
.dn-auth-sent-ic { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: #ebf8f1; color: #13824a; animation: dnAuthPop .35s ease; }
@keyframes dnAuthPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.dn-auth-sent p { margin: 14px 0 18px; font-size: 15px; line-height: 1.7; color: var(--dn-text-2); }

.dn-auth-legal { margin: 18px -4px 0; padding-top: 14px; border-top: 1px solid #eeeff1; text-align: center; font-size: 12.5px; line-height: 1.7; color: #8a8f98; }
.dn-auth-legal a { color: var(--dn-text-2); text-decoration: underline; text-underline-offset: 2px; }
.dn-auth-legal a:hover { color: var(--dn-accent); }

@media (max-width: 480px) {
	.dn-auth { padding: 12px; }
	.dn-auth-dialog { border-radius: 18px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
	.dn-auth-scroll { padding: 22px 18px 16px; }
	.dn-auth-logo img { max-height: 38px; }
	.dn-auth-logo .dn-logo-text { font-size: 26px; }
	.dn-auth-title { font-size: 15px; margin-bottom: 14px; }
	.dn-auth-sbtn { height: 42px; font-size: 14px; }
	.dn-auth-field input { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
	.dn-auth-dialog, .dn-auth-backdrop, .dn-auth-view.is-active { transition: none; animation: none; }
}

/* ---------- Logged-in user menu ---------- */
.dn-user { position: relative; display: flex; align-items: stretch; }
.dn-user-btn { gap: 8px !important; border: 0; background: none; font: inherit; cursor: pointer; }
.dn-user-av { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--dn-accent); color: #fff; font-size: 14px; line-height: 1; }
.dn-user-head .dn-user-av { font-size: 19px; }
.dn-user-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dn-user-btn > span:not(.dn-user-av) { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-user-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 1200; width: 250px; padding: 8px; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .05); animation: dnAuthIn .15s ease; }
.dn-user-pop[hidden] { display: none; }
.dn-user-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid #eee; }
.dn-user-head div { min-width: 0; }
.dn-user-head strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-user-head small { display: block; font-size: 12.5px; color: var(--dn-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-user-pop a { display: block; padding: 9px 10px; border-radius: 9px; font-size: 15px; color: var(--dn-text); }
.dn-user-pop a:hover { background: #f4f5f7; color: var(--dn-text); }
.dn-user-pop .dn-user-out { color: var(--dn-accent); }
.dn-user--mob .dn-user-btn > span:not(.dn-user-av) { display: none; }
.dn-user--mega .dn-user-pop { left: 0; right: auto; }
.dn-user-count { float: right; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #f2f3f5; font-style: normal; font-size: 12px; text-align: center; line-height: 20px; color: var(--dn-muted); }
