/* ─────────────────────────────────────────────────────────────
   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: hexagon mesh (the same rendition the SPA theme ships in
      mindless.yaml — the radial glow orb was removed on request, 2026-09-13) ── */
body:has(.provider-form)::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22150.0%22%20height%3D%22173.2%22%20viewBox%3D%220%200%20150.0%20173.2%22%3E%3Cpath%20d%3D%22M%2041.57%20-24.00%20L%2041.57%2024.00%20L%200.00%2048.00%20L%20-41.57%2024.00%20L%20-41.57%20-24.00%20L%20-0.00%20-48.00%20Z%22%20fill%3D%22none%22%20stroke%3D%22rgba%28139%2C44%2C245%2C0.09%29%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M%2041.57%2062.60%20L%2041.57%20110.60%20L%200.00%20134.60%20L%20-41.57%20110.60%20L%20-41.57%2062.60%20L%20-0.00%2038.60%20Z%22%20fill%3D%22none%22%20stroke%3D%22rgba%28139%2C44%2C245%2C0.09%29%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M%20116.57%2019.30%20L%20116.57%2067.30%20L%2075.00%2091.30%20L%2033.43%2067.30%20L%2033.43%2019.30%20L%2075.00%20-4.70%20Z%22%20fill%3D%22none%22%20stroke%3D%22rgba%28139%2C44%2C245%2C0.09%29%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M%20116.57%20105.90%20L%20116.57%20153.90%20L%2075.00%20177.90%20L%2033.43%20153.90%20L%2033.43%20105.90%20L%2075.00%2081.90%20Z%22%20fill%3D%22none%22%20stroke%3D%22rgba%28255%2C31%2C76%2C0.16%29%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  background-size: 150px 173.2px;
  pointer-events: none;
  z-index: 0;
  animation: c3HexPulse 6s ease-in-out infinite alternate;
}

@keyframes c3HexPulse {
  from { opacity: 0.5; }
  to { opacity: 0.85; }
}

/* 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;
}