:root {
  --paper: #fffaf1;
  --paper-soft: rgba(255, 252, 245, .76);
  --ink: #181715;
  --muted: #6d655b;
  --line: rgba(32, 31, 28, .10);
  --accent: #0f766e;
  --accent-2: #217f96;
  --danger: #b42318;
  --ok: #047857;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 14% 12%, rgba(237, 201, 164, .42), transparent 42%),
    radial-gradient(ellipse at 82% 12%, rgba(161, 217, 212, .34), transparent 45%),
    radial-gradient(ellipse at 54% 78%, rgba(209, 224, 247, .28), transparent 42%),
    linear-gradient(135deg, #f5efe3 0%, #f7fbf7 48%, #eef8f8 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(rgba(35, 34, 30, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 34, 30, .04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,.20));
}

body::after {
  background:
    linear-gradient(115deg, transparent 22%, rgba(15, 118, 110, .10) 42%, transparent 60%),
    linear-gradient(72deg, transparent 18%, rgba(255, 255, 255, .42) 54%, transparent 74%);
  opacity: .72;
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px min(4vw, 56px) 22px;
}

.auth-top {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 20px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.auth-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 10px 30px rgba(53, 42, 30, .10);
}

.auth-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 245, .76);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 54px rgba(53, 42, 30, .10);
}

.auth-nav a,
.auth-switch a {
  color: #25231f;
  text-decoration: none;
  font-size: 14px;
  font-weight: 780;
}

.auth-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 999px;
}

.auth-nav a:hover,
.auth-nav a.active {
  background: rgba(15, 118, 110, .10);
  color: #0f766e;
}

.auth-switch {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, .78);
  backdrop-filter: blur(16px);
}

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 74px 0 56px;
}

.auth-card {
  width: min(430px, 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(32, 31, 28, .10);
  border-radius: 24px;
  background: rgba(255, 252, 245, .78);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(53, 42, 30, .14);
  padding: 34px 30px 28px;
}

.auth-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, .16), transparent 68%);
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-card-logo img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}

.auth-title {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 760;
}

.auth-title span {
  display: block;
  margin-top: 9px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  color: #0f766e;
  font-weight: 820;
}

.auth-note {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 650;
}

.auth-form {
  margin-top: 26px;
}

.auth-field {
  margin-top: 15px;
}

.auth-field label {
  display: block;
  margin-bottom: 8px;
  color: #302c26;
  font-size: 13px;
  font-weight: 820;
}

.auth-field input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(32, 31, 28, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .70);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  font-size: 15px;
  font-weight: 650;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.auth-field input:focus {
  border-color: rgba(15, 118, 110, .42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .10);
  transform: translateY(-1px);
}

.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 999px;
  background: #181715;
  color: #fffaf1;
  font-size: 15px;
  font-weight: 860;
  cursor: pointer;
  box-shadow: 0 18px 48px rgba(24, 23, 21, .16);
}

.auth-submit:hover {
  background: var(--accent);
}

.auth-submit:disabled {
  opacity: .68;
  cursor: wait;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-links.center {
  justify-content: center;
}

.auth-links a {
  color: #0f766e;
  text-decoration: none;
  font-weight: 840;
}

.auth-message,
.auth-banner {
  min-height: 22px;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 780;
}

.auth-message.err {
  color: var(--danger);
}

.auth-message.ok {
  color: var(--ok);
}

.auth-banner {
  display: none;
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 118, 110, .08);
  color: #0f5f58;
}

.auth-banner.show {
  display: block;
}

.auth-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgba(32, 31, 28, .50);
  font-size: 12px;
  font-weight: 680;
}

@media (max-width: 840px) {
  .auth-page { padding: 16px 14px 18px; }
  .auth-top { grid-template-columns: 1fr auto; }
  .auth-nav { order: 3; grid-column: 1 / -1; flex-wrap: wrap; }
  .auth-switch { grid-column: 2; }
  .auth-main { padding-top: 46px; }
}

@media (max-width: 520px) {
  .auth-brand span { display: none; }
  .auth-nav a { padding: 0 11px; }
  .auth-card { padding: 28px 20px 24px; border-radius: 20px; }
  .auth-title { font-size: 25px; }
  .auth-links { flex-direction: column; align-items: center; }
}
