/* ==================== MODAL ĐĂNG NHẬP / ĐĂNG KÝ ==================== */

.auth-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:10000;
}

.auth-overlay.open{
  display:flex;
}

.auth-box{
  width:100%;
  max-width:430px;
  max-height:90vh;
  overflow-y:auto;
  background:var(--panel);
  color:var(--text);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(0,0,0,.35);
  padding:24px 28px 22px;
  position:relative;
}

.auth-close{
  position:absolute;
  top:14px;
  right:16px;
  width:32px;
  height:32px;
  border:0;
  background:none;
  color:var(--muted);
  font-size:22px;
  line-height:1;
  cursor:pointer;
  border-radius:50%;
  transition:.15s;
}

.auth-close:hover{
  background:var(--green-soft);
  color:var(--text);
}

.auth-title{
  margin:0;
  text-align:center;
  font-family:"Barlow Condensed",sans-serif;
  font-size:24px;
  font-weight:800;
  color:var(--text);
}

.auth-subtitle{
  margin:6px 0 16px;
  text-align:center;
  font-size:13.5px;
  color:var(--muted);
}

.auth-field{
  margin-bottom:12px;
}

.auth-field label{
  display:block;
  margin-bottom:7px;
  font-size:13px;
  font-weight:700;
  color:var(--text);
}

.auth-field label .req{
  color:#e5484d;
}

.auth-field input{
  width:100%;
  box-sizing:border-box;
  height:44px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--bg);
  color:var(--text);
  font:inherit;
  font-size:14px;
  outline:none;
  transition:.18s;
}

.auth-field input:focus{
  border-color:var(--green);
  box-shadow:0 0 0 3px var(--green-soft);
}

.auth-field input::placeholder{
  color:#9aa5b1;
}

.auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:-2px 0 14px;
  font-size:13px;
}

.auth-remember{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  cursor:pointer;
}

.auth-remember input{
  width:15px;
  height:15px;
  accent-color:var(--green);
  cursor:pointer;
}

.auth-forgot{
  color:var(--green-dark);
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
  background:none;
  border:0;
  font:inherit;
  padding:0;
}

.auth-forgot:hover{
  text-decoration:underline;
}

.auth-agree{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:-2px 0 14px;
  font-size:13px;
  color:var(--muted);
  cursor:pointer;
}

.auth-agree input{
  width:15px;
  height:15px;
  margin-top:1px;
  accent-color:var(--green);
  cursor:pointer;
  flex-shrink:0;
}

.auth-agree a{
  color:var(--green-dark);
  font-weight:600;
  text-decoration:none;
}

.auth-agree a:hover{
  text-decoration:underline;
}

.auth-error{
  min-height:16px;
  margin:-8px 0 12px;
  font-size:12.5px;
  color:#e5484d;
  text-align:center;
}

.auth-submit{
  width:100%;
  height:46px;
  border:0;
  border-radius:9px;
  background:var(--green);
  color:#fff;
  font:inherit;
  font-size:15px;
  font-weight:800;
  cursor:pointer;
  transition:.18s;
}

.auth-submit:hover{
  background:var(--green-dark);
}

.auth-submit:disabled{
  opacity:.6;
  cursor:wait;
}

.auth-divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin:16px 0 14px;
  color:var(--muted);
  font-size:12.5px;
}

.auth-divider::before,
.auth-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--line);
}

.auth-social{
  display:flex;
  gap:10px;
  margin-bottom:16px;
}

.auth-social-btn{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:44px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  font-size:13.5px;
  font-weight:600;
  cursor:pointer;
  transition:.18s;
}

.auth-social-btn:hover{
  border-color:var(--green);
  background:var(--green-soft);
}

.auth-social-btn svg{
  flex-shrink:0;
}

.auth-switch{
  margin:0;
  text-align:center;
  font-size:13.5px;
  color:var(--muted);
}

.auth-switch button{
  background:none;
  border:0;
  padding:0;
  font:inherit;
  font-weight:700;
  color:var(--green-dark);
  cursor:pointer;
}

.auth-switch button:hover{
  text-decoration:underline;
}

@media (max-width:480px){
  .auth-box{
    padding:24px 20px 22px;
  }
}

/* ==================== DARK MODE ==================== */

html[data-theme="dark"] .auth-box{
  background:var(--panel);
  box-shadow:0 24px 60px rgba(0,0,0,.6);
}

html[data-theme="dark"] .auth-field input{
  background:var(--surface-2);
  border-color:var(--line);
  color:var(--text);
}

html[data-theme="dark"] .auth-field input::placeholder{
  color:#64748b;
}

html[data-theme="dark"] .auth-social-btn{
  background:var(--surface-2);
  border-color:var(--line);
  color:var(--text);
}

html[data-theme="dark"] .auth-social-btn:hover{
  background:var(--surface-hover);
  border-color:var(--green);
}

/* ==================== ĐĂNG NHẬP BẰNG QR ==================== */

.auth-qr-box{
  position:relative;
  width:200px;
  height:200px;
  margin:0 auto 16px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background:#fff;
  box-sizing:content-box;
}

.auth-qr-box img{
  width:200px;
  height:200px;
  display:block;
}

.auth-qr-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:12px;
  background:rgba(255,255,255,.92);
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  color:var(--text);
}

.auth-qr-hint{
  margin:0 0 6px;
  text-align:center;
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
}

.auth-qr-timer{
  margin:0 0 18px;
  text-align:center;
  font-size:12px;
  color:var(--green-dark);
  font-weight:700;
}

.auth-qr-cancel{
  display:block;
  width:100%;
  border:0;
  background:none;
  color:var(--muted);
  font:inherit;
  font-size:13px;
  font-weight:600;
  text-align:center;
  cursor:pointer;
  padding:8px 0 0;
}

.auth-qr-cancel:hover{
  color:var(--green-dark);
  text-decoration:underline;
}

html[data-theme="dark"] .auth-qr-box{
  background:#fff;
}

html[data-theme="dark"] .auth-qr-overlay{
  background:rgba(23,32,51,.92);
  color:var(--text);
}

/* ==================== TRẠNG THÁI ĐÃ ĐĂNG NHẬP (dropdown + login-strip) ==================== */

.acc-dropdown [data-el="userBox"] .acc-guest-title{
  word-break:break-word;
}

.acc-dropdown [data-el="userBox"] .acc-login-btn{
  background:transparent;
  border:1px solid #e5484d;
  color:#e5484d;
  margin-bottom:0;
}

.acc-dropdown [data-el="userBox"] .acc-login-btn:hover{
  background:rgba(229,72,77,.08);
}
