:root {
  --ink: #1b1a18;
  --muted: #6e665e;
  --paper: #f4f0e8;
  --porcelain: #fcfaf6;
  --copper: #7a4f35;
  --gold: #ad8c6f;
  --line: rgba(27, 26, 24, 0.13);
  --font-display: "Songti SC", STSong, "Iowan Old Style", Baskerville, Georgia, serif;
  --font-body: Inter, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(480px, 1.05fr);
  min-height: 100vh;
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(30px, 5vw, 72px);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  color: var(--porcelain);
  background:
    linear-gradient(180deg, rgba(16, 14, 12, 0.18), rgba(16, 14, 12, 0.78)),
    url("/assets/hero-tea-atelier.jpg") center / cover;
}
.auth-story::after {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  content: "";
  pointer-events: none;
}
.auth-brand, .auth-story__content, .auth-story__foot { position: relative; z-index: 1; }
.auth-brand { display: inline-flex; align-items: center; gap: 14px; width: max-content; }
.auth-brand__mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.auth-brand span:last-child { display: grid; line-height: 1.25; }
.auth-brand strong { font-family: var(--font-display); font-size: 1.16rem; letter-spacing: 0.18em; }
.auth-brand small, .auth-story__foot { font-size: 0.62rem; letter-spacing: 0.2em; opacity: 0.66; }
.auth-story__content { max-width: 560px; padding-bottom: 5vh; }
.eyebrow { margin: 0 0 16px; color: var(--gold); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.22em; }
.auth-story .eyebrow { color: #d8c1ad; }
.auth-story h1 { margin: 0 0 28px; font-family: var(--font-display); font-size: clamp(2.4rem, 4.5vw, 5rem); font-weight: 400; line-height: 1.14; letter-spacing: 0.02em; }
.auth-story__content > p:last-child { max-width: 500px; margin: 0; color: rgba(255,255,255,.75); line-height: 1.9; }

.auth-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: clamp(74px, 10vh, 120px) clamp(30px, 8vw, 130px) 64px;
  place-items: center;
  background:
    radial-gradient(circle at 85% 12%, rgba(173, 140, 111, 0.13), transparent 30%),
    var(--paper);
}
.back-link { position: absolute; top: 26px; right: 42px; display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: 0.78rem; }
.back-link:hover { color: var(--copper); }
.auth-language { position: absolute; top: 25px; left: clamp(30px, 8vw, 130px); display: inline-flex; padding: 3px; gap: 2px; background: rgba(255,255,255,.56); border: 1px solid var(--line); border-radius: 999px; }
.auth-language button { min-width: 44px; min-height: 44px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; cursor: pointer; font-size: .72rem; font-weight: 750; }
.auth-language button.is-active { color: #fff; background: var(--copper); }
.auth-view { width: min(100%, 470px); }
.auth-heading { margin-bottom: 34px; }
.auth-heading h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(2.25rem, 4vw, 3.6rem); font-weight: 400; line-height: 1.15; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); }
form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #4e4842; font-size: 0.76rem; font-weight: 680; letter-spacing: 0.04em; }
input {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  color: var(--ink);
  background: rgba(252,250,246,.8);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
input:focus { background: #fff; border-color: rgba(122,79,53,.58); box-shadow: 0 0 0 4px rgba(122,79,53,.08); }
.form-row { display: flex; min-height: 44px; align-items: center; justify-content: space-between; font-size: 0.78rem; }
.form-row a, .auth-switch a { color: var(--copper); font-weight: 700; }
.turnstile-slot { min-height: 65px; }
.auth-button {
  min-height: 54px;
  padding: 13px 22px;
  color: #fff;
  background: var(--copper);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 720;
  letter-spacing: 0.05em;
  box-shadow: 0 14px 34px rgba(86,53,34,.18);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.auth-button:hover { background: #563522; box-shadow: 0 18px 42px rgba(86,53,34,.24); transform: translateY(-2px); }
.auth-button:disabled { cursor: wait; opacity: .55; transform: none; }
.form-status { min-height: 1.5em; margin: -5px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.form-status[data-state="error"] { color: #a13f2f; }
.form-status[data-state="success"] { color: #397056; }
.auth-switch { margin: 27px 0 0; color: var(--muted); font-size: 0.8rem; text-align: center; }
.oauth-panel { margin-top: 24px; }
.oauth-divider { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: .66rem; }
.oauth-divider::before, .oauth-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.oauth-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 15px; }
.oauth-grid button { display: flex; min-height: 47px; padding: 0 13px; align-items: center; gap: 10px; color: #4e4842; background: rgba(252,250,246,.72); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color 180ms ease, transform 180ms ease, background 180ms ease; }
.oauth-grid button:not(:disabled):hover { background: #fff; border-color: rgba(122,79,53,.38); transform: translateY(-2px); }
.oauth-grid button:disabled { cursor: not-allowed; opacity: .45; }
.oauth-grid button span { display: grid; width: 25px; height: 25px; place-items: center; color: var(--copper); border: 1px solid rgba(122,79,53,.18); border-radius: 50%; font-family: Georgia, serif; font-size: .67rem; }
.oauth-grid button b { min-width: 0; overflow: hidden; font-size: .68rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.text-button { min-height: 44px; padding: 0; color: var(--copper); background: none; border: 0; cursor: pointer; font-weight: 700; }
.auth-notice { width: min(100%, 470px); margin-top: 18px; padding: 18px 20px; background: rgba(173,140,111,.1); border: 1px solid rgba(122,79,53,.16); border-radius: 16px; }
.auth-notice strong { font-family: var(--font-display); }
.auth-notice p { margin: 6px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.65; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 360px; padding: 28px; }
  .auth-story__content { padding: 55px 0 20px; }
  .auth-story h1 { font-size: clamp(2.2rem, 9vw, 3.6rem); }
  .auth-story__foot { display: none; }
  .auth-panel { min-height: auto; padding: 80px 24px 56px; }
  .back-link { top: 25px; right: 24px; }
  .auth-language { left: 24px; }
}

@media (max-width: 520px) {
  .auth-story { min-height: 300px; }
  .auth-story::after { inset: 10px; }
  .auth-story__content > p:last-child { display: none; }
  .auth-panel { padding: 78px 16px 48px; }
  .auth-heading { margin-bottom: 26px; }
  .auth-heading h2 { font-size: clamp(2rem, 10vw, 2.35rem); }
  .auth-heading > p:last-child { font-size: 1rem; line-height: 1.65; }
  .auth-language { left: 16px; }
  .back-link { right: 16px; }
  .oauth-grid { grid-template-columns: 1fr; }
  .oauth-grid button { min-height: 48px; }
  .auth-notice { padding: 16px; }
  .turnstile-slot { overflow: hidden; }
}

@media (max-width: 360px) {
  .back-link {
    font-size: 0.72rem;
  }
}

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