/* ============================================================
   灵当 CRM × WorkBuddy 授权页样式
   视觉语言对齐设计示例：gray-50 背景 + 白色 rounded-2xl 卡片 +
   极淡阴影 + blue-600 主色 + 胶囊 Tab + 蓝色提示框 + 绿勾徽章。
   自包含，无 Tailwind / 图标字体等外部依赖。
   注意：所有类名与 id 与 index.html 保持一致，JS 依赖
   is-hidden / is-active / is-emphasis 三个状态类做局部刷新。
   ============================================================ */

:root {
  --page-bg: #f3f4f6;      /* gray-100：最外层页面底色 */
  --panel-bg: #f9fafb;     /* gray-50：右侧表单区底色 */
  --card: #ffffff;
  --card-border: #f3f4f6;  /* gray-100：卡片淡边框 */
  --ink: #333333;          /* 主标题 / 选中 Tab */
  --text: #374151;         /* gray-700：正文 */
  --muted: #666666;        /* 副标题 / 说明 / 页脚链接 */
  --faint: #C8C9CC;        /* 占位符 / 禁用态 */
  --line: #e5e7eb;         /* gray-200：输入框边框 */
  --chip: #f3f4f6;         /* gray-100：Tab 容器底色 */

  --blue: #3B7CFF;         /* 品牌蓝：主按钮 / 链接 */
  --blue-hover: #3B7CFF;   /* 品牌蓝 */
  --focus: #3B7CFF;        /* 品牌蓝：聚焦环 */
  --link: #3B7CFF;

  --tip-bg: #eff6ff;       /* blue-50 */
  --tip-border: #dbeafe;   /* blue-100 */
  --tip-ink: #3B7CFF;      /* 品牌蓝：提示框文字 */

  --err-bg: #fef2f2;
  --err-ink: #b91c1c;

  --green: #22c55e;        /* green-500：成功对勾 */
  --green-bg: #dcfce7;     /* green-100：成功徽章底 */

  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--focus);
  text-decoration: underline;
}

/* ============ 整体布局：左品牌图 32% + 右表单区占剩余宽度 ============ */
.layout {
  display: grid;
  grid-template-columns: 32% minmax(0, 1fr);
  min-height: 100vh;
}

.promo {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--tip-bg);
}

.promo-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.auth {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--panel-bg);
}

.hotline {
  position: absolute;
  top: 24px;
  right: 24px;
  margin: 0;
  font-size: 14px;
  color: #666666;
}

.hotline-link {
  color: #3B7CFF;
  text-decoration: none;
}

.hotline-link:hover {
  text-decoration: underline;
}

.hotline-divider {
  margin: 0 8px;
  color: #d1d5db;
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 28px;
}

/* ============ 卡片 ============ */
.card {
  width: min(100%, 440px);
  padding: 40px 40px 32px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  /* 视图切换（display 由 none 变可见）时重放入场动画 */
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--ink);
}

.card-desc {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: #333333;
}

/* ============ 错误 / 提示条 ============ */
.form-error {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--err-bg);
  color: var(--err-ink);
  font-size: 13px;
  text-align: center;
}

.form-hint {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  color: var(--tip-ink);
  font-size: 13px;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

/* ============ 胶囊 Tab ============ */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 10px;
  background: var(--chip);
}

.tab {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============ 表单字段 ============ */
.panel {
  display: grid;
  gap: 14px;
}

.panel.is-hidden {
  display: none;
}

.field {
  position: relative;
  display: block;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: var(--faint);
}

.field input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--focus);
}

/* 企业选择下拉：与输入框同一套外观 */
.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field select:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--focus);
}

.field select:disabled {
  background-color: #f9fafb;
  color: #4b5563;
  cursor: default;
}

/* 字段下方的一行说明（登录页企业锁定提示等）：小圆点前缀 */
.field-note {
  margin: 0;
  padding: 0 2px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.field-note::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: #3B7CFF;
  vertical-align: middle;
}

/* 输入框右侧的眼睛 / 获取验证码按钮 */
.eye,
.code-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.eye {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--faint);
}

.code-btn {
  right: 0;
  height: 30px;
  padding: 0 14px;
  border-left: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.code-btn:hover {
  color: var(--blue-hover);
}

.code-btn:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.field--code input {
  padding-right: 108px;
}

.row-end {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 16px;
}

.link-muted {
  color: var(--muted);
  font-size: 13px;
}

/* ============ 主按钮 ============ */
.submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.15s ease;
}

.submit:hover {
  background: var(--blue-hover);
}

.submit:active {
  transform: translateY(1px);
}

.submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.legal {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.legal a {
  color: var(--blue);
}

.register {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.register a {
  font-weight: 600;
}

/* 手机号未注册时把注册入口强调出来 */
.register.is-emphasis {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  color: var(--tip-ink);
}

/* ============ 注册卡片 ============ */
.card--signup {
  width: min(100%, 440px);
}

.card--signup .card-desc {
  margin-bottom: 22px;
}

/* 注册页字段是 form 的直接子元素（不像登录页包在 .panel 里），单独给间距 */
.card--signup > .field {
  margin-bottom: 14px;
}

/* 注册页底部说明做成示例那样的蓝色提示框（带对勾图标） */
.card--signup > .field-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  color: var(--tip-ink);
  font-size: 12.5px;
  line-height: 1.6;
}

.card--signup > .field-note::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  border-radius: 50%;
  background: var(--focus)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
}

.card--signup > #signup-oauth-fields {
  display: none;
}

/* ============ 页脚：返回提示 / 语言 / 版权 ============ */
.return-hint {
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.meta-links a,
.lang {
  color: var(--muted);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lang:hover {
  color: var(--text);
}

.lang::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23666666' stroke-width='1.6'/%3E%3Cellipse cx='12' cy='12' rx='4.2' ry='9' stroke='%23666666' stroke-width='1.6'/%3E%3Cpath d='M3 12h18M4.6 7.5h14.8M4.6 16.5h14.8' stroke='%23666666' stroke-width='1.6'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
}

.dot {
  color: #d1d5db;
}

.footer {
  margin: 0 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: #9CA3AF;
}

.footer a {
  color: #9CA3AF;
}

/* ============ 状态卡片：注册中 / 连接成功 ============ */
.card--status {
  text-align: center;
}

.card--status h1 {
  margin: 4px 0 10px;
  font-size: 22px;
}

.card--status .card-desc {
  margin-bottom: 0;
}

.card--status .submit {
  margin-top: 28px;
}

/* 开户等待的转圈 */
.spinner {
  width: 44px;
  height: 44px;
  margin: 8px auto 20px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 连接成功的对勾徽标：浅绿圆底 + 绿色对勾（对齐示例风格） */
.success-badge {
  width: 64px;
  height: 64px;
  margin: 8px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-bg);
  animation: pop 0.32s ease-out;
}

/* 成功视图的账户详情列表 */
.success-details {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  text-align: left;
}

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.detail-row + .detail-row {
  border-top: 1px solid var(--line);
}

.detail-label {
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 12px;
}

.detail-value {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============ 响应式：窄屏隐藏品牌图，单栏居中 ============ */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .promo {
    display: none;
  }

  .hotline {
    position: static;
    text-align: right;
    padding: 16px 20px 0;
  }

  .auth-main {
    padding: 32px 18px 24px;
  }

  .card {
    width: 100%;
    padding: 30px 22px 24px;
  }
}
