/* NovaInk AI — Clean Centered Auth Card (Max Router-style, zero mandatory checkbox) */

body.ni-auth-page {
  background: #f4f5f7 !important;
}
html.dark body.ni-auth-page {
  background: #18181a !important;
}

/* Center the AuthLayout root & hide floating top-left logo */
body.ni-auth-page [data-ni-auth-root] {
  min-height: 100svh !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px 16px !important;
  background: transparent !important;
}
body.ni-auth-page [data-ni-corner-brand] {
  display: none !important;
}
body.ni-auth-page [data-ni-auth-root] > .container {
  width: 100% !important;
  max-width: 448px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  justify-content: center !important;
}

/* The Auth Card */
body.ni-auth-page [data-ni-auth-card] {
  width: 100% !important;
  max-width: 448px !important;
  padding: 38px 34px 32px !important;
  border-radius: 28px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.08) !important;
  gap: 0 !important;
}
html.dark body.ni-auth-page [data-ni-auth-card] {
  background: #232325 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5) !important;
}

/* Centered Brand Header inside Card */
.ni-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  text-decoration: none !important;
  transition: opacity 0.16s ease;
}
.ni-card-brand:hover {
  opacity: 0.85;
}
.ni-card-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
}
.ni-card-brand span {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}
html.dark .ni-card-brand span {
  color: #f4f4f5;
}

/* Reorder Heading -> Form -> Switch Account Link -> Implicit Terms Footer (zero DOM reparenting!) */
body.ni-auth-page [data-ni-auth-inner] {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  margin: 0 !important;
}
body.ni-auth-page [data-ni-auth-inner] > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
body.ni-auth-page [data-ni-auth-head] {
  display: contents !important;
}
body.ni-auth-page [data-ni-auth-head] > h2 {
  order: 1 !important;
  text-align: center !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  color: #111827 !important;
  margin-bottom: 26px !important;
}
html.dark body.ni-auth-page [data-ni-auth-head] > h2 {
  color: #ffffff !important;
}
body.ni-auth-page [data-ni-auth-head] > h2::after {
  content: attr(data-ni-sub);
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: #6b7280;
}
html.dark body.ni-auth-page [data-ni-auth-head] > h2::after {
  color: #a1a1aa;
}

/* Main Form */
body.ni-auth-page [data-ni-auth-inner] > form {
  order: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

/* "Don't have an account? Sign up" moved below Submit button */
body.ni-auth-page [data-ni-auth-head] > p {
  order: 3 !important;
  text-align: center !important;
  font-size: 14px !important;
  color: #6b7280 !important;
  margin-top: 22px !important;
  margin-bottom: 0 !important;
}
html.dark body.ni-auth-page [data-ni-auth-head] > p {
  color: #a1a1aa !important;
}
body.ni-auth-page [data-ni-auth-head] > p a {
  color: #2f81f7 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  margin-left: 4px;
}
body.ni-auth-page [data-ni-auth-head] > p a:hover {
  text-decoration: underline !important;
}

/* Bottom Implicit Agreement Footer */
body.ni-auth-page [data-ni-auth-footer] {
  order: 4 !important;
  text-align: center !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  color: #6b7280 !important;
  margin-top: 14px !important;
}
html.dark body.ni-auth-page [data-ni-auth-footer] {
  color: #8e8e93 !important;
}
body.ni-auth-page [data-ni-auth-footer] a {
  color: inherit !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}
body.ni-auth-page [data-ni-auth-footer] a:hover {
  color: #2f81f7 !important;
}

/* Hide the mandatory Legal Consent Checkbox box (auto-checked in JS) */
body.ni-auth-page [data-ni-legal-box] {
  display: none !important;
}

/* Hide the overly verbose password strength checklist (backend only requires 8-128 chars) */
body.ni-auth-page #sign-up-password-strength {
  display: none !important;
}

