/* === AtlasAI 登录页 — Apple 风格 === */

:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-light: #e8f0fe;
  --dark: #1d1d1f;
  --gray-100: #f5f5f7;
  --gray-200: #e8e8ed;
  --gray-300: #d2d2d7;
  --gray-500: #86868b;
  --gray-600: #6e6e73;
  --white: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--dark);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
input, button { font: inherit; }

/* ===== Header ===== */
.auth-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.auth-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--dark);
}

.auth-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}
.back-link:hover { text-decoration: underline; }

/* ===== Main ===== */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ===== Tabs ===== */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--gray-200);
}

.auth-tab {
  height: 50px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.auth-tab:hover:not(.active) {
  color: var(--dark);
  background: var(--gray-100);
}

/* ===== Forms ===== */
.auth-form {
  display: none;
  padding: 32px 28px 28px;
}

.auth-form.active { display: block; }

.auth-form h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin: 8px 0 24px;
  color: var(--gray-600);
  font-size: 14px;
}

.auth-field { margin-bottom: 18px; }

.auth-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--dark);
  font-size: 15px;
  background: var(--gray-100);
  transition: all 0.15s;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
  background: var(--white);
}

.auth-field input::placeholder { color: var(--gray-500); }

.auth-submit {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 980px;
  color: var(--white);
  background: var(--blue);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-submit:hover { background: var(--blue-hover); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-error {
  margin: 10px 0 0;
  color: #dc2626;
  font-size: 13px;
  min-height: 20px;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--gray-600);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

/* ===== Success ===== */
.auth-success {
  display: none;
  padding: 48px 28px;
  text-align: center;
}
.auth-success[hidden] { display: none; }
.auth-success:not([hidden]) { display: block; }

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
}

.auth-success h2 { margin: 0; font-size: 20px; }
.auth-success p {
  margin: 8px 0 24px;
  color: var(--gray-600);
  font-size: 14px;
}

/* ===== 语言切换器 ===== */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 980px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--blue); color: var(--blue); }
.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 10;
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  color: var(--dark);
}
.lang-option:hover { background: var(--gray-100); }
.lang-option.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .auth-form { padding: 24px 18px 20px; }
}
