:root {
  color-scheme: light;
  --auth-black: #151515;
  --auth-red: #c91f26;
  --auth-red-dark: #a9161c;
  --auth-paper: #f5f5f3;
  --auth-line: #dededb;
  --auth-muted: #737373;
  --auth-white: #fff;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--auth-paper); }
body.personal-auth-page {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-paper);
  color: var(--auth-black);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.auth-shell {
  width: min(1080px, calc(100% - 48px));
  min-height: 700px;
  margin: max(32px, 6vh) auto;
  display: grid;
  grid-template-columns: minmax(350px, .82fr) minmax(520px, 1.18fr);
  overflow: hidden;
  border: 1px solid #d4d4d1;
  border-radius: 26px;
  background: var(--auth-white);
}

.auth-brand {
  position: relative;
  min-width: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--auth-black);
  color: #fff;
}
.auth-brand__top, .auth-mobile-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}
.auth-brand__top { position: relative; z-index: 1; font-size: 17px; }
.auth-brand__top img, .auth-mobile-brand img {
  display: block;
  object-fit: cover;
  border-radius: 13px;
}
.auth-brand__top img { width: 54px; height: 54px; }
.auth-brand__copy { position: relative; z-index: 1; margin: auto 0 50px; }
.auth-brand h1 {
  margin: 0;
  font-size: clamp(40px, 4vw, 58px);
  line-height: 1.1;
  letter-spacing: -.05em;
}

.auth-panel {
  min-width: 0;
  padding: 52px 62px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}
.auth-mobile-brand { display: none; }
.auth-panel__header h2 {
  margin: 10px 0 8px;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -.04em;
}
.auth-panel__header p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-tabs {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--auth-line);
}
.auth-tab {
  position: relative;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -1px;
  height: 3px;
  background: var(--auth-red);
  transition: left .18s ease, right .18s ease;
}
.auth-tab.is-active { color: var(--auth-black); }
.auth-tab.is-active::after { left: 13%; right: 13%; }

.auth-panels { min-height: 248px; padding-top: 26px; }
.auth-form-panel:not(.is-active) { display: none; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 8px; min-width: 0; }
.auth-form label > span:first-child {
  color: #4b4b4b;
  font-size: 13px;
  font-weight: 700;
}
.auth-form input {
  width: 100%;
  height: 50px;
  min-width: 0;
  padding: 0 15px;
  border: 1px solid var(--auth-line);
  border-radius: 11px;
  outline: none;
  background: #fafafa;
  color: var(--auth-black);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-form input::placeholder { color: #a7a7a7; }
.auth-form input:focus {
  border-color: var(--auth-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201,31,38,.1);
}
.auth-form__row { display: grid; grid-template-columns: .75fr 1.25fr; gap: 12px; }
.auth-form__assist {
  min-height: 18px;
  margin-top: -8px;
  display: flex;
  justify-content: flex-end;
}
.auth-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-red);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.auth-text-button:hover { color: var(--auth-red-dark); text-decoration: underline; }
.auth-text-button--center { justify-self: center; margin-top: -3px; }
.auth-reset-back {
  width: fit-content;
  margin-bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #4c4c4c;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.auth-reset-back__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--auth-line);
  border-radius: 50%;
  background: #fff;
  color: var(--auth-black);
  font-size: 18px;
}
.auth-reset-back:hover { color: var(--auth-red); }
.auth-reset-back:hover .auth-reset-back__icon { border-color: var(--auth-red); color: var(--auth-red); }
.auth-panel--reset { justify-content: center; }
.auth-panel--reset .auth-panel__header { margin-bottom: 30px; }
.auth-reset-stage[hidden], .auth-reset-success[hidden] { display: none; }
.auth-reset-success {
  padding: 24px;
  border: 1px solid #cfe4da;
  border-radius: 14px;
  background: #f3f9f6;
  text-align: center;
}
.auth-reset-success h3 { margin: 0 0 8px; font-size: 22px; }
.auth-reset-success p { margin: 0 0 20px; color: var(--auth-muted); font-size: 13px; line-height: 1.6; }
.auth-reset-success .auth-submit { display: grid; place-items: center; text-decoration: none; }
.auth-code-input { letter-spacing: .24em; font-variant-numeric: tabular-nums; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #747474;
  cursor: pointer;
}
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.password-toggle.is-visible { color: var(--auth-red); }
.auth-submit {
  min-height: 50px;
  margin-top: 2px;
  border: 1px solid var(--auth-black);
  border-radius: 11px;
  background: var(--auth-black);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.auth-submit:hover { border-color: var(--auth-red); background: var(--auth-red); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-submit--red { border-color: var(--auth-red); background: var(--auth-red); }
.auth-submit--red:hover { border-color: var(--auth-red-dark); background: var(--auth-red-dark); }

.auth-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid #18845f;
  background: #f2f8f5;
  color: #176649;
  font-size: 13px;
  line-height: 1.5;
}
.auth-status.is-error { border-left-color: var(--auth-red); background: #fff2f3; color: #a8191f; }
.auth-divider { position: relative; margin: 24px 0 18px; text-align: center; }
.auth-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--auth-line); }
.auth-divider span { position: relative; padding: 0 12px; background: #fff; color: #929292; font-size: 12px; }
.google-login {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #bfbfbc;
  border-radius: 11px;
  background: #fff;
  color: var(--auth-black);
  font-weight: 750;
  cursor: pointer;
}
.google-login svg { width: 20px; height: 20px; }
.google-login:hover { border-color: var(--auth-black); background: #f8f8f7; }
.google-login.is-unavailable { opacity: .52; cursor: not-allowed; }
@media (max-width: 820px) {
  body.personal-auth-page { background: #fff; }
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }
  .auth-brand { display: none; }
  .auth-panel {
    width: min(100%, 540px);
    min-height: 100vh;
    margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 24px calc(104px + env(safe-area-inset-bottom));
    justify-content: flex-start;
  }
  .auth-mobile-brand { display: flex; margin-bottom: 38px; }
  .auth-mobile-brand img { width: 48px; height: 48px; }
  .auth-mobile-brand span { font-size: 16px; }
  .auth-panel__header h2 { font-size: 34px; }
  .auth-panel--reset { justify-content: flex-start; }
}

@media (max-width: 460px) {
  .auth-panel { padding-left: 20px; padding-right: 20px; }
  .auth-mobile-brand { margin-bottom: 30px; }
  .auth-panel__header h2 { font-size: 31px; }
  .auth-panel__header p { line-height: 1.6; }
  .auth-tabs { margin-top: 24px; }
  .auth-tab { min-height: 46px; padding: 0 3px; font-size: 13px; }
  .auth-panels { padding-top: 22px; }
  .auth-form__row { grid-template-columns: 1fr; }
  .auth-form input, .auth-submit, .google-login { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
