/* 基础样式 */
:root {
  --primary-color: #0078d4;
  --primary-hover: #106ebe;
  --text-color: #323130;
  --text-secondary: #605e5c;
  --background-color: #faf9f8;
  --card-background: #ffffff;
  --border-color: #edebe9;
  --input-background: #f3f2f1;
  --input-focus: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --error-color: #a4262c;
  --success-color: #107c10;

  --border-radius: 4px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;

  --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

/* 卡片样式 */
.auth-card {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow-large);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.5rem 0.5rem;
  text-align: center;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 标签页样式 */
.tabs {
  display: flex;
  position: relative;
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 1rem 0;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--transition-normal);
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: transform var(--transition-normal), width var(--transition-normal);
  z-index: 2;
}

.tab-content {
  position: relative;
  overflow: hidden;
}

.tab-pane {
  padding: 1.5rem 1.5rem 0 1.5rem ;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* 内部标签页样式 */
.inner-tabs {
  margin-top: 1rem;
}

.inner-tab-buttons {
  display: flex;
  position: relative;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.inner-tab-btn {
  flex: 1;
  padding: 0.75rem 0;
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--transition-normal);
}

.inner-tab-btn.active {
  color: var(--primary-color);
  font-weight: 500;
}

.inner-tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: transform var(--transition-normal), width var(--transition-normal);
  z-index: 2;
}

.inner-tab-pane {
  display: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.inner-tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* 表单样式 */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--input-background);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow
    var(--transition-fast);
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input {
  flex: 1;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 复选框样式 */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background-color: var(--input-background);
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-wrapper label {
  font-size: 0.875rem;
  font-weight: normal;
  cursor: pointer;
}

/* 按钮样式 */
.btn {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-outline:hover {
  background-color: var(--input-background);
}

.btn-block {
  width: 100%;
}

/* 链接样式 */
.link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.link:hover {
  text-decoration: underline;
}

/* 找回密码步骤 */
.recovery-steps {
  position: relative;
}

.recovery-step {
  display: none;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.recovery-step.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.back-btn:hover {
  color: var(--primary-color);
}

/* 图标 */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.icon-user {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
}

.icon-lock {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>');
}

.icon-eye {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
  left: -12px !important;
}

.icon-eye-off {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
  left: -12px !important;
}

.icon-mail {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>');
}

.icon-smartphone {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line></svg>');
}

.icon-arrow-left {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23605E5C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>');
}

/* 响应式设计 */
@media (max-width: 480px) {
  .auth-card {
    box-shadow: none;
    border-radius: 0;
  }

  .container {
    padding: 0;
  }

  .tab-btn,
  .inner-tab-btn {
    font-size: 0.8125rem;
  }

  .input-group {
    flex-direction: column;
  }

  .get-code-btn {
    width: 100%;
  }
}

