/* Novi · 原力构建 — Auth Pages */

:root {
  --novi-cobalt:   #1E5BC6;
  --novi-teal:     #1A8B86;
  --novi-emerald:  #1E8449;
  --novi-orange:   #E8722C;
  --novi-graphite: #1A1A1A;

  --ink-900: #0F1012;
  --ink-800: #1A1A1A;
  --ink-700: #2D2D30;
  --ink-500: #6B6B70;
  --ink-400: #9A9A9F;
  --ink-300: #C9C9CC;
  --ink-200: #E5E4DF;
  --ink-150: #EFEDE6;
  --ink-100: #F5F3EC;
  --ink-50:  #FAF8F2;
  --paper:   #FAF8F2;

  --success: var(--novi-emerald);
  --warning: var(--novi-orange);
  --info:    var(--novi-cobalt);
  --danger:  #C8323A;
  --primary: var(--novi-cobalt);

  --font-display: "Geist", "Noto Sans SC", system-ui, sans-serif;
  --font-body:    "Geist", "Noto Sans SC", system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", monospace;

  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px;  --s-7: 48px;  --s-8: 64px;

  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;

  --stroke-thin: 1px;

  --shadow-2: 0 4px 16px -8px rgba(15,16,18,.12), 0 0 0 0.5px rgba(15,16,18,.08);

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --dur-1: 120ms;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-800);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Blueprint grid over paper, with full brand-palette glow washing through */
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--ink-300) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--ink-300) 0.5px, transparent 0.5px),
    linear-gradient(var(--ink-200) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--ink-200) 0.5px, transparent 0.5px),
    radial-gradient(58% 52% at 18% 14%, rgba(30, 91, 198, 0.16), transparent 72%),
    radial-gradient(52% 48% at 86% 90%, rgba(26, 139, 134, 0.13), transparent 72%),
    radial-gradient(40% 38% at 92% 8%, rgba(232, 114, 44, 0.07), transparent 70%),
    radial-gradient(46% 44% at 8% 94%, rgba(30, 132, 73, 0.07), transparent 72%);
  background-size:
    128px 128px, 128px 128px, 32px 32px, 32px 32px,
    100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position:
    -1px -1px, -1px -1px, -1px -1px, -1px -1px,
    0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed, fixed, fixed, fixed, fixed, fixed;

  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--s-6) var(--s-4);
  position: relative;
  overflow: hidden;
}

/* Grain / noise texture — sits behind the grid so it doesn't cover lines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.04;
  pointer-events: none;
  z-index: -1;
}

/* ── Background brand watermark — isometric N mark ── */
.auth-bg-mark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-46%, -50%);
  width: min(90vh, 90vw);
  height: min(90vh, 90vw);
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  color: var(--novi-cobalt);
  will-change: transform;
}

.auth-bg-mark svg {
  width: 100%;
  height: 100%;
  stroke-width: 1;
}

/* Background corner label */
.auth-bg-label {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-6);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.auth-bg-label-tl {
  position: fixed;
  top: var(--s-5);
  left: var(--s-6);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  letter-spacing: 0.15em;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.auth-bg-label-tl::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--novi-cobalt);
  opacity: 0.5;
}

/* ── Auth card ── */
.auth-wrap {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: white;
  border: var(--stroke-thin) solid var(--ink-200);
  border-radius: var(--r-4);
  padding: var(--s-7) var(--s-6);
  box-shadow: var(--shadow-2);
  position: relative;
}

/* architectural corner ticks */
.auth-card::before,
.auth-card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--ink-300);
  border-style: solid;
  border-width: 0;
}
.auth-card::before { top: 6px; left: 6px; border-top-width: 1px; border-left-width: 1px; }
.auth-card::after  { bottom: 6px; right: 6px; border-bottom-width: 1px; border-right-width: 1px; }

/* ── Logo in card ── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: var(--stroke-thin) solid var(--ink-150);
}

.auth-logo img {
  height: 56px;
  width: auto;
  display: block;
}

/* ── Headings ── */
.auth-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--ink-800);
  margin-bottom: var(--s-1);
}

.auth-subtitle {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: var(--s-5);
  line-height: 1.5;
}

/* ── Alerts ── */
.alert {
  padding: 9px var(--s-3);
  border-radius: var(--r-2);
  font-size: 13px;
  margin-bottom: var(--s-4);
}

.alert-success {
  background: rgba(30, 132, 73, 0.07);
  border: var(--stroke-thin) solid rgba(30, 132, 73, 0.22);
  color: #1E6B3C;
}

.alert-error {
  background: rgba(200, 50, 58, 0.06);
  border: var(--stroke-thin) solid rgba(200, 50, 58, 0.20);
  color: #9B1C23;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  letter-spacing: 0.01em;
}

.form-group input {
  height: 38px;
  padding: 0 var(--s-3);
  border: var(--stroke-thin) solid var(--ink-300);
  border-radius: var(--r-2);
  background: white;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-800);
  outline: none;
  transition: border-color var(--dur-1) var(--ease-out),
              box-shadow var(--dur-1) var(--ease-out);
}

.form-group input::placeholder { color: var(--ink-400); }
.form-group input:hover         { border-color: var(--ink-400); }
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 91, 198, 0.12);
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
}

/* ── Submit button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  padding: 0 var(--s-4);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--r-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin-top: var(--s-2);
  transition: background var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}

.btn-primary:hover  { background: #194fab; transform: translateY(-0.5px); }
.btn-primary:active { transform: translateY(0); }

/* ── Footer link ── */
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--ink-500);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: var(--stroke-thin) dashed var(--ink-200);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Verify result ── */
.verify-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto var(--s-5);
}

.verify-success {
  background: rgba(30, 132, 73, 0.08);
  border: var(--stroke-thin) solid rgba(30, 132, 73, 0.25);
  color: var(--novi-emerald);
}

.verify-error {
  background: rgba(200, 50, 58, 0.06);
  border: var(--stroke-thin) solid rgba(200, 50, 58, 0.22);
  color: var(--danger);
}

/* ── Doc tag ── */
.auth-doc-tag {
  position: absolute;
  top: var(--s-3);
  right: var(--s-4);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-400);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Card entrance animation ── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card {
  animation: card-in 0.45s var(--ease-out) both;
}

@media (max-width: 480px) {
  .auth-card { padding: var(--s-5) var(--s-4); }
  .auth-logo img { height: 44px; }
}
