@font-face { font-family: "DM Sans"; src: url("assets/fonts/dmsans.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }

:root {
  --paper: #f5efe3;
  --surface: #fffdf7;
  --surface-2: #faf5ea;
  --ink: #20231d;
  --soft: #4f544a;
  --muted: #8b8577;
  --line: #e5dac9;
  --line-strong: #d2c4ad;
  --accent: #d6603a;
  --accent-soft: #f6d4c2;
  --green: #2e8b68;
  --green-soft: #e5f2ea;
  --dark: #202820;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --radius: 20px;
  --shadow: 0 24px 60px rgba(68, 54, 30, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(760px 460px at 78% -8%, rgba(214, 96, 58, .13), transparent 65%),
    radial-gradient(760px 500px at 8% 100%, rgba(46, 139, 104, .08), transparent 70%),
    var(--paper);
}

.login-header {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--dark); display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.brand-mark i { display: block; width: 2px; border-radius: 2px; background: #f8f1df; }
.brand-mark i:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; opacity: .8; }
.brand-mark i:nth-child(4) { height: 6px; opacity: .45; }
.brand b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.back-link { color: var(--muted); font-size: 12px; transition: color .15s; }
.back-link:hover { color: var(--accent); }
.login-header-links { display: flex; align-items: center; gap: 18px; }
.login-member { display: inline-flex; align-items: center; height: 35px; padding: 0 13px; border-radius: 9px; background: var(--dark); color: #fff8ed; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.login-member:hover { background: var(--accent-deep); color: #fff8ed; }

.login-main {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  align-items: center;
  gap: 90px;
  padding: 28px 0 60px;
}

.login-intro { max-width: 560px; }
.eyebrow { color: var(--accent); font-family: monospace; font-size: 10px; letter-spacing: .12em; }
.login-intro h1 { margin: 15px 0 0; font-size: clamp(39px, 4.6vw, 58px); font-weight: 500; letter-spacing: -.055em; line-height: 1.02; }
.login-intro h1 em { color: var(--accent); font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.03em; }
.lead { max-width: 430px; margin: 20px 0 0; color: var(--soft); font-size: 15px; line-height: 1.85; }
.intro-points { margin-top: 34px; display: flex; flex-direction: column; gap: 0; max-width: 470px; border-top: 1px solid var(--line); }
.intro-points > div { display: grid; grid-template-columns: 32px 1fr; gap: 0 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.intro-points b { grid-row: span 2; color: var(--accent); font-family: monospace; font-size: 10px; font-weight: 500; padding-top: 3px; }
.intro-points span { font-size: 13px; font-weight: 600; }
.intro-points small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.intro-free { display: flex; align-items: flex-start; gap: 10px; max-width: 470px; margin-top: 25px; padding: 14px 15px; border: 1px solid #cfe2d7; border-radius: 12px; background: rgba(229, 242, 234, .55); }
.free-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46, 139, 104, .10); }
.intro-free div { min-width: 0; flex: 1; }
.intro-free b { display: block; font-size: 12px; font-weight: 600; }
.intro-free small { display: block; margin-top: 3px; color: var(--soft); font-size: 10.5px; line-height: 1.5; }
.intro-free a { flex: 0 0 auto; color: var(--green); font-size: 11px; padding-top: 1px; }

.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 30px 22px; box-shadow: var(--shadow); position: relative; }
.login-card::before { content: ""; position: absolute; top: -7px; right: 30px; width: 56px; height: 17px; background: rgba(232, 203, 144, .60); transform: rotate(2deg); }
.card-head h2 { margin: 6px 0 0; font-size: 29px; font-weight: 500; letter-spacing: -.04em; }
.card-head p { margin: 7px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.card-kicker { color: var(--accent); font-family: monospace; font-size: 9.5px; letter-spacing: .12em; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 22px 0 18px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.tab { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 8px; font-size: 12px; transition: background .15s, color .15s; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(68, 54, 30, .08); }

.auth-form { display: flex; flex-direction: column; gap: 13px; }
.field { display: block; }
.field > span:first-child { display: block; margin-bottom: 6px; color: var(--soft); font-size: 10.5px; }
.field input { width: 100%; height: 43px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--surface-2); color: var(--ink); font-size: 12.5px; transition: border-color .15s, background .15s, box-shadow .15s; }
.field input::placeholder { color: #b5ad9e; }
.field input:focus { border-color: #cda58f; background: var(--surface); box-shadow: 0 0 0 3px rgba(214, 96, 58, .08); }
.password-wrap, .invite-wrap { display: flex; position: relative; }
.password-wrap input { padding-right: 50px; }
.eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 5px; }
.eye:hover { color: var(--accent); }
.invite-wrap input { padding-right: 38px; text-transform: uppercase; letter-spacing: .03em; }
.invite-help { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-family: serif; font-size: 12px; }
.invite-help:hover { color: var(--accent); border-color: var(--accent-soft); }
.invite-note { margin: -3px 0 2px; color: var(--muted); font-size: 9.5px; line-height: 1.6; }
.submit { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: var(--dark); color: #fbf7ea; font-size: 12.5px; font-weight: 500; transition: background .15s, transform .15s; }
.submit:hover { background: #364238; }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: .55; cursor: wait; }
.form-foot { margin: 0; color: var(--muted); font-size: 10px; text-align: center; line-height: 1.6; }
.text-link { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }

.auth-message { margin: 0 0 12px; padding: 9px 11px; border-radius: 7px; font-size: 10.5px; line-height: 1.55; }
.auth-message.is-error { color: #8d3326; background: #fcebe5; border: 1px solid #f1cfc4; }
.auth-message.is-ok { color: #23664c; background: var(--green-soft); border: 1px solid #cce3d6; }

.logged-panel { padding-top: 4px; }
.logged-top { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.logged-avatar { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--dark); color: #fbf7ea; font-size: 13px; }
.logged-top b { display: block; font-size: 13px; font-weight: 600; }
.logged-top small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.logged-expiry { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.logged-actions { display: flex; gap: 8px; margin-top: 14px; }
.logged-actions .submit { flex: 1; }
.quiet-btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--soft); font-size: 11px; }
.quiet-btn:hover { border-color: var(--line-strong); }
.admin-link { display: block; margin-top: 13px; color: var(--accent); font-size: 10.5px; }

.card-bottom { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.card-bottom a:hover { color: var(--accent); }
.card-bottom span { color: var(--line-strong); }

.login-footer { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 16px 0 22px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }

@media (max-width: 980px) {
  .login-main { grid-template-columns: 1fr; gap: 34px; max-width: 560px; padding-top: 14px; }
  .login-intro h1 { font-size: 43px; }
  .login-intro .lead { margin-top: 14px; }
  .intro-points { margin-top: 22px; }
  .intro-free { margin-top: 18px; }
  .login-card { width: 100%; }
}

@media (max-width: 560px) {
  .login-header, .login-main, .login-footer { width: calc(100% - 32px); }
  .login-header { height: 68px; }
  .brand-mark { width: 32px; height: 32px; }
  .login-main { padding: 8px 0 40px; gap: 18px; }
  .login-intro h1 { font-size: 34px; line-height: 1.05; }
  .login-intro .lead, .login-intro .intro-points, .login-intro .intro-free { display: none; }
  .login-intro .eyebrow { font-size: 9px; }
  .login-card { padding: 24px 19px 18px; border-radius: 16px; }
  .card-head h2 { font-size: 25px; }
  .field input { height: 44px; font-size: 13px; }
  .login-footer { flex-direction: column; gap: 4px; padding-bottom: 16px; }
}

[hidden] { display: none !important; }
.submit.link-submit { text-decoration: none; }
