/* FGP Hiring Signal — V2 Design System (Stitch Implementation) */
/* Based on Signal Intelligence design tokens from Google Stitch */

:root {
  /* Surface Colors */
  --hs-surface: #12131a;
  --hs-surface-dim: #12131a;
  --hs-surface-bright: #383841;
  --hs-surface-container-lowest: #0d0e15;
  --hs-surface-container-low: #1a1b23;
  --hs-surface-container: #1e1f27;
  --hs-surface-container-high: #292932;
  --hs-surface-container-highest: #34343d;
  --hs-surface-variant: #34343d;
  --hs-background: #12131a;

  /* Primary Colors (Violet-Blue) */
  --hs-primary: #bcc2ff;
  --hs-primary-container: #7686ff;
  --hs-primary-fixed: #dfe0ff;
  --hs-primary-fixed-dim: #bcc2ff;
  --hs-on-primary: #00179b;
  --hs-on-primary-container: #001389;
  --hs-on-primary-fixed: #000b62;
  --hs-on-primary-fixed-variant: #2133b9;
  --hs-inverse-primary: #3e4fd1;
  --hs-surface-tint: #bcc2ff;

  /* Secondary Colors (Mint Green) */
  --hs-secondary: #45dfa4;
  --hs-secondary-container: #00bd85;
  --hs-secondary-fixed: #68fcbf;
  --hs-secondary-fixed-dim: #45dfa4;
  --hs-on-secondary: #003825;
  --hs-on-secondary-container: #00452e;
  --hs-on-secondary-fixed: #002114;
  --hs-on-secondary-fixed-variant: #005137;

  /* Tertiary Colors (Amber) */
  --hs-tertiary: #ffb95d;
  --hs-tertiary-container: #c98100;
  --hs-tertiary-fixed: #ffddb7;
  --hs-tertiary-fixed-dim: #ffb95d;
  --hs-on-tertiary: #462a00;
  --hs-on-tertiary-container: #3d2400;
  --hs-on-tertiary-fixed: #2a1700;
  --hs-on-tertiary-fixed-variant: #653e00;

  /* Error Colors */
  --hs-error: #ffb4ab;
  --hs-error-container: #93000a;
  --hs-on-error: #690005;
  --hs-on-error-container: #ffdad6;

  /* Text Colors */
  --hs-on-surface: #e3e1ec;
  --hs-on-surface-variant: #c5c5d6;
  --hs-on-background: #e3e1ec;
  --hs-inverse-surface: #e3e1ec;
  --hs-inverse-on-surface: #2f3038;

  /* Outline Colors */
  --hs-outline: #8f8fa0;
  --hs-outline-variant: #454654;

  /* Legacy Aliases for Compatibility */
  --hs-base: var(--hs-background);
  --hs-elevated: var(--hs-surface-container);
  --hs-border: var(--hs-outline-variant);
  --hs-border-subtle: rgba(255, 255, 255, 0.08);
  --hs-border-lit: rgba(255, 255, 255, 0.1);
  --hs-text-primary: var(--hs-on-surface);
  --hs-text-secondary: var(--hs-on-surface-variant);
  --hs-text-tertiary: var(--hs-outline);
  --hs-accent: var(--hs-secondary);
  --hs-accent-bg: rgba(69, 223, 164, 0.1);
  --hs-danger: var(--hs-error);
  --hs-danger-bg: rgba(255, 180, 171, 0.1);
  --hs-warning: var(--hs-tertiary);
  --hs-warning-bg: rgba(255, 185, 93, 0.1);

  /* Typography */
  --hs-font-display: "Syne", system-ui, sans-serif;
  --hs-font-body: "IBM Plex Sans", system-ui, sans-serif;
  --hs-font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Border Radius */
  --hs-radius-sm: 0.25rem;
  --hs-radius: 0.5rem;
  --hs-radius-md: 0.75rem;
  --hs-radius-lg: 1rem;
  --hs-radius-xl: 1.5rem;
  --hs-radius-full: 9999px;

  /* Spacing */
  --hs-grid-overlay: 64px;
  --hs-margin-desktop: 40px;
  --hs-margin-mobile: 16px;
  --hs-gutter: 24px;
  --hs-stack-unit: 8px;
}

