:root {
  --bg: #0f1c1a;
  --bg-soft: #16302b;
  --panel: #f7f4ef;
  --ink: #15221f;
  --muted: #5d6b67;
  --line: #d8d2c8;
  --accent: #1f7a5c;
  --accent-deep: #145643;
  --accent-soft: #d9efe6;
  --danger: #9b2c2c;
  --danger-bg: #fde8e8;
  --ok: #1f6b45;
  --ok-bg: #e3f6ec;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(8, 28, 24, 0.28);
  --font-display: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  color: #eef7f3;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(61, 168, 132, 0.35), transparent 55%),
    radial-gradient(900px 500px at 90% 80%, rgba(20, 86, 67, 0.55), transparent 50%),
    linear-gradient(160deg, #0d1a17 0%, #16352e 45%, #0f241f 100%);
}

.brand-glow {
  position: absolute;
  inset: auto -10% -20% 20%;
  height: 55%;
  background: linear-gradient(120deg, rgba(47, 158, 122, 0.25), transparent);
  filter: blur(40px);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin-top: 18vh;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  opacity: 0.9;
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  font-weight: 700;
}

.brand-desc {
  margin: 0;
  color: rgba(238, 247, 243, 0.78);
  font-size: 1rem;
  line-height: 1.6;
}

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  background:
    linear-gradient(180deg, rgba(247, 244, 239, 0.96), #f7f4ef),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(21, 34, 31, 0.025) 18px,
      rgba(21, 34, 31, 0.025) 19px
    );
}

.form-shell {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 210, 200, 0.9);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2rem);
  backdrop-filter: blur(8px);
}

.form-header {
  margin-bottom: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.form-header h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.85rem;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2b3b37;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.18);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-top: 0.25rem;
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-deep);
  white-space: nowrap;
  min-width: 7.2rem;
}

.btn-secondary:hover {
  background: #c7e8db;
}

.btn-ghost {
  background: transparent;
  color: #eef7f3;
  border: 1px solid rgba(238, 247, 243, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.switch-line {
  margin: 1.2rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.flash-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.flash-success {
  background: var(--ok-bg);
  color: var(--ok);
}

/* Welcome page */
.welcome-body {
  background:
    radial-gradient(1000px 500px at 15% 0%, rgba(61, 168, 132, 0.28), transparent 55%),
    radial-gradient(800px 500px at 90% 100%, rgba(20, 86, 67, 0.4), transparent 50%),
    linear-gradient(160deg, #0d1a17, #16352e 50%, #0f241f);
  color: #eef7f3;
}

#app {
  min-height: 100vh;
}

.welcome-body-fill,
.welcome-page {
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
}

.welcome-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.welcome-flash {
  max-width: 420px;
  margin-top: 1rem;
}

.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 40rem;
  animation: rise 0.55s ease both;
}

.welcome-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.15;
  margin: 0.35rem 0 1rem;
}

.welcome-user {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.welcome-meta {
  margin: 0;
  color: rgba(238, 247, 243, 0.72);
}

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

/* Mobile / tablet */
@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 0;
    padding: 1rem 1.25rem 1.1rem;
  }

  .brand-glow {
    display: none;
  }

  .brand-content {
    margin-top: 0.35rem;
    max-width: none;
  }

  .brand-mark {
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
  }

  .brand-title {
    font-size: clamp(1.35rem, 5.5vw, 1.7rem);
    margin: 0;
  }

  .form-panel {
    align-items: flex-start;
    padding: 1rem 1rem 2rem;
  }

  .form-shell {
    width: 100%;
    box-shadow: 0 12px 30px rgba(8, 28, 24, 0.18);
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .form-header h2 {
    font-size: 1.6rem;
  }

  .welcome-hero h1 {
    font-size: 2.2rem;
  }
}
