/*
 * 文件作用：
 * pmgr-mobile-auth.php 前台 /my-account/ 注入的 Tab 切换 UI 样式。
 * 仅在 ipetmed 站、仅在 my-account 页加载。
 *
 * 视觉策略：
 *   - 与 ipetmed 红色主题（#C8102E）品牌色一致
 *   - Tab 切换风格类似商品详情页 Tab（活动 Tab 下有红色横条）
 *   - 表单字段使用 WC 原生 woocommerce-Input 样式作底，仅做微调
 */

/* 外层容器 */
.pmgr-ma-wrap {
  margin-bottom: 28px;
  background: #ffffff;
  border: 1px solid #e5e6ea;
  border-radius: 10px;
  overflow: hidden;
}

/* 顶层 Tab（手机号 / 邮箱） */
.pmgr-ma-tabs {
  display: flex;
  border-bottom: 1px solid #e5e6ea;
  background: #f9fafb;
}

.pmgr-ma-tab {
  flex: 1;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #5a5a60;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.pmgr-ma-tab:hover {
  color: var(--pmgr-red, #C8102E);
}

.pmgr-ma-tab.is-active {
  color: var(--pmgr-red, #C8102E);
  background: #ffffff;
  border-bottom-color: var(--pmgr-red, #C8102E);
}

/* Tab 面板 */
.pmgr-ma-panel {
  padding: 24px 24px 12px;
  display: none;
}

.pmgr-ma-panel.is-active {
  display: block;
}

/* 子 Tab（密码登录 / 短信验证码） */
.pmgr-ma-subtabs {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 8px;
}

.pmgr-ma-subtab {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #5a5a60;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.pmgr-ma-subtab.is-active {
  color: #ffffff;
  background: var(--pmgr-red, #C8102E);
}

/* 表单 */
.pmgr-ma-form {
  display: block;
}

.pmgr-ma-h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  color: #1a1a1d;
}

.pmgr-ma-field {
  margin-bottom: 14px;
}

.pmgr-ma-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3f;
  margin-bottom: 6px;
}

.pmgr-ma-field label .required {
  color: var(--pmgr-red, #C8102E);
}

.pmgr-ma-field input[type="tel"],
.pmgr-ma-field input[type="text"],
.pmgr-ma-field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: #1a1a1d;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pmgr-ma-field input:focus {
  outline: none;
  border-color: var(--pmgr-red, #C8102E);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

/* 验证码行：输入框 + 发送按钮并排 */
.pmgr-ma-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pmgr-ma-code-row input {
  flex: 1;
  min-width: 0;
}

.pmgr-ma-send-code {
  flex: 0 0 auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pmgr-red, #C8102E);
  background: #ffffff;
  border: 1px solid var(--pmgr-red, #C8102E);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.pmgr-ma-send-code:hover:not(:disabled) {
  color: #ffffff;
  background: var(--pmgr-red, #C8102E);
}

.pmgr-ma-send-code:disabled {
  color: #9a9a9f;
  border-color: #d1d5db;
  background: #f3f4f6;
  cursor: not-allowed;
}

/* 操作行：提交按钮 + 辅助链接 */
.pmgr-ma-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pmgr-ma-submit {
  padding: 10px 28px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: var(--pmgr-red, #C8102E) !important;
  border: 0 !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: background 0.15s;
}

.pmgr-ma-submit:hover {
  background: var(--pmgr-red-hover, #E13349) !important;
}

.pmgr-ma-link-toggle {
  font-size: 13px;
  color: #5a5a60;
  text-decoration: none;
}

.pmgr-ma-link-toggle:hover {
  color: var(--pmgr-red, #C8102E);
  text-decoration: underline;
}

/* 状态消息 */
.pmgr-ma-msg {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 18px;
}

.pmgr-ma-msg.is-error {
  color: #b91c1c;
}

.pmgr-ma-msg.is-success {
  color: #047857;
}

/* 邮箱面板提示 */
.pmgr-ma-email-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: #5a5a60;
}

/* ── 图形验证码（CAPTCHA，2026-05-25 第二阶段）── */
.pmgr-ma-captcha-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pmgr-ma-captcha-row input[type="text"] {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
}

.pmgr-ma-captcha-img {
  flex: 0 0 120px;
  width: 120px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  background: #f5f6f8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='40'><text x='50%25' y='55%25' text-anchor='middle' fill='%239ca3af' font-size='11' font-family='sans-serif'>加载中…</text></svg>") center no-repeat;
  transition: opacity 0.15s;
}

.pmgr-ma-captcha-img:hover {
  opacity: 0.8;
}

/* ── 微信扫码按钮区（pmgr-wechat-login 插件渲染）── */
.pmgr-wx-section {
  padding: 20px 24px 22px;
  border-top: 1px solid #f3f4f6;
}

.pmgr-wx-divider {
  text-align: center;
  font-size: 12px;
  color: #9a9a9f;
  position: relative;
  margin-bottom: 14px;
}

.pmgr-wx-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e6ea;
  z-index: 0;
}

.pmgr-wx-divider span {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  background: #ffffff;
}

.pmgr-wx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #07c160;     /* 微信绿 */
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.pmgr-wx-btn:hover {
  background: #06ad56;
  color: #ffffff;
}

.pmgr-wx-btn.is-disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.7;
}

.pmgr-wx-icon {
  width: 20px;
  height: 20px;
}

/* ── 账户安全页 /my-account/security/（第三阶段 2026-05-25 新增）── */
.pmgr-sec-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pmgr-sec-card {
  background: #ffffff;
  border: 1px solid #e5e6ea;
  border-radius: 10px;
  padding: 22px 24px;
}

.pmgr-sec-h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1d;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--pmgr-red, #C8102E);
  display: inline-block;
}

.pmgr-sec-current {
  margin: 0 0 16px;
  font-size: 14px;
  color: #3a3a3f;
}

.pmgr-sec-field {
  margin-bottom: 14px;
}

.pmgr-sec-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3f;
  margin-bottom: 6px;
}

.pmgr-sec-field label .required {
  color: var(--pmgr-red, #C8102E);
}

.pmgr-sec-field input[type="tel"],
.pmgr-sec-field input[type="text"],
.pmgr-sec-field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: #1a1a1d;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pmgr-sec-field input:focus {
  outline: none;
  border-color: var(--pmgr-red, #C8102E);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.pmgr-sec-actions {
  margin: 16px 0 6px;
}

.pmgr-sec-submit {
  padding: 10px 28px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: var(--pmgr-red, #C8102E) !important;
  border: 0 !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: background 0.15s;
}

.pmgr-sec-submit:hover {
  background: var(--pmgr-red-hover, #E13349) !important;
}

.pmgr-sec-msg {
  margin: 10px 0 0;
  font-size: 13px;
  min-height: 18px;
}

.pmgr-sec-msg.is-error {
  color: #b91c1c;
}

.pmgr-sec-msg.is-success {
  color: #047857;
}

/* 微信绑定卡片 */
.pmgr-wx-bound {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pmgr-wx-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #f3f4f6;
}

.pmgr-wx-bound-info strong {
  color: #047857;
}

.pmgr-wx-unbind-btn {
  padding: 8px 18px;
  font-size: 13px;
  color: var(--pmgr-red, #C8102E);
  background: #ffffff;
  border: 1px solid var(--pmgr-red, #C8102E);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.pmgr-wx-unbind-btn:hover {
  color: #ffffff;
  background: var(--pmgr-red, #C8102E);
}

/* 响应式 */
@media (max-width: 639px) {
  .pmgr-ma-panel {
    padding: 18px 16px 8px;
  }
  .pmgr-ma-tab {
    padding: 12px 8px;
    font-size: 14px;
  }
  .pmgr-ma-actions {
    gap: 10px;
  }
  .pmgr-ma-submit {
    padding: 9px 20px !important;
  }
  .pmgr-ma-captcha-img {
    flex: 0 0 100px;
    width: 100px;
  }
  .pmgr-wx-section {
    padding: 16px 16px 18px;
  }
  .pmgr-sec-card {
    padding: 18px 16px;
  }
}
