:root {
  color-scheme: light;
  --ink: #15231c;
  --muted: #69756d;
  --paper: #f3eee2;
  --panel: #fffdf8;
  --line: #d8d0c1;
  --green: #1f6048;
  --green-dark: #184936;
  --red: #9a443a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgb(229 190 128 / 42%), transparent 30rem),
    var(--paper);
}

a { color: inherit; }

.auth-header,
.auth-footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.auth-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgb(21 35 28 / 15%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.auth-main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(48px, 9vw, 140px);
  padding: 70px 0;
}

.auth-intro .eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .12em;
}

.auth-intro h1 {
  max-width: 620px;
  margin: 16px 0 24px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 540;
  line-height: 1.08;
  letter-spacing: -.055em;
}

.auth-intro p {
  max-width: 580px;
  margin: 0;
  color: #405047;
  font-size: 17px;
  line-height: 1.8;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.privacy-note::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgb(31 96 72 / 10%);
}

.auth-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(255 253 248 / 92%);
  box-shadow: 0 24px 60px rgb(73 58 35 / 10%);
}

.auth-card h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.auth-card > p { margin: 9px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.auth-form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
label { color: #4d5a52; font-size: 13px; font-weight: 720; }
label small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }

input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #c9c0b1;
  border-radius: 11px;
  outline: none;
  background: white;
  font: inherit;
}

input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(31 96 72 / 12%); }

button {
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--green);
  font: inherit;
  font-weight: 780;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--green-dark); }
button:disabled { cursor: wait; opacity: .55; }

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }

.invite-card { min-height: 420px; display: grid; align-content: center; }
.invite-loading { min-height: 280px; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--muted); font-size: 13px; }
.invite-loading p { margin: 0; }
.loading-dot { width: 18px; height: 18px; border: 2px solid rgb(31 96 72 / 20%); border-top-color: var(--green); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.invite-role { display: inline-flex; width: fit-content; margin-bottom: 12px; padding: 5px 9px; border-radius: 999px; color: var(--green); background: rgb(31 96 72 / 10%); font-size: 11px; font-weight: 800; }
.invite-card h2 { font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 540; }
.invite-details { display: grid; gap: 1px; margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.invite-details div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 11px 13px; background: white; }
.invite-details dt { color: var(--muted); font-size: 11px; }
.invite-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 680; }
.invite-error-state { min-height: 300px; place-items: center; align-content: center; text-align: center; }
.invite-error-state:not([hidden]) { display: grid; }
.invite-error-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-size: 20px; font-weight: 800; }
.invite-error-state h2 { margin: 16px 0 0; font-family: inherit; font-size: 22px; font-weight: 760; }
.invite-error-state p { max-width: 340px; margin: 9px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.invite-error-state a { color: var(--green); font-size: 13px; font-weight: 700; }

.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  border-top: 1px solid rgb(21 35 28 / 12%);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 820px) {
  .auth-main { grid-template-columns: 1fr; padding: 48px 0 70px; }
  .auth-intro h1 { font-size: clamp(42px, 12vw, 62px); }
}

@media (max-width: 520px) {
  .auth-header,
  .auth-main,
  .auth-footer { width: min(100% - 28px, 1120px); }
  .auth-card { padding: 22px; border-radius: 17px; }
  .auth-footer { flex-direction: column; }
}
