:root {
  --paper: #f5f3eb;
  --card: #fffef8;
  --ink: #233c34;
  --muted: #687069;
  --line: #d9ded3;
  --accent: #b56842;
  --soft: #eef0e7;
  --field: #fbfaf5;
  --danger: #c64545;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.7 var(--sans);
  background:
    radial-gradient(1100px 560px at 12% -12%, #fffdf6 0%, rgba(255, 253, 246, 0) 62%),
    radial-gradient(900px 520px at 104% 112%, #e8e3d3 0%, rgba(232, 227, 211, 0) 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(rgba(35, 60, 52, .12) .6px, transparent .6px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
}

.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 28px;
  position: relative;
  z-index: 1;
}

.card {
  width: 100%;
  max-width: 430px;
  padding: 38px 36px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 28px 70px -42px rgba(35, 60, 52, .45);
  position: relative;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .55;
}

.brand {
  display: flex;
  justify-content: center;
  margin: 2px 0 20px;
}

.brand img {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--muted);
  text-transform: uppercase;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .01em;
  text-align: center;
}

.lead {
  margin: 10px 0 26px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.label {
  display: block;
  margin-bottom: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 14px/1 var(--sans);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input[type="text"]:hover,
input[type="password"]:hover {
  border-color: #c6cec1;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  background: #fffefb;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 104, 66, .14);
}

.secret {
  position: relative;
  display: block;
}

.secret input {
  padding-right: 62px;
}

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: 11px/1 var(--sans);
  letter-spacing: 1px;
  cursor: pointer;
}

.reveal:hover { color: var(--accent); background: rgba(181, 104, 66, .08); }
.reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.error {
  margin: 2px 0 14px;
  padding: 9px 11px;
  font-size: 12px;
  color: #9e3434;
  background: #fbeeec;
  border: 1px solid #efd2cd;
  border-radius: 6px;
}

.submit {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  color: #fffef8;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font: 13px/1 var(--sans);
  font-weight: 600;
  letter-spacing: 4px;
  text-indent: 4px;
  cursor: pointer;
  transition: background .16s ease, transform .12s ease, opacity .16s ease;
}

.submit:hover { background: #9d5736; border-color: #9d5736; }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: 3px solid rgba(181, 104, 66, .45); outline-offset: 2px; }
.submit:disabled { cursor: default; opacity: .65; }

.foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eceee7;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #8a9188;
  text-align: center;
}

.aside {
  margin: 18px 0 0;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #8a9188;
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .stage { padding: 24px 16px; }
  .card { padding: 30px 22px 24px; }
  .card::before { left: 22px; right: 22px; }
  .brand img { width: 210px; }
  h1 { font-size: 23px; }
  .lead { margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  * { transition: none !important; }
}
