:root {
  color-scheme: light;
  --paper: #f2eadb;
  --ink: #2d211c;
  --muted: #735f53;
  --brown: #6d4a38;
  --brown-dark: #3d2a22;
  --violet: #6650a5;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--brown); color: var(--ink); }
button, input { font: inherit; }

.login-shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(22rem, 2fr);
  gap: clamp(2rem, 5vw, 6rem);
  padding: clamp(1.5rem, 3vw, 3rem);
  overflow: hidden;
}

.brand {
  position: absolute;
  z-index: 3;
  top: clamp(1.2rem, 2.2vw, 2rem);
  left: clamp(1.2rem, 2.2vw, 2rem);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #f5ecdc;
  font-weight: 650;
  letter-spacing: -.02em;
}
.brand img { width: 2.1rem; height: 2.1rem; filter: brightness(0) invert(1); opacity: .94; }

.artwork {
  grid-column: 1;
  position: relative;
  min-width: 0;
  height: min(88vh, 62rem);
  margin: auto 0;
  display: grid;
  place-items: center;
}
.artwork img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 1.5rem 3rem rgba(34, 20, 14, .18));
}
.artwork figcaption {
  position: absolute;
  right: 0;
  bottom: -.1rem;
  color: rgba(255, 247, 235, .74);
  font-size: .74rem;
  letter-spacing: .08em;
}

.auth-panel {
  grid-column: 2;
  align-self: center;
  justify-self: stretch;
  max-width: 29rem;
  padding: clamp(1.8rem, 4vw, 3.25rem);
  border: 1px solid rgba(76, 49, 37, .18);
  border-radius: 1.75rem;
  background: rgba(247, 240, 226, .94);
  box-shadow: 0 2rem 5rem rgba(44, 28, 21, .24);
  backdrop-filter: blur(18px);
}
.product-mark { display: inline-flex; align-items: center; gap: .65rem; margin-bottom: 2.75rem; font-weight: 650; }
.product-mark img { width: 2rem; height: 2rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--violet); font-size: .73rem; font-weight: 750; letter-spacing: .18em; }
h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(2.8rem, 5vw, 4.8rem); font-weight: 500; line-height: .95; letter-spacing: -.055em; }
.tagline { margin: 1.2rem 0 2.4rem; color: var(--muted); line-height: 1.7; }

form { display: grid; gap: .7rem; }
label { margin-top: .45rem; font-size: .83rem; font-weight: 650; }
input {
  width: 100%;
  height: 3.25rem;
  border: 1px solid rgba(76, 49, 37, .28);
  border-radius: .75rem;
  padding: 0 1rem;
  background: rgba(255, 252, 245, .88);
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: #9b897f; }
input:focus { border-color: var(--violet); background: #fffdf8; box-shadow: 0 0 0 3px rgba(102, 80, 165, .13); }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
.code-row button {
  min-width: 7.3rem;
  border: 0;
  border-radius: .75rem;
  padding: 0 .85rem;
  background: rgba(102, 80, 165, .11);
  color: var(--violet);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
}
.code-row button:hover:not(:disabled) { background: rgba(102, 80, 165, .18); }
.code-row button:disabled { color: #9a8d85; cursor: default; }
.status { min-height: 1.25rem; margin: .15rem 0 0; color: var(--muted); font-size: .78rem; }
.status[data-error="true"] { color: #a13d35; }
.submit {
  height: 3.35rem;
  margin-top: .25rem;
  border: 0;
  border-radius: .78rem;
  background: var(--brown-dark);
  color: #fff9ef;
  font-weight: 720;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.submit:hover:not(:disabled) { transform: translateY(-1px); background: #2f201a; }
.submit:disabled { opacity: .52; cursor: wait; }
.privacy { margin: 1.45rem 0 0; color: #89786e; font-size: .72rem; line-height: 1.55; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; grid-template-rows: minmax(20rem, 48svh) auto; gap: 1.25rem; min-height: 100dvh; overflow: visible; padding: 1rem; }
  .brand { top: .85rem; left: .85rem; }
  .artwork { grid-column: 1; grid-row: 1; width: 100%; height: 48svh; min-height: 20rem; padding-top: 2rem; }
  .artwork figcaption { right: .5rem; }
  .auth-panel { grid-column: 1; grid-row: 2; justify-self: center; width: min(100%, 31rem); max-width: none; padding: 1.55rem; border-radius: 1.35rem; }
  .product-mark { margin-bottom: 1.8rem; }
  h1 { font-size: clamp(2.7rem, 15vw, 4rem); }
}

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