/* ============================================================
   CyberSecQ — Design System v2.0
   Aesthetic: Dark terminal / tactical intelligence
   Font: Syne (display) + DM Mono (code) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&display=swap');

/* -- Variables ----------------------------------------------- */
:root {
  --bg:          #060a0f;
  --bg2:         #0b1018;
  --surface:     #0f1620;
  --surface2:    #161f2e;
  --border:      #1c2b3a;
  --border2:     #243344;
  --accent:      #00e5a0;
  --accent-dim:  rgba(0,229,160,.12);
  --accent-glow: rgba(0,229,160,.25);
  --blue:        #38bdf8;
  --blue-dim:    rgba(56,189,248,.10);
  --danger:      #f43f5e;
  --text:        #dde6f0;
  --muted:       #5a7080;
  --muted2:      #3d5263;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius:       8px;
  --radius-lg:    14px;
  --transition:   0.18s ease;
}

/* -- Reset / Base -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

pre {
  display: block;
  padding: 14px 16px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: keep-all;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: #fff;
  margin-top: 0;
}

/* -- Noise texture overlay ----------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.container { position: relative; z-index: 1; }

/* -- Bootstrap overrides ------------------------------------- */
.container { max-width: 1060px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
}
.card-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 20px;
}
.card-header.text-white.bg-primary {
  background: var(--surface2) !important;
  color: var(--accent) !important;
}
.card-body { padding: 24px; }
.card-footer {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  padding: 14px 20px;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  transition: all var(--transition);
  padding: 9px 20px;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #060a0f;
  border: none;
}
.btn-primary:hover {
  background: #fff;
  color: #060a0f;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover {
  background: var(--border2);
  color: #fff;
}
.btn-outline-light {
  border: 1px solid var(--border2);
  color: var(--muted);
  background: transparent;
}
.btn-outline-light:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Forms */
.form-control {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  background: var(--surface2);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  color: var(--text);
  outline: none;
}
.form-control::placeholder { color: var(--muted2); }
label, .col-form-label { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-text.text-muted { color: var(--muted2) !important; font-size: 12px; }
select.form-control { appearance: none; cursor: pointer; }
.invalid-feedback { color: var(--danger); font-size: 12px; }
.was-validated .form-control:invalid { border-color: var(--danger); }

/* Checkboxes */
.form-check { margin-bottom: 8px; }
.form-check-input {
  width: 16px; height: 16px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--accent);
  margin-top: 3px;
}
.form-check-label {
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding-left: 4px;
}
.form-check-input:disabled { opacity: 0.35; cursor: not-allowed; }
.form-check-input:disabled + .form-check-label { opacity: 0.4; }

/* Alerts */
.alert {
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14px;
  padding: 12px 16px;
}
.alert-success { background: rgba(0,229,160,.08); border-color: rgba(0,229,160,.25); color: var(--accent); }
.alert-danger  { background: rgba(244,63,94,.08);  border-color: rgba(244,63,94,.25);  color: #fca5a5; }
.alert-warning { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); color: #fde68a; }
.alert-info    { background: var(--blue-dim);       border-color: rgba(56,189,248,.25); color: var(--blue); }

/* Modals */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  color: var(--text);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}
.modal-body { padding: 24px; }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
.modal .close {
  color: var(--muted);
  opacity: 1;
  font-size: 20px;
  background: none;
  border: none;
}
.modal .close:hover { color: #fff; }
.modal-backdrop.show { opacity: 0.7; }

/* Dropdowns */
.dropdown-menu {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  padding: 6px;
}
.dropdown-item {
  color: var(--text);
  border-radius: 5px;
  font-size: 14px;
  padding: 8px 12px;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--border2); color: #fff; }

/* Tooltips */
.tooltip-inner {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 12px;
}

/* -- Navbar -------------------------------------------------- */
.csq-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6,10,15,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  margin-bottom: 0;
}
.csq-nav .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff !important;
  height: auto;
  line-height: 1;
  text-decoration: none;
}
.csq-nav .navbar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.csq-nav .brand-accent { color: var(--accent); }
.csq-nav .navbar-nav { flex-direction: row; align-items: center; gap: 4px; margin: 0; }
.csq-nav .nav-link {
  color: var(--muted) !important;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px !important;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.csq-nav .nav-link:hover { color: #fff !important; background: var(--surface2); }
.csq-nav .nav-btn {
  background: var(--accent);
  color: #060a0f !important;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px !important;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.csq-nav .nav-btn:hover { background: #fff; transform: none; }
.csq-nav .nav-btn-outline {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid rgba(0,229,160,.4);
}
.csq-nav .nav-btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent) !important;
  border-color: var(--accent);
}
.csq-nav .navbar-toggler {
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius);
}
.csq-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(90,112,128,1)' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 991px) {
  .csq-nav { flex-wrap: wrap; height: auto; padding: 12px 16px; }
  .csq-nav .navbar-collapse { width: 100%; padding: 12px 0 4px; border-top: 1px solid var(--border); margin-top: 10px; }
  .csq-nav .navbar-nav { flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; }
  .csq-nav .nav-link { width: 100%; }
}

