/* ==========================================================================
   Noverexa Shop — Account & Auth Dialog (Vercel / Supabase Design)
   ========================================================================== */

/* 登录/注册对话框居中与遮罩 */
#account-dialog,
#pwd-prompt-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  color: var(--text-zinc-100, #f4f4f5);
  background: #18181b; /* zinc-900 */
  border: 1px solid #27272a; /* zinc-800 */
  border-radius: 12px;
  width: min(440px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

#account-dialog::backdrop,
#pwd-prompt-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#account-dialog[open],
#pwd-prompt-dialog[open] {
  display: flex;
  flex-direction: column;
}

#account-dialog [hidden] {
  display: none !important;
}

/* 顶部标题栏 */
.account-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #27272a;
}

.panel-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a; /* zinc-500 */
  display: block;
  margin-bottom: 4px;
}

#account-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-close {
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: #ffffff;
}

/* 描述文本 */
.account-muted {
  color: #a1a1aa;
  line-height: 1.5;
}

.account-small {
  font-size: 13px;
}

/* 表单与输入框排版（严格垂直流式 Stack） */
#account-dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #d4d4d8; /* zinc-300 */
  margin-bottom: 2px;
  display: block;
}

.form-input {
  width: 100%;
  background: #09090b; /* zinc-950 */
  border: 1px solid #27272a; /* zinc-800 */
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: #71717a;
}

.form-input::placeholder {
  color: #52525b;
}

/* 图形验证码容器 */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-svg-wrapper {
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 6px;
  min-width: 120px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.captcha-svg-wrapper svg {
  display: block;
  width: 120px;
  height: 40px;
}

.captcha-refresh-hint {
  font-size: 12px;
  color: #a1a1aa;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.captcha-refresh-hint:hover {
  color: #ffffff;
}

/* 邮箱验证码组合行 */
.account-code-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.account-code-row > div {
  flex: 1;
}

.account-secondary {
  background: #27272a;
  border: 1px solid #3f3f46;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.account-secondary:hover:not(:disabled) {
  background: #3f3f46;
}

.account-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 记住会话选项行 */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #a1a1aa;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #ffffff;
  cursor: pointer;
}

/* 登录/注册主操作按钮 (Vercel 白色反色按钮) */
#account-dialog .action-button,
#pwd-prompt-dialog .action-button {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

#account-dialog .action-button:hover:not(:disabled),
#pwd-prompt-dialog .action-button:hover:not(:disabled) {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

#account-dialog .action-button:disabled,
#pwd-prompt-dialog .action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 底部切换提示 */
.auth-switch-text {
  font-size: 13px;
  text-align: center;
  color: #71717a;
  margin-top: 4px;
}

.auth-switch-text a {
  color: #ffffff;
  text-decoration: underline;
  cursor: pointer;
}

/* 消息提示框 */
#account-message {
  margin: 12px 0 0;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}

#account-message:not(:empty) {
  display: block;
}

.account-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.account-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* 会员已登录面板 */
.account-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* 导航栏状态 */
html.is-user-logged-in #account-btn-login,
html.is-user-logged-in #account-btn-register {
  display: none !important;
}

html.is-user-logged-in #account-entry {
  display: inline-flex !important;
}