/* OAuth section: Always appear FIRST, buttons ABOVE divider, Google FIRST */
body.ni-auth-page [data-ni-oauth-wrap] {
  order: -1 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 18px !important;
  margin: 0 !important;
}
body.ni-auth-page [data-ni-oauth-wrap] > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
body.ni-auth-page [data-ni-oauth-list] {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
body.ni-auth-page [data-ni-oauth-list] button {
  height: 44px !important;
  border-radius: 14px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #111827 !important;
  box-shadow: none !important;
  transition: background-color 0.16s ease, border-color 0.16s ease !important;
}
body.ni-auth-page [data-ni-oauth-list] button:hover:not(:disabled) {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
}
html.dark body.ni-auth-page [data-ni-oauth-list] button {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f4f4f5 !important;
}
html.dark body.ni-auth-page [data-ni-oauth-list] button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}
body.ni-auth-page [data-ni-google-btn] {
  order: -1 !important;
}
.ni-google-svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Minimal Divider ("或" / "or") matching card background */
body.ni-auth-page [data-ni-oauth-divider] span.border-t {
  border-color: rgba(15, 23, 42, 0.1) !important;
}
html.dark body.ni-auth-page [data-ni-oauth-divider] span.border-t {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
body.ni-auth-page [data-ni-or-label] {
  background: #ffffff !important;
  padding: 0 12px !important;
  font-size: 0 !important;
  text-transform: none !important;
}
html.dark body.ni-auth-page [data-ni-or-label] {
  background: #232325 !important;
}
body.ni-auth-page [data-ni-or-label]::after {
  content: attr(data-ni-or-label);
  font-size: 13px;
  color: #6b7280;
}
html.dark body.ni-auth-page [data-ni-or-label]::after {
  color: #8e8e93;
}

/* Form Labels & Inputs */
body.ni-auth-page form label {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #111827 !important;
}
html.dark body.ni-auth-page form label {
  color: #f4f4f5 !important;
}
body.ni-auth-page form input:not([type]),
body.ni-auth-page form input[type="text"],
body.ni-auth-page form input[type="email"],
body.ni-auth-page form input[type="password"] {
  height: 44px !important;
  border-radius: 14px !important;
  padding-left: 14px !important;
  padding-right: 40px !important;
  font-size: 14px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  color: #111827 !important;
  box-shadow: none !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease !important;
}
html.dark body.ni-auth-page form input:not([type]),
html.dark body.ni-auth-page form input[type="text"],
html.dark body.ni-auth-page form input[type="email"],
html.dark body.ni-auth-page form input[type="password"] {
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}
html.dark body.ni-auth-page form input::placeholder {
  color: #71717a !important;
}
body.ni-auth-page form input:focus {
  border-color: #2f81f7 !important;
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18) !important;
  outline: none !important;
}

/* Primary Blue Submit Button */
body.ni-auth-page form button[type="submit"] {
  height: 44px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  background: #2f81f7 !important;
  color: #ffffff !important;
  border: none !important;
  margin-top: 6px !important;
  box-shadow: 0 6px 20px rgba(47, 129, 247, 0.25) !important;
  transition: background-color 0.16s ease, transform 0.12s ease !important;
}
body.ni-auth-page form button[type="submit"]:hover:not(:disabled) {
  background: #2563eb !important;
}
body.ni-auth-page form button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}

@media (max-width: 480px) {
  body.ni-auth-page [data-ni-auth-card] {
    padding: 30px 22px 26px !important;
    border-radius: 22px !important;
  }
}


/* === NovaInk Model Plaza (/pricing) Price Reference === */
.ni-admin-bar {
  margin: 0 auto 14px;
  max-width: 1200px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.07);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12px;
  color: #b45309;
}
.dark .ni-admin-bar { color: #fbbf24; }
.ni-price-note {
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.85);
  font-size: 11.5px;
  line-height: 1.5;
  color: #334155;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
}
.dark .ni-price-note {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}
.ni-pill-green {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.13);
  color: #047857;
  white-space: nowrap;
}
.dark .ni-pill-green {
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
}
.ni-rmb-txt {
  font-weight: 600;
  color: #0f172a;
}
.dark .ni-rmb-txt { color: #f4f4f5; }
.ni-pill-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ni-pill-sub {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.09);
  color: #2563eb;
  white-space: nowrap;
}
.dark .ni-pill-sub {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}

