/*
 * Boardroom Design System v1 — implementation of
 * design/design-system/BOARDROOM_DESIGN_SYSTEM_V1.md Part 1 (Foundations).
 *
 * Scope note: only the tokens/components actually used by M6.5's four
 * foundational surfaces (login, application shell/home, CTO workspace,
 * account/consent) are implemented here — this is not a full component
 * library. Typography: Clash Display / Inter are referenced by name per the
 * design system doc; no font files were supplied with this milestone, so
 * both fall back to their nearest safe system equivalents until real font
 * assets are provided (a gap, not a silent substitution — see the
 * implementer's final report).
 */

:root {
  /* Brand palette — design/brand-assets/style-guide/Negivu-Color-Palette.jpg,
     adopted literally per the Design System doc §1.2. */
  --boardroom-deep-space: #0A0D14;
  --boardroom-midnight: #0F1624;
  --boardroom-navy: #111E33;
  --boardroom-electric-blue: #0070FF;
  --boardroom-ai-cyan: #00E5FF;
  --boardroom-white: #FFFFFF;
  --boardroom-slate: #8B97A9;
  --boardroom-cool-gray: #5B6574;
  --boardroom-success: #22C55E;
  --boardroom-warning: #F59E0B;
  --boardroom-purple: #8B5CF6;

  /* New severity tokens proposed by the Design System doc §1.2, aligned
     with (not duplicating) specialists/monitoring.py's INFO/WARNING/HIGH/
     CRITICAL model. */
  --boardroom-high: #F97316;
  --boardroom-critical: #EF4444;
  --boardroom-danger: #EF4444;

  --font-display: "Clash Display", "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --radius: 10px;
  --shadow-card: 0 1px 3px rgba(10, 13, 20, 0.08), 0 1px 2px rgba(10, 13, 20, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--boardroom-navy);
  background: var(--boardroom-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em 0;
}

p { line-height: 1.5; }

a { color: var(--boardroom-electric-blue); }

/* Minimum 44x44px touch target on every interactive element (Design System
   §1.5), enforced generically rather than per-component. */
button, .btn, input[type="submit"], a.btn {
  min-height: 44px;
}

label { display: block; font-weight: 500; margin-bottom: 0.35em; font-size: 0.9rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  min-height: 44px;
  padding: 0.6em 0.8em;
  border: 1px solid var(--boardroom-slate);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--boardroom-white);
  color: var(--boardroom-navy);
}

input:focus {
  outline: 3px solid var(--boardroom-electric-blue);
  outline-offset: 1px;
  border-color: var(--boardroom-electric-blue);
}

.field { margin-bottom: 1.1em; }

.field-error {
  color: var(--boardroom-danger);
  font-size: 0.85rem;
  margin-top: 0.3em;
}
.field-error::before { content: "⚠ "; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--boardroom-electric-blue); color: var(--boardroom-white); }
.btn-primary:hover { background: #0060DD; }
.btn-secondary { background: transparent; color: var(--boardroom-navy); border-color: var(--boardroom-slate); }
.btn-secondary:hover { background: #F2F5F9; }
.btn-danger { background: var(--boardroom-white); color: var(--boardroom-danger); border-color: var(--boardroom-danger); }
.btn-danger:hover { background: #FEF2F2; }
.btn-block { width: 100%; }

.alert {
  border-radius: var(--radius);
  padding: 0.9em 1.1em;
  margin-bottom: 1.1em;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.alert-error { background: #FEF2F2; border-color: var(--boardroom-danger); color: #7A1E1E; }
.alert-success { background: #ECFDF5; border-color: var(--boardroom-success); color: #14532D; }
.alert-info { background: #EFF6FF; border-color: var(--boardroom-electric-blue); color: #0B3D82; }

.mfa-secret {
  display: block;
  padding: 0.75em 1em;
  margin-bottom: 1.1em;
  background: #F2F5F9;
  border: 1px solid var(--boardroom-slate);
  border-radius: var(--radius);
  font-size: 1rem;
  letter-spacing: 0.06em;
  word-break: break-all;
}

/* ---- Split-screen auth layout (login / MFA / forgot-password / invite) --- */

.auth-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: row;
}

.auth-brand {
  flex: 0 0 45%;
  background: linear-gradient(160deg, var(--boardroom-deep-space) 0%, var(--boardroom-midnight) 60%, var(--boardroom-navy) 100%);
  color: var(--boardroom-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem;
}

.auth-brand .wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.auth-brand .tagline {
  font-size: 1.35rem;
  color: var(--boardroom-white);
  max-width: 26ch;
}

.auth-brand .subtext {
  margin-top: 1rem;
  color: var(--boardroom-slate);
  max-width: 34ch;
}

.auth-form-panel {
  flex: 1 1 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--boardroom-white);
}

.auth-form-card {
  width: 100%;
  max-width: 400px;
}

.auth-form-card h1 { font-size: 1.6rem; }
.auth-form-card .subtitle { color: var(--boardroom-cool-gray); margin-bottom: 1.75rem; }

.auth-links { margin-top: 1.25rem; font-size: 0.92rem; color: var(--boardroom-cool-gray); }

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-brand {
    flex: none;
    padding: 1.75rem 1.5rem;
    text-align: left;
  }
  .auth-brand .tagline { font-size: 1.05rem; max-width: none; }
  .auth-brand .subtext { display: none; }
  .auth-form-panel { padding: 2rem 1.25rem; }
}

/* ---- Application shell (dark nav frame / light content) ---- */

.shell {
  display: flex;
  min-height: 100vh;
}

.shell-nav {
  flex: 0 0 260px;
  background: var(--boardroom-deep-space);
  color: var(--boardroom-white);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
}

.shell-nav .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.shell-nav .nav-section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--boardroom-slate);
  margin: 1.25rem 0 0.5rem 0;
}

.shell-nav a.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--boardroom-white);
  text-decoration: none;
  padding: 0.65em 0.6em;
  border-radius: 8px;
  font-size: 0.95rem;
  min-height: 44px;
}
.shell-nav a.nav-item:hover,
.shell-nav a.nav-item[aria-current="page"] {
  background: var(--boardroom-navy);
}

.shell-nav .nav-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--boardroom-navy);
}

