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