/*
 * theme.css — Shared theme for Mission-Ready Cybersecurity Compliance Services
 *
 * Loaded by both login.html and portal.html.
 * To change the app's look and feel, edit ONLY this file.
 *
 * Sections:
 *   1. Reset
 *   2. CSS variables (colours, sizes)
 *   3. Shared typography & base body
 *   4. Shared components: logo, buttons, spinner, modal
 */

/* ── 1. Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── 2. CSS variables ─────────────────────────────────────────────────────── */
:root {
  /* Background layers */
  --bg:      #0F1117;
  --panel:   #1A1D27;
  --panel2:  #141720;

  /* Accent colours */
  --accent:  #4F8EF7;
  --accent2: #7C5CFC;

  /* Text */
  --text:    #E8ECF4;
  --subtext: #8891A8;

  /* Borders & state */
  --border:  #2A2D3A;
  --danger:  #FF5C5C;
  --success: #3DD68C;

  /* Nav rail (portal only — harmless to define here) */
  --nav-bg:  #4F8EF7;
  --nav-w:   52px;

  /* Typography */
  --font-sans:  'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
}

/* ── 3. Base body ─────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
}

/* ── 4. Shared components ─────────────────────────────────────────────────── */

/* Logo */
.logo-wrap img { height: 60px; width: auto; display: block; }
.logo-placeholder {
  width: 160px; height: 60px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger); font-size: 12px;
}

/* Page title */
h1 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: bold;
  color: var(--text);
}

/* Buttons */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 5px; padding: 6px 16px; font-size: 12px; font-weight: bold;
  cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent2); }

.btn-ghost {
  background: var(--panel); color: var(--subtext); border: none;
  border-radius: 5px; padding: 6px 12px; font-size: 12px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-danger {
  background: var(--panel); color: var(--danger); border: none;
  border-radius: 5px; padding: 6px 12px; font-size: 12px;
  cursor: pointer; transition: background 0.15s;
}
.btn-danger:hover { background: var(--border); }

/* Spinner (used on login loading overlay and portal process button) */
.spinner, .btn-spinner {
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner     { width: 36px; height: 36px; border-width: 3px; }
.btn-spinner { width: 14px; height: 14px; vertical-align: middle; margin-right: 6px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Modal overlay (shared reset/confirm pattern) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 36px 28px;
  min-width: 340px; max-width: 420px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.modal-icon  { font-size: 36px; margin-bottom: 12px; color: #f5a623; }
.modal-title {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: bold;
  color: var(--text); margin-bottom: 14px;
}
.modal-msg  { font-size: 13px; color: var(--subtext); line-height: 1.7; margin-bottom: 24px; }
.modal-msg strong { color: var(--text); }
.modal-actions { display: flex; justify-content: center; gap: 12px; }
.modal-actions .btn-ghost  { padding: 8px 22px; font-size: 13px; }
.modal-actions .btn-danger { padding: 8px 22px; font-size: 13px; }

/* Loading overlay (login page) */
.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  align-items: center; justify-content: center; flex-direction: column;
  gap: 16px; z-index: 100;
}
.loading-overlay.visible { display: flex; }
.loading-overlay p { color: var(--subtext); font-style: italic; font-size: 14px; }

/* Footer */
footer {
  position: fixed; bottom: 14px;
  font-size: 11px; color: var(--subtext); text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHARED LEFT NAV RAIL  (reg_user_left_nav.html)
   Injected into any page that mounts the fragment (Assess, ATO Lifecycle hub,
   future step pages). Kept here so every page renders the rail identically —
   52px icon rail with hover tooltips. Icon-only by design; the .tip labels are
   tooltips, not inline text.
   ══════════════════════════════════════════════════════════════════════════ */
#nav {
  width: var(--nav-w); min-width: var(--nav-w);
  background: var(--nav-bg);
  border-right: 1px solid #3a7be0;
  display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
}
.nav-top    { display: flex; flex-direction: column; align-items: center; padding-top: 12px; width: 100%; }
.nav-spacer { flex: 1; }
.nav-bottom { display: flex; flex-direction: column; align-items: center; padding-bottom: 12px; width: 100%; }

.nav-icon {
  position: relative; width: 100%; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: rgba(255,255,255,0.75);
  cursor: pointer; transition: background 0.12s, color 0.12s; user-select: none;
}
.nav-icon:hover        { background: rgba(0,0,0,0.15); color: #ffffff; }
.nav-icon.active       { color: #ffffff; }
.nav-icon.danger       { color: rgba(255,255,255,0.75); }
.nav-icon.danger:hover { background: rgba(0,0,0,0.15); color: #FFB3B3; }

.nav-icon .tip {
  display: none; position: absolute;
  left: calc(var(--nav-w) + 4px); top: 50%; transform: translateY(-50%);
  background: #2A2D3A; color: #ffffff; font-size: 12px;
  white-space: nowrap; padding: 4px 10px; border-radius: 4px;
  pointer-events: none; z-index: 999;
}
.nav-icon:hover .tip { display: block; }

/* ═══════ APP TOP BAR (shared chrome) ═══════════════════════════════════════
   The horizontal header used by the Assess, Home, and ATO Lifecycle pages.
   Kept here (like the nav rail) so every page renders an identical bar.        */
#content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px 12px; flex-shrink: 0;
}
#header .logo-wrap img       { height: 48px; width: auto; display: block; }
#header .logo-placeholder    {
  width: 140px; height: 48px; font-size: 11px;
  align-items: center; justify-content: center;
  color: var(--subtext); border: 1px dashed var(--border); border-radius: 6px;
}
#header .title-block         { text-align: right; }
#header h1                   { font-size: clamp(14px, 1.5vw, 20px); }
#header .tagline             { font-size: 11px; color: var(--subtext); font-style: italic; margin-top: 2px; }
#header .signout-btn {
  background: none; border: none; color: var(--subtext);
  font-size: 12px; cursor: pointer; margin-top: 6px;
  padding: 3px 8px; border-radius: 4px; transition: color 0.12s;
}
#header .signout-btn:hover { color: var(--danger); }

.header-divider { height: 1px; background: var(--border); margin: 0 26px; flex-shrink: 0; }
