/* ============================================
   188米营销平台 - 认证页公共样式（火焰橙营销风）
   登录 / 注册 / 忘记密码 共用
   JS 契约：.auth-form / .form-group(.focused) / .btn-auth / .btn-send-code / .alert-auth / #page-error
   ============================================ */

/* 认证页内容区居中（导航已是白色毛玻璃，不再覆盖） */
body:has(.auth-page) { background: var(--cream); }

/* --- 页面容器（火焰渐变背景） --- */
.auth-page {
  min-height: calc(100vh - 68px - 220px);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px 48px;
  background: var(--grad-flame);
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: ''; position: absolute; inset: 0; background:
    radial-gradient(ellipse 70% 50% at 12% 18%, rgba(255,182,39,.5), transparent 55%),
    radial-gradient(ellipse 60% 70% at 88% 88%, rgba(230,57,70,.45), transparent 55%);
  pointer-events: none;
}
.auth-page::after {
  content: ''; position: absolute; inset: 0; background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 75%);
  pointer-events: none;
}

/* --- 卡片 --- */
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px;
  background: var(--card); border-radius: 20px;
  padding: 44px 38px;
  box-shadow: 0 30px 80px rgba(26,15,10,.22), 0 8px 24px rgba(230,57,70,.15);
  border: 1px solid rgba(255,255,255,.6);
}
.auth-card--wide { max-width: 480px; padding: 42px 36px; }

/* --- Logo 区域 --- */
.auth-card .logo-area { text-align: center; margin-bottom: 28px; }
.auth-card .logo-area .logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--grad-flame);
  border-radius: 16px; color: #fff; font-size: 22px; font-weight: 800;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(255,77,46,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-card .logo-area h2 {
  color: var(--ink); font-size: 26px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.5px;
}
.auth-card .logo-area p { color: var(--ink-3); font-size: 14px; font-weight: 500; }

/* --- 表单 --- */
.auth-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.auth-form .form-group { margin-bottom: 16px; transition: all .2s; }
/* JS 契约：.focused 加在 input 父元素 .form-group 上 */
.auth-form .form-group.focused label { color: var(--or-d); }

.auth-form label {
  display: block; color: var(--ink-2); font-size: 13px; font-weight: 700;
  margin-bottom: 8px; transition: color .2s;
}
.auth-form label .required { color: #ef4444; font-weight: 800; margin-left: 2px; }

.auth-form input {
  width: 100%; padding: 13px 16px;
  background: var(--cream); border: 1.5px solid var(--line); border-radius: 11px;
  color: var(--ink); font-size: 14px; outline: none; transition: all .25s; font-weight: 500;
}
.auth-form input::placeholder { color: var(--ink-4); font-weight: 400; }
.auth-form input:focus {
  border-color: rgba(255,107,26,.4); box-shadow: 0 0 0 4px rgba(255,107,26,.1); background: #fff;
}
.form-group.focused input { border-color: rgba(255,107,26,.4); }

/* --- 错误提示 --- */
.auth-form .error-msg {
  display: flex; align-items: center; gap: 6px;
  color: #ef4444; font-size: 12px; margin-top: 7px; padding-left: 2px; line-height: 1.4; font-weight: 600;
}
.auth-form .error-msg::before {
  content: '!'; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; background: rgba(239,68,68,.1); border-radius: 50%;
  font-size: 10px; font-weight: 800; flex-shrink: 0; color: #ef4444;
}

.auth-form .form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.auth-form .form-options label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 0; user-select: none;
}
.auth-form .form-options label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; border: 1.5px solid var(--line-2); border-radius: 5px;
  background: #fff; cursor: pointer; position: relative; transition: all .2s; padding: 0; flex-shrink: 0;
}
.auth-form .form-options label input[type="checkbox"]:hover { border-color: var(--or); background: var(--surf); }
.auth-form .form-options label input[type="checkbox"]:checked { background: var(--grad-flame); border-color: transparent; }
.auth-form .form-options label input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.auth-form .form-options a { color: var(--or-d); font-size: 13px; font-weight: 700; }
.auth-form .form-options a:hover { color: var(--flame); }

/* --- 提交按钮（火焰渐变） --- */
.btn-auth {
  width: 100%; padding: 15px;
  background: var(--grad-flame); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer; transition: all .25s;
  box-shadow: 0 8px 24px rgba(255,77,46,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255,77,46,.45), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-auth:active { transform: translateY(0); }

/* --- 验证码按钮 --- */
.btn-code, .btn-send-code {
  flex-shrink: 0; padding: 13px 18px;
  background: var(--surf-2); border: 1.5px solid rgba(255,107,26,.2); border-radius: 11px;
  color: var(--or-d); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: all .25s; width: auto;
}
.btn-code:hover:not(:disabled), .btn-send-code:hover:not(:disabled) { background: var(--surf); border-color: var(--or); color: var(--flame); }
.btn-code:disabled, .btn-send-code:disabled { opacity: .5; cursor: not-allowed; }

/* 邮箱+验证码按钮行 */
.form-group .code-row { display: flex; gap: 10px; align-items: flex-start; }
.form-group .code-row input { flex: 1; }

/* --- 分割线 --- */
.auth-divider {
  display: flex; align-items: center; gap: 14px; margin: 24px 0;
  color: var(--ink-4); font-size: 12px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --- 底部链接 --- */
.auth-footer { text-align: center; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.auth-footer a { color: var(--or-d); font-weight: 700; }
.auth-footer a:hover { color: var(--flame); }

/* --- 提示信息 --- */
.alert-auth { padding: 12px 16px; border-radius: 11px; font-size: 13px; margin-bottom: 18px; line-height: 1.5; font-weight: 600; }
.alert-auth.success { background: rgba(22,163,74,.1); color: #059669; border: 1px solid rgba(22,163,74,.2); }
.alert-auth.error { background: rgba(239,68,68,.08); color: #dc2626; border: 1px solid rgba(239,68,68,.2); }

.form-tips {
  margin-top: 18px; padding: 14px 16px;
  background: var(--surf); border: 1px solid rgba(255,107,26,.15); border-radius: 11px;
  font-size: 12px; color: var(--ink-2); line-height: 1.75; font-weight: 500;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .auth-page { padding: 40px 16px 32px; }
  .auth-card--wide, .auth-card { padding: 32px 22px; }
  .auth-card .logo-area h2 { font-size: 22px; }
  .form-group .code-row { flex-direction: column; }
  .form-group .code-row input { width: 100%; }
  .form-group .code-row button.btn-send-code { width: 100%; justify-content: center; }
  .auth-form .form-options { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 480px) {
  .auth-form .form-row { grid-template-columns: 1fr; }
  .auth-card--wide, .auth-card { padding: 24px 16px; }
  .auth-card .logo-area h2 { font-size: 20px; }
  .auth-card .logo-area p { font-size: 13px; }
  .auth-form input { padding: 12px 14px; font-size: 13px; }
  .btn-auth { padding: 14px; font-size: 14px; }
}
