/* ==========================================================================
   fae-tool.css : Fae Intelligence shared TOOL skin (dark, "Spruce & Pearl")
   ==========================================================================
   The single style standard for tool pages. Load order matters:
     1. /static/fae-shell.css   (brand tokens; synced copy, never edit)
     2. /static/fae-tool.css    (this file: the dark tool skin on those tokens)

   Pages must NOT define their own palettes. Page-level <style> blocks hold
   layout only, and reference the variables below for every color. The values
   here mirror templates/index.html, which established this skin: the
   standard IS the existing look, extracted so no page manages it locally.

   Shared header markup lives in templates/_fae_header.html; include it with
   {% include "_fae_header.html" %} (optionally after a
   {% set fae_header_nav %}...{% endset %} block for right-side controls).
   ========================================================================== */

:root {
  /* App-level names mapped onto brand tokens (same map as index.html). */
  --bg-primary: var(--fae-ink-950, #081d20);
  --bg-secondary: var(--fae-ink-900, #0d3134);
  --bg-tertiary: var(--fae-ink-800, #14464a);
  --border: var(--fae-ink-700, #1d5b60);
  --text-primary: var(--fae-text-on-dark, #ffffff);
  --text-secondary: var(--fae-text-muted-on-dark, #c7d6d2);
  --accent: var(--fae-teal-300, #7de3d8);        /* accent text/borders on dark (>= 5.1:1) */
  --accent-solid: var(--fae-teal-700, #0c6b63);  /* solid CTA fills: white text passes 6.3:1 */
  --accent-hover: var(--fae-teal-800, #094f49);  /* hover state for solid CTA fills */
  --accent-tint: rgba(125, 227, 216, 0.1);       /* subtle teal wash for chips/notes */
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
}

/* --------------------------------------------------------------------------
   Page scaffold: put class="fae-tool-page" on <body>
   -------------------------------------------------------------------------- */
.fae-tool-page {
  margin: 0;
  font-family: var(--fae-font, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Fraunces display treatment for page headings (index.html pattern).
   Use .fae-heading to opt other elements in. */
.fae-tool-page h1,
.fae-heading {
  font-family: var(--fae-font-display, 'Fraunces', Georgia, 'Times New Roman', serif);
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Tool header bar (dragonfly mark + "Fae Intelligence | Root Cause Analyzer")
   -------------------------------------------------------------------------- */
.fae-tool-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.fae-tool-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.fae-tool-header__mark {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}
.fae-tool-header__title {
  font-family: var(--fae-font-display, 'Fraunces', Georgia, 'Times New Roman', serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
.fae-tool-header__title span { color: var(--accent); }
.fae-tool-header__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 600px) {
  .fae-tool-header__title { font-size: 13px; }
}

/* --------------------------------------------------------------------------
   Buttons: base chip (secondary), solid teal primary, transparent outline
   -------------------------------------------------------------------------- */
.fae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fae-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.fae-btn--primary {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: #ffffff;
}
.fae-btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}
.fae-btn--outline { background: transparent; }
.fae-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Panels / cards on dark
   -------------------------------------------------------------------------- */
.fae-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fae-panel--inset {
  background: var(--bg-tertiary);
  border-radius: 8px;
}
/* Teal top rule: the featured-card signature (index.html paid tiers). */
.fae-panel--featured { border-top: 2px solid var(--fae-teal-500, #2fa79b); }

/* --------------------------------------------------------------------------
   Text helpers
   -------------------------------------------------------------------------- */
.fae-link { color: var(--accent); text-decoration: none; }
.fae-link:hover { text-decoration: underline; }
.fae-muted { color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   Badges (pill chips, index.html header-badge pattern)
   -------------------------------------------------------------------------- */
.fae-badge {
  display: inline-block;
  font-size: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  color: var(--text-secondary);
}
.fae-badge--accent {
  background: var(--accent-tint);
  border-color: rgba(125, 227, 216, 0.3);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Form inputs on dark
   -------------------------------------------------------------------------- */
.fae-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.fae-input:focus { border-color: var(--accent); }

/* --------------------------------------------------------------------------
   Focus visibility on dark (WCAG 2.4.7)
   -------------------------------------------------------------------------- */
.fae-tool-page a:focus-visible,
.fae-tool-page button:focus-visible,
.fae-tool-page input:focus-visible {
  outline: 3px solid var(--fae-teal-300, #7de3d8);
  outline-offset: 2px;
}