/* ── Typography ── */
body {
  font-family: var(--hs-font-body);
  font-weight: 400;
  background: var(--hs-background);
  color: var(--hs-on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hs-mono,
.font-mono {
  font-family: var(--hs-font-mono);
}

.hs-heading,
.hs-page-header h1,
.hs-hero-title {
  font-family: var(--hs-font-display);
  color: var(--hs-on-surface);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hs-display {
  font-family: var(--hs-font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: 48px;
}

.hs-headline-lg {
  font-family: var(--hs-font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
}

.hs-headline-md {
  font-family: var(--hs-font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.hs-body {
  color: var(--hs-on-surface-variant);
  font-weight: 400;
  line-height: 1.6;
  font-size: 16px;
}

.hs-body-lg {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
}

.hs-body-sm {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.hs-meta {
  color: var(--hs-outline);
  font-size: 0.875rem;
  font-weight: 400;
}

.hs-label {
  color: var(--hs-outline);
  font-family: var(--hs-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hs-label-md {
  font-family: var(--hs-font-mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

/* ── Page Shell & Grid ── */
.hs-page {
  min-height: 100vh;
  position: relative;
  background-color: var(--hs-background);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
}

.hs-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(143, 143, 160, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 143, 160, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
}

.hs-page > header,
.hs-page > main,
.hs-page > footer,
.hs-page > dialog,
.hs-page > #modal-container,
.hs-page > div[role="status"],
.hs-page > .max-w-4xl {
  position: relative;
  z-index: 1;
}

/* ── Glass Panels (New Glassmorphism) ── */
.glass-panel,
.hs-panel {
  background: rgba(30, 31, 39, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius-lg);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.hs-panel-interactive {
  background: rgba(30, 31, 39, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius-lg);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hs-panel-interactive:hover {
  border-color: rgba(188, 194, 255, 0.4);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.28);
}

.hs-panel-elevated {
  background: var(--hs-surface-container-high);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hs-panel-muted {
  background: var(--hs-surface-container);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius);
}

/* ── Ambient Glows ── */
.violet-glow {
  filter: blur(120px);
  background: radial-gradient(circle, rgba(188, 194, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.mint-glow {
  filter: blur(120px);
  background: radial-gradient(circle, rgba(69, 223, 164, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.ai-glow {
  filter: blur(40px);
  background: radial-gradient(circle, var(--hs-primary) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

/* ── AI Signal Pulse ── */
.ai-signal-pulse {
  position: relative;
}

.ai-signal-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: var(--hs-primary);
  opacity: 0.4;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 0.4; 
  }
  50% { 
    transform: scale(1.5); 
    opacity: 0; 
  }
}

/* ── Navigation ── */
.hs-nav,
.hs-marketing-nav {
  background: rgba(18, 19, 26, 0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Buttons ── */
.hs-btn-primary {
  background: linear-gradient(135deg, var(--hs-primary-container) 0%, var(--hs-primary) 100%);
  color: var(--hs-on-primary);
  border: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(188, 194, 255, 0.2);
  transition: all 0.2s ease;
}

.hs-btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(188, 194, 255, 0.3);
}

.hs-btn-primary:active {
  transform: scale(0.98);
}

.hs-btn-accent {
  background: var(--hs-secondary);
  color: var(--hs-on-secondary);
  border: none;
  font-weight: 500;
  transition: filter 0.15s ease;
}

.hs-btn-accent:hover {
  filter: brightness(1.1);
}

.hs-btn-ghost {
  background: var(--hs-surface-container);
  color: var(--hs-on-surface);
  border: 1px solid rgba(143, 143, 160, 0.3);
  font-weight: 500;
  transition: all 0.2s ease;
}

.hs-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hs-primary);
  color: var(--hs-primary);
}

.hs-btn-danger-ghost {
  background: transparent;
  color: var(--hs-error);
  border: 1px solid rgba(255, 180, 171, 0.3);
  font-weight: 500;
}

.hs-btn-danger-ghost:hover {
  background: var(--hs-danger-bg);
}

/* ── Form Inputs ── */
.hs-input,
.input-dark {
  background-color: #050608;
  border: 1px solid rgba(143, 143, 160, 0.3);
  color: var(--hs-on-surface);
  transition: all 0.2s ease;
}

.hs-input:focus,
.input-dark:focus {
  border-color: var(--hs-primary);
  box-shadow: 0 0 0 2px rgba(188, 194, 255, 0.2);
  outline: none;
}

/* ── Badges ── */
.hs-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--hs-font-mono);
}

.hs-badge-high {
  background: rgba(69, 223, 164, 0.1);
  color: var(--hs-secondary);
  border: 1px solid rgba(69, 223, 164, 0.25);
}

.hs-badge-moderate {
  background: rgba(188, 194, 255, 0.1);
  color: var(--hs-primary);
  border: 1px solid rgba(188, 194, 255, 0.25);
}

.hs-badge-low {
  background: rgba(255, 185, 93, 0.1);
  color: var(--hs-tertiary);
  border: 1px solid rgba(255, 185, 93, 0.25);
}

.hs-badge-danger {
  background: rgba(255, 180, 171, 0.1);
  color: var(--hs-error);
  border: 1px solid rgba(255, 180, 171, 0.25);
}

.hs-badge-neutral {
  background: var(--hs-surface-container);
  color: var(--hs-outline);
  border: 1px solid var(--hs-outline-variant);
}

/* ── Tables ── */
.hs-table-wrap {
  background: rgba(30, 31, 39, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius-lg);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hs-table-wrap thead {
  background: var(--hs-surface-container-high);
}

.hs-table-wrap thead th {
  font-family: var(--hs-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hs-outline);
  border-color: rgba(255, 255, 255, 0.08);
}

.hs-table-wrap tbody tr {
  border-color: rgba(255, 255, 255, 0.08);
  transition: background 0.12s ease;
}

.hs-table-wrap tbody tr:hover {
  background: rgba(188, 194, 255, 0.03);
}

/* ── Confidence Meter ── */
.confidence-meter-fill--high { 
  background: var(--hs-secondary); 
}

.confidence-meter-fill--moderate { 
  background: var(--hs-primary); 
}

.confidence-meter-fill--low { 
  background: var(--hs-primary-fixed-dim); 
}

/* ── Evidence Quote ── */
.hs-quote {
  margin-top: 1rem;
  padding: 0.875rem 1rem 0.875rem 1.125rem;
  border-left: 2px solid var(--hs-primary);
  border-radius: 0 var(--hs-radius) var(--hs-radius) 0;
  background: rgba(188, 194, 255, 0.04);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--hs-on-surface-variant);
  font-style: italic;
}

/* ── Modals ── */
.hs-modal-box {
  background: rgba(30, 31, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--hs-radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 24px 48px rgba(0, 0, 0, 0.45);
}

dialog.modal:not([open]) {
  display: none !important;
}

dialog.modal[open] {
  position: fixed;
  inset: 0;
  margin: 0;
  max-width: none;
  max-height: none;
}

/* ── HTMX ── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request .htmx-hide { display: none; }

.htmx-added {
  animation: hs-fade-in 0.22s ease-out;
}

@keyframes hs-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Empty States ── */
.hs-empty {
  border: 1px dashed var(--hs-outline-variant);
  border-radius: var(--hs-radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--hs-outline);
}

/* ── Skeleton Loaders ── */
.hs-skeleton {
  border-radius: var(--hs-radius);
  background: linear-gradient(
    90deg,
    rgba(188, 194, 255, 0.06) 0%,
    rgba(188, 194, 255, 0.14) 50%,
    rgba(188, 194, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: hs-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes hs-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Dropzone ── */
.hs-dropzone {
  border: 2px dashed rgba(143, 143, 160, 0.3);
  border-radius: var(--hs-radius-lg);
  background: rgba(13, 14, 21, 0.3);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hs-dropzone:hover {
  border-color: rgba(188, 194, 255, 0.5);
  background: rgba(188, 194, 255, 0.05);
}

/* ── Material Icons Support ── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