/* -- Hero Section -------------------------------------------- */
.csq-hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.csq-hero::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,229,160,.07) 0%, transparent 70%);
  pointer-events: none;
}
.csq-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,160,.2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.csq-hero-tag .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

.csq-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: 18px;
}
.csq-hero h1 .hl  { color: var(--accent); }
.csq-hero h1 .hl2 { color: var(--blue); }
.csq-hero-sub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 32px;
}
.csq-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 52px; }
.btn-hero-primary {
  background: var(--accent);
  color: #060a0f;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.btn-hero-primary:hover {
  background: #fff;
  color: #060a0f;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-hero-secondary {
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.btn-hero-secondary:hover { border-color: var(--muted); color: #fff; }

/* Stats strip */
.csq-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 56px;
}
.csq-stat {
  background: var(--surface);
  padding: 20px 16px;
  text-align: center;
  transition: background var(--transition);
}
.csq-stat:hover { background: var(--surface2); }
.csq-stat-n {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
}
.csq-stat-l { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 575px) {
  .csq-stats { grid-template-columns: repeat(2, 1fr); }
}

/* -- Section labels ------------------------------------------ */
.csq-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.csq-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* -- Cert blocks --------------------------------------------- */
.csq-cert-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}
.csq-cert-block:hover { border-color: var(--border2); }
.csq-cert-block-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.csq-cert-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.csq-cert-icon.green { background: rgba(0,229,160,.1); }
.csq-cert-icon.blue  { background: rgba(56,189,248,.1); }
.csq-cert-icon.red   { background: rgba(244,63,94,.1);  }
.csq-cert-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin: 0;
}
.csq-cert-sub { font-size: 12px; color: var(--muted); margin: 0; }
.csq-cert-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.badge-free { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,229,160,.2); }
.badge-pro  { background: rgba(244,63,94,.1); color: #fca5a5; border: 1px solid rgba(244,63,94,.2); }

/* -- Quiz configurator card ---------------------------------- */
.csq-configurator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
}
.csq-configurator-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.csq-configurator-header .dot { width: 8px; height: 8px; border-radius: 50%; }
.csq-configurator-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .05em;
  margin-left: 4px;
}
.csq-configurator-body { padding: 24px; }

/* -- Select/checkbox groups ---------------------------------- */
.csq-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.csq-select-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  width: 120px;
  flex-shrink: 0;
}
.csq-group-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Question count select */
#number-of-questions {
  max-width: 220px;
}

/* -- Quiz question view --------------------------------------- */
#quiz .card, .question-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.question-result .card-header,
#quiz .card-header {
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}
#question pre {
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

/* -- Footer -------------------------------------------------- */
.csq-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.csq-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.csq-footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin-bottom: 6px;
}
.csq-footer-brand span { color: var(--accent); }
.csq-footer-copy { font-size: 12px; color: var(--muted); }
.csq-footer-links { display: flex; flex-direction: column; gap: 6px; }
.csq-footer-links a { font-size: 13px; color: var(--muted); transition: color var(--transition); }
.csq-footer-links a:hover { color: var(--accent); }
.csq-footer-about {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 380px;
}
.csq-footer-about li { margin-bottom: 6px; list-style: none; padding-left: 16px; position: relative; }
.csq-footer-about li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

/* -- Utility ------------------------------------------------- */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--muted) !important; }
.font-mono   { font-family: var(--font-mono); }
.mt-section  { margin-top: 48px; }

/* nav-link in main nav (Bootstrap override for non-csq-nav contexts) */
.navbar-nav .nav-link { padding: .5rem 1rem; }

/* spinner */
.spinner-border { width: 1rem; height: 1rem; border-width: 2px; }

/* user alert bar */
.user-alert { margin-bottom: 16px; }

/* -- Cert icon abbreviation (replaces emoji) ------------------ */
.csq-cert-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cert-abbr {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1.2;
  text-align: center;
}
.csq-cert-icon.green .cert-abbr { color: var(--accent); }
.csq-cert-icon.blue  .cert-abbr { color: var(--blue); }
.csq-cert-icon.red   .cert-abbr { color: #fca5a5; }

/* -- Set badges ----------------------------------------------- */
.set-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: .04em;
}
.set-badge-pro  { background: rgba(244,63,94,.1);  color: #fca5a5; border: 1px solid rgba(244,63,94,.2); }
.set-badge-lock { background: rgba(90,112,128,.1); color: var(--muted); border: 1px solid var(--border2); }
.set-badge-warn { background: rgba(251,191,36,.1); color: #fde68a; border: 1px solid rgba(251,191,36,.2); }

.set-row-link { text-decoration: none; display: flex; align-items: flex-start; gap: 6px; }
.set-row-link .form-check-label { cursor: pointer; }

/* -- Hero mobile padding fix ---------------------------------- */
.csq-hero { padding-left: 0; padding-right: 0; }

/* -- Section label spacing ------------------------------------ */
.csq-section-label { padding: 0; }

/* -- Cert block set rows -------------------------------------- */
.csq-cert-block .row { row-gap: 4px; }
.csq-cert-block .col-6,
.csq-cert-block .col-sm-4,
.csq-cert-block .col-md-3 { margin-bottom: 4px; }