/* ─────────────────────────────────────────────────────────────
   c3 "Mindless" theme — Hermes dashboard sign-in page
   ai.c3lelouch.com · served at /ai-mindless.v4.css
   Injected before </head> by nginx sub_filter on NPM proxy host 16.

   Scoping: the dashboard's sign-in document is the only place a
   `.provider-form` exists (the SPA shell never contains one), so every
   rule is gated on `body:has(.provider-form)` / `html:has(.provider-form)`.
   No JS is needed: the background is the same CSS hex rendition the
   post-login SPA uses via dashboard-themes/mindless.yaml, and the
   co-branded header is built from the existing `.brand` element with
   ::before (Hermes mark) and ::after (c3lelouch emblem).

   NB: the page ships brand fonts (Collapse / Rules Compressed) and
   amber DS tokens; the tokens are overridden rather than fought, and
   no transitions are declared on anything restyled.
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── design tokens: amber DS -> Mindless ── */
html:has(.provider-form) {
  --background-base: #0b0c10;
  --background: #0b0c10;
  --midground: #ff1f4c;
  --foreground: #f1f3f9;
  --hairline: rgba(139, 44, 245, 0.18);
  --hairline-strong: rgba(139, 44, 245, 0.35);
}

body:has(.provider-form) {
  background: #0b0c10 !important;
  background-image: none !important;   /* replaces the amber dot grid */
  color: #f1f3f9 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ── background ──
      The static SVG hexagon tile that used to live here has been replaced by the
      real animated canvas (c3-hex-bg.v1.js, injected by nginx on host 16), so the
      sign-in page now shares one mesh implementation with home/books/audio and
      with the post-login dashboard. Do not re-add a ::after tile here — the two
      renditions would double up. */
/* keep the card above the background layers */
body:has(.provider-form) main {
  position: relative;
  z-index: 1;
}

/* ── co-branded header: Hermes mark | c3lelouch emblem ──
      built from the existing .brand element; its vendor wordmark text is
      replaced (font-size 0) rather than left behind */
body:has(.provider-form) .brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  font-size: 0 !important;
  color: transparent !important;
  margin-bottom: 6px;
}

body:has(.provider-form) .brand .dot {
  display: none !important;
}

/* Hermes main logo — the app's own icon artwork (mascot on its rounded tile),
   which is the mark people recognise from the desktop app and the docs */
body:has(.provider-form) .brand::before {
  content: '';
  flex: none;
  width: 92px;
  height: 92px;
  background: url('/c3-hermes-logo.v3.png') center / contain no-repeat;
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(255, 31, 76, 0.22), 0 0 0 1px rgba(139, 44, 245, 0.22);
}

/* c3lelouch emblem — the app's own name plates are hidden, so this carries
   the owner's brand */
body:has(.provider-form) .brand::after {
  content: '';
  flex: none;
  width: 148px;
  height: 81px;
  background: url('/c3-logo.v1.png') center / contain no-repeat;
  /* the emblem's near-black plate matches the page background; no blend mode is
     relied on here (see the note on the mark above) */
  filter: drop-shadow(0 0 14px rgba(255, 31, 76, 0.28));
}

/* ── card ── */
body:has(.provider-form) .card {
  background: #141622 !important;
  border: 1px solid rgba(139, 44, 245, 0.18) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 48px rgba(255, 31, 76, 0.12), 0 4px 32px rgba(0, 0, 0, 0.6) !important;
  padding: 28px 30px 24px !important;
}

body:has(.provider-form) h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 21px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: #f1f3f9 !important;
}

body:has(.provider-form) .subtitle {
  color: #8b92b0 !important;
  font-size: 13px !important;
}

body:has(.provider-form) .form-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #c9cee0 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body:has(.provider-form) .field-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #8b92b0 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.09em;
}

/* ── inputs ── */
body:has(.provider-form) .field-input {
  background: #0f1118 !important;
  border: 1px solid rgba(139, 44, 245, 0.28) !important;
  border-radius: 10px !important;
  color: #f1f3f9 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 14px !important;
  padding: 11px 14px !important;
  transition: none !important;
}

body:has(.provider-form) .field-input::placeholder {
  color: #6b7290 !important;
}

body:has(.provider-form) .field-input:focus {
  border-color: #8b2cf5 !important;
  box-shadow: 0 0 0 3px rgba(139, 44, 245, 0.18) !important;
  outline: none !important;
}

/* ── primary action ── */
body:has(.provider-form) .provider-btn {
  background: linear-gradient(135deg, #ff1f4c, #8b2cf5) !important;
  background-image: linear-gradient(135deg, #ff1f4c, #8b2cf5) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  padding: 12px 16px !important;
  box-shadow: 0 6px 20px rgba(255, 31, 76, 0.28) !important;
  transition: none !important;
  cursor: pointer;
}

body:has(.provider-form) .provider-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 26px rgba(255, 31, 76, 0.4) !important;
}

body:has(.provider-form) .provider-btn:disabled {
  opacity: 0.6;
  filter: none;
}

/* ── error box ── */
body:has(.provider-form) .form-error {
  background: rgba(255, 31, 76, 0.10) !important;
  border: 1px solid rgba(255, 31, 76, 0.35) !important;
  border-radius: 10px !important;
  color: #ff6b8a !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13px !important;
  padding: 9px 12px !important;
}

/* ── footer ── */
body:has(.provider-form) footer {
  color: #8b92b0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  border-top-color: rgba(139, 44, 245, 0.18) !important;
}

body:has(.provider-form) footer .sep {
  background: rgba(139, 44, 245, 0.35) !important;
}