.shell-nav .nav-footer form { margin: 0; }

.shell-nav button.nav-item-btn {
  background: none;
  border: none;
  color: var(--boardroom-white);
  width: 100%;
  text-align: left;
  padding: 0.65em 0.6em;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
}
.shell-nav button.nav-item-btn:hover { background: var(--boardroom-navy); }

.shell-main {
  flex: 1;
  background: var(--boardroom-white);
  padding: 2.5rem 3rem;
  min-width: 0;
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .shell-nav {
    flex: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
  }
  .shell-nav .wordmark { margin: 0 1rem 0 0; }
  .shell-nav .nav-section-label { display: none; }
  .shell-nav .nav-footer { margin: 0 0 0 auto; padding: 0; border: none; }
  .shell-main { padding: 1.5rem 1.25rem; }
}

/* ---- Cards / panels ---- */

.card {
  background: var(--boardroom-white);
  border: 1px solid #E4E9F0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* Dark "AI executive speaking" surface (Design System §1.3) — reserved for
   content that represents the executive's own synthesized voice, never
   business data tables/lists. Not yet used by M6.5's honest-empty-state
   copy (that's still "Boardroom describing itself", rendered on a light
   surface) — kept here for the next surface that needs it. */
.card-executive-voice {
  background: linear-gradient(160deg, var(--boardroom-deep-space), var(--boardroom-midnight));
  color: var(--boardroom-white);
  border: none;
}
.card-executive-voice .subtitle { color: var(--boardroom-slate); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--boardroom-cool-gray);
}
.empty-state h2 { color: var(--boardroom-navy); }

/* ---- Severity badges (visual layer only — the authoritative severity
   classification is specialists/monitoring.py's deterministic model; this
   is purely presentational). Never color-only: text label is required. --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-info { background: #EEF1F5; color: var(--boardroom-cool-gray); border-color: var(--boardroom-slate); }
.badge-warning { background: #FEF3C7; color: #92400E; border-color: var(--boardroom-warning); }
.badge-high { background: #FFEDD5; color: #9A3412; border-color: var(--boardroom-high); }
.badge-critical { background: #FEE2E2; color: #991B1B; border-color: var(--boardroom-critical); }
.badge-low { background: #EEF1F5; color: var(--boardroom-cool-gray); border-color: var(--boardroom-slate); }
.badge-medium { background: #FEF3C7; color: #92400E; border-color: var(--boardroom-warning); }

.finding-card summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.finding-card summary::-webkit-details-marker { display: none; }
.finding-card summary::after { content: "▸ view evidence"; color: var(--boardroom-electric-blue); font-weight: 500; font-size: 0.85rem; margin-left: 0.75em; }
.finding-card[open] summary::after { content: "▾ hide evidence"; }
.finding-meta { color: var(--boardroom-cool-gray); font-size: 0.85rem; margin: 0.35em 0 0.85em 0; }
.finding-evidence {
  margin-top: 0.85em;
  background: #F8FAFC;
  border: 1px solid #E4E9F0;
  border-radius: 8px;
  padding: 0.85em;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Consent / legal placeholder ---- */

.legal-placeholder {
  border: 1px dashed var(--boardroom-slate);
  border-radius: var(--radius);
  padding: 1rem;
  background: #F8FAFC;
  color: var(--boardroom-cool-gray);
  font-size: 0.85rem;
  font-style: italic;
  margin: 1rem 0;
}

.consent-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  margin: 1.25rem 0;
}
.consent-checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 0.1em;
  flex: 0 0 auto;
}
.consent-checkbox-row label { font-weight: 400; margin: 0; }

.page-header { margin-bottom: 1.75rem; }
.page-header .mission { color: var(--boardroom-cool-gray); }

.executive-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.executive-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--boardroom-navy);
  color: var(--boardroom-white);
  font-family: var(--font-display);
  font-weight: 700;
  flex: 0 0 auto;
}
/* Executive accent per the Design System doc §1.4's *proposed* (not yet
   James-approved) mapping — CTO=violet. Only CTO is implemented this
   milestone; other executives' accents are intentionally not hardcoded
   here until that mapping is confirmed. */
.executive-icon-cto { background: var(--boardroom-purple); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
