/* =========================================================
 * 账户认证页 - 主样式
 * 视觉语言：金融控制台 / 私人航司值机柜台
 * ========================================================= */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 背景 */
  --bg-from: #F5F7FA;
  --bg-to: #EEF2F7;

  /* 卡片与表面 */
  --surface: #FFFFFF;

  /* 品牌主蓝 */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-press: #1E40AF;

  /* 文字层级 */
  --text: #1F2937;
  --muted: #6B7280;
  --hint: #9CA3AF;
  --text-soft: #374151;

  /* 描边 */
  --border: #E5E7EB;
  --border-focus: var(--primary);

  /* 图标 */
  --icon-default: #9CA3AF;
  --icon-gold: #F59E0B;

  /* Tab 容器底色 */
  --tab-track: #F3F4F6;

  /* 错误态 */
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --danger-text: #B91C1C;
  --danger-border: #FCA5A5;

  /* 成功态 */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-text: #047857;
  --success-border: #6EE7B7;

  /* 圆角 */
  --radius-card: 16px;
  --radius-input: 12px;
  --radius-btn: 12px;
  --radius-tab: 10px;
  --radius-tips: 12px;

  /* 阴影（极弱） */
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04),
                 0 1px 2px rgba(15, 23, 42, 0.03);

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* 缓动 */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--text);
  background:
    linear-gradient(180deg, var(--bg-from) 0%, var(--bg-to) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

input {
  border: 0;
  outline: 0;
  background: transparent;
}

/* ---------- 页面骨架 ---------- */
.page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 56px;
}

/* ---------- 顶部工具栏 ---------- */
.toolbar {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.back-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border-radius: 8px;
  transition: background-color 150ms var(--ease-standard);
}

.back-btn:hover {
  background: rgba(15, 23, 42, 0.05);
}

.back-btn:active {
  background: rgba(15, 23, 42, 0.08);
}

.toolbar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- 主卡片 ---------- */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px 24px 28px;
}

.card-header {
  margin-bottom: 24px;
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
}

.card-subtitle {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Tab 切换 ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--tab-track);
  border-radius: var(--radius-tab);
  padding: 4px;
  margin-bottom: 24px;
  gap: 0;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    color 200ms var(--ease-standard),
    background-color 200ms var(--ease-standard),
    box-shadow 200ms var(--ease-standard);
}

.tab:hover:not(.tab--active) {
  color: var(--text);
}

.tab--active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.18);
}

/* ---------- 表单 ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 14px;
  height: 48px;
  transition: border-color 180ms var(--ease-standard);
  cursor: text;
}

.field:focus-within {
  border-color: var(--border-focus);
}

.field__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-default);
  margin-right: 10px;
  flex-shrink: 0;
  transition: color 180ms var(--ease-standard);
}

.field__icon--gold {
  color: var(--icon-gold);
}

.field:focus-within .field__icon {
  color: var(--icon-default);
}

.field:focus-within .field__icon--gold {
  color: var(--icon-gold);
}

.field__input {
  flex: 1;
  height: 100%;
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}

.field__input::placeholder {
  color: var(--muted);
  font-size: 15px;
}

.field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---------- 提交按钮 ---------- */
.submit {
  appearance: none;
  border: 0;
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  margin-top: 12px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background-color 150ms var(--ease-standard),
    transform 80ms var(--ease-standard),
    box-shadow 150ms var(--ease-standard);
}

.submit:hover:not(:disabled) {
  background: var(--primary-hover);
}

.submit:active:not(:disabled) {
  background: var(--primary-press);
  transform: translateY(1px);
}

.submit:disabled {
  cursor: not-allowed;
  opacity: 0.92;
}

.submit__text {
  display: inline-block;
  transition: opacity 150ms var(--ease-standard);
}

.submit__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #FFFFFF;
  display: none;
  flex-shrink: 0;
}

.submit--loading .submit__spinner {
  display: inline-block;
  animation: submit-spin 0.8s linear infinite;
}

@keyframes submit-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 提交结果状态条（成功 / 错误） ---------- */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 220ms var(--ease-standard),
    transform 220ms var(--ease-standard),
    max-height 220ms var(--ease-standard),
    margin-top 220ms var(--ease-standard),
    padding 220ms var(--ease-standard),
    background-color 180ms var(--ease-standard),
    border-color 180ms var(--ease-standard),
    color 180ms var(--ease-standard);
}

.status--visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 56px;
  margin-top: 10px;
  padding: 9px 12px;
}

.status--success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.status--error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* ---------- 底部安全提示卡 ---------- */
.tips {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
  background: var(--surface);
  border-radius: var(--radius-tips);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  transition:
    opacity 250ms var(--ease-standard),
    transform 250ms var(--ease-standard),
    max-height 250ms var(--ease-standard),
    padding 250ms var(--ease-standard),
    margin 250ms var(--ease-standard),
    border-color 250ms var(--ease-standard);
}

.tips--visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  margin-top: 14px;
  padding: 14px 16px;
  border-color: var(--border);
}

.tips:not(.tips--visible) {
  opacity: 0;
  transform: translateY(4px);
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

.tips__line {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.tips__hl {
  color: var(--text-soft);
  font-weight: 500;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .page {
    padding: 20px 16px 40px;
  }

  .card {
    padding: 28px 20px 24px;
  }

  .card-title {
    font-size: 22px;
  }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