/* === Apilio-Style Multi-Channel Pricing Drawer === */
.ni-native-pricing-hidden {
  display: none !important;
}
.ni-apilio-drawer {
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 6px;
}
.dark .ni-apilio-drawer {
  border-color: rgba(255, 255, 255, 0.1);
  background: #18181b;
}
.ni-apilio-refbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 9px 14px;
  font-size: 12px;
  color: #475569;
  background: rgba(37, 99, 235, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.dark .ni-apilio-refbar {
  color: #a1a1aa;
  background: rgba(59, 130, 246, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.ni-apilio-refbar strong {
  color: #0f172a;
}
.dark .ni-apilio-refbar strong {
  color: #f4f4f5;
}
.ni-ap-head {
  display: grid;
  grid-template-columns: 1.55fr 0.65fr 1.15fr 0.78fr;
  gap: 12px;
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.dark .ni-ap-head {
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.ni-ap-row {
  display: grid;
  grid-template-columns: 1.55fr 0.65fr 1.15fr 0.78fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease;
}
.dark .ni-ap-row {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
.ni-ap-row:last-child { border-bottom: none; }
.ni-ap-row:hover { background: rgba(37, 99, 235, 0.03); }
.dark .ni-ap-row:hover { background: rgba(255, 255, 255, 0.025); }
.ni-ap-ghead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ni-ap-gtitle {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.dark .ni-ap-gtitle { color: #f4f4f5; }
.ni-ap-rec {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}
.dark .ni-ap-rec {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
.ni-ap-gtag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f1f5f9;
  color: #475569;
}
.dark .ni-ap-gtag {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.ni-tag-amber { background: rgba(245, 158, 11, 0.12) !important; color: #b45309 !important; border-color: rgba(245, 158, 11, 0.28) !important; }
.dark .ni-tag-amber { color: #fbbf24 !important; }
.ni-tag-purple, .ni-tag-violet { background: rgba(139, 92, 246, 0.12) !important; color: #6d28d9 !important; border-color: rgba(139, 92, 246, 0.28) !important; }
.dark .ni-tag-purple, .dark .ni-tag-violet { color: #c4b5fd !important; }
.ni-tag-emerald { background: rgba(16, 185, 129, 0.12) !important; color: #047857 !important; border-color: rgba(16, 185, 129, 0.28) !important; }
.dark .ni-tag-emerald { color: #34d399 !important; }
.ni-ap-gdesc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.dark .ni-ap-gdesc { color: #94a3b8; }
.ni-ap-disc {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.13);
  color: #047857;
  white-space: nowrap;
}
.dark .ni-ap-disc {
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
}
.ni-ap-col-price {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ni-ap-prow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.ni-ap-plbl {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.dark .ni-ap-plbl { color: #94a3b8; }
.ni-ap-pval strong {
  color: #2563eb;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.dark .ni-ap-pval strong { color: #60a5fa; }
.ni-ap-pval small {
  color: #64748b;
  font-size: 11px;
}
.dark .ni-ap-pval small { color: #94a3b8; }
.ni-ap-col-act {
  display: flex;
  justify-content: flex-end;
}
.ni-ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.ni-ap-btn:hover {
  background: #2563eb;
  color: #ffffff !important;
}
.dark .ni-ap-btn {
  color: #93c5fd !important;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.25);
}
.dark .ni-ap-btn:hover {
  background: #3b82f6;
  color: #ffffff !important;
}
@media (max-width: 720px) {
  .ni-ap-head { display: none; }
  .ni-ap-row { grid-template-columns: 1fr; gap: 8px; }
  .ni-ap-col-act { justify-content: flex-start; }
}

/* === NovaInk Wallet (/wallet) Invoice Entry Banner === */
.ni-wallet-invoice-bar {
  margin: 0 0 16px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(59, 130, 246, 0.02));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
}
html.dark .ni-wallet-invoice-bar {
  border-color: rgba(96, 165, 250, 0.24);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.04));
}
.ni-wallet-invoice-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ni-wallet-invoice-copy strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
html.dark .ni-wallet-invoice-copy strong {
  color: #f4f4f5;
}
.ni-wallet-invoice-copy span {
  font-size: 12.5px;
  color: #475569;
}
html.dark .ni-wallet-invoice-copy span {
  color: #a1a1aa;
}
.ni-wallet-invoice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ni-wallet-invoice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #2563eb;
  color: #ffffff !important;
  border: 1px solid #2563eb;
}
.ni-wallet-invoice-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.ni-wallet-invoice-btn.admin {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309 !important;
  border-color: rgba(217, 119, 6, 0.35);
}
html.dark .ni-wallet-invoice-btn.admin {
  color: #fbbf24 !important;
}
.ni-wallet-invoice-btn.admin:hover {
  background: rgba(217, 119, 6, 0.2);
}

