:root {
  --ig-blue: #0095F6;
  --ig-blue-dim: rgba(0, 149, 246, 0.4);
  --ig-blue-deep: #0064E0;           /* 创建新账户按钮、深蓝链接 */
  --ig-text: rgb(17, 17, 18);
  --ig-text-soft: #737373;
  --ig-text-link: #00376b;
  --ig-border: #dbdbdb;
  --ig-bg: #ffffff;
  --ig-divider: rgb(223, 226, 229);
  --ig-pill-shadow: rgb(208, 211, 214);
  --ig-grad: linear-gradient(to right, #ff5c00, #ff0069, #d300c5);
  --ff-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ff-ui: "Optimistic", "Segoe UI Historic", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ig-bg);
  color: var(--ig-text);
  font: 15px/18px var(--ff-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ====== 主区域：左右分栏 ====== */
.page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 88px);
  width: 100%;
  position: relative;
}

/* 中间垂直分隔线 —— 官方 2px 浅灰 */
.page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgb(223, 226, 229);
  transform: translateX(-1px);
  pointer-events: none;
}

/* ====== 左侧品牌区 ====== */
.brand {
  position: relative;
  padding: 28px 40px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-logo {
  align-self: flex-start;
  display: inline-block;
  margin-bottom: 10px;
}

.logo-img {
  display: block;
  width: 77px;
  height: 77px;
  background-image: url("assets/logo.webp");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 78px 122px;
}

.brand-headline {
  margin: 36px auto 28px;
  max-width: 540px;
  /* 官方：Instagram Sans Regular 39.9px / 64.8px line-height / weight 400 */
  font-family: "Instagram Sans", "Optimistic Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 39.9px;
  line-height: 64.8px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ig-text);
}

.grad {
  background: var(--ig-grad);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-art {
  margin: 0 auto;
  max-width: 632px;
}

.brand-art img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ====== 右侧表单区 ====== */
.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  max-width: 546px;
  display: flex;
  flex-direction: column;
}

.auth-title {
  margin: 0 0 26px;
  font-family: var(--ff-ui);
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  color: var(--ig-text);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ====== 字段：圆角药丸 + 浮动 label ====== */
/* 官方：背景 rgba(255,255,255,.2) + inset box-shadow 提供边框感 */
.field {
  position: relative;
  display: block;
  height: 61px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid transparent;
  box-shadow: inset 0 0 0 1px rgb(208, 211, 214);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.field:focus-within {
  border-color: var(--ig-blue);
  background: #fff;
  box-shadow: none;
}

.field input {
  width: 100%;
  height: 100%;
  padding: 24px 16px 6px;
  font-family: var(--ff-ui);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ig-text);
}

.field input::placeholder { color: transparent; }

/* 官方：label 在两种状态都是 15px / 500 / rgb(102,106,114)，只 transform 不变字号 */
.field-label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(102, 106, 114);
  font-family: var(--ff-ui);
  font-size: 15px;
  font-weight: 500;
  pointer-events: none;
  transition: transform .15s ease, top .15s ease;
  transform-origin: left center;
}

.field:focus-within .field-label,
.field:not([data-empty="true"]) .field-label {
  top: 12px;
  transform: translateY(0) scale(0.78);
  /* 颜色保持 rgb(102,106,114)，weight/字号不变 */
}

.reveal {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ig-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reveal:hover { opacity: .7; }
.reveal[hidden] { display: none; }

/* ====== 主按钮（登录）====== */
.btn-primary {
  margin-top: 8px;
  height: 48px;
  border-radius: 999px;
  border: 0;
  background: var(--ig-blue);
  color: #fff;
  font-family: var(--ff-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 19px;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}

.btn-primary:disabled {
  background: var(--ig-blue-dim);
  cursor: default;
}

.btn-primary:not(:disabled):hover { background: #0086e0; }

/* ====== 次要按钮：FB / 创建新账户 ====== */
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 999px;
  font-family: var(--ff-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 19px;
  cursor: pointer;
  user-select: none;
}

.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--ig-border);
  color: var(--ig-text);
}

.btn-secondary:hover { background: #fafafa; }

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--ig-blue-deep);
  color: var(--ig-blue-deep);
}

.btn-outline:hover { background: rgba(0, 100, 224, 0.05); }

.link-muted {
  align-self: center;
  margin: 20px 0 0;
  font-family: var(--ff-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 19px;
  color: var(--ig-text);
}

.link-muted:hover { color: var(--ig-text-link); }

.auth-gap { height: 40px; }

.fb { margin-bottom: 12px; }

.meta-mark {
  margin: 32px auto 0;
  display: flex;
  justify-content: center;
}

/* ====== 底部水平分隔线（官方 HR rgb(223,226,229) 1px） ====== */
.page-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--ig-divider);
}

/* ====== Footer ====== */
.page-footer {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--ig-text-soft);
  font: 13px/16px var(--ff-body);
  font-weight: 400;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 1200px;
}

.links a {
  color: var(--ig-text-soft);
  font-size: 13px;
  line-height: 16px;
}

.links a:hover { text-decoration: underline; }

.locale {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  line-height: 16px;
}

.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ig-text-soft);
  cursor: pointer;
}

.lang-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.lang-text { font-size: 13px; line-height: 16px; }
.lang-caret { color: var(--ig-text-soft); }

.copy { color: var(--ig-text-soft); font-size: 13px; line-height: 16px; }

/* ====== 响应式：窄屏堆叠 ====== */
@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
  }
  .brand {
    padding: 20px 20px 0;
  }
  .brand-headline {
    font-size: 28px;
  }
  .auth { padding: 20px; }
}

@media (max-width: 600px) {
  .brand-art { max-width: 90%; }
}
