/* ============================================
   Global Security - Infrastructure Securisee
   Style principal
   ============================================ */

:root {
  --primary: #0d1b2a;
  --primary-light: #1b263b;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --accent-green: #059669;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 4px;
  --radius-lg: 6px;
  --transition: all 0.15s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--primary);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
}

.header-logo .logo-icon {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
}

.header-logo .logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-logo .logo-sub {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ============ NAVIGATION ============ */
.main-nav {
  background: var(--primary-light);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-list li {
  position: relative;
}

.nav-list a {
  display: block;
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a.active {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--accent);
}

.nav-list a .nav-num {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.3rem;
  font-size: 0.75rem;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* ============ PAGE HEADER ============ */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.page-header .breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.page-header .breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.page-header .breadcrumb a:hover {
  text-decoration: underline;
}

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.page-header .page-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 400;
}

.page-header .page-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.page-header .meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--border-light);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.meta-tag.critical { background: #fde8e8; color: var(--accent-red); }
.meta-tag.high { background: #fef3e2; color: var(--accent-orange); }
.meta-tag.standard { background: #e8f5e9; color: var(--accent-green); }
.meta-tag.info { background: #e3f2fd; color: var(--accent); }

/* ============ SECTIONS ============ */
.section {
  margin-bottom: 2.5rem;
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  transition: none;
}

.section-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: none;
  display: block;
  letter-spacing: -0.01em;
}

.section-card h2 .section-icon {
  display: none;
}

.section-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.section-card h3:first-child {
  margin-top: 0;
}

.section-card p {
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* ============ LISTS ============ */
.content-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.content-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}

.content-list li:last-child {
  border-bottom: none;
}

.content-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.content-list.check li::before {
  content: '\2713';
  background: none;
  color: var(--accent-green);
  font-weight: 700;
  font-size: 0.85rem;
  top: 0.5rem;
  width: auto;
  height: auto;
}

/* ============ TABLES ============ */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: var(--primary);
  color: white;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

tbody tr:hover {
  background: #f8f9ff;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Risk colors */
.risk-critical {
  background: #fde8e8 !important;
  font-weight: 600;
  color: var(--accent-red);
}

.risk-high {
  background: #fef3e2 !important;
  font-weight: 600;
  color: var(--accent-orange);
}

.risk-medium {
  background: #fff8e1 !important;
  font-weight: 600;
  color: #f39c12;
}

.risk-low {
  background: #e8f5e9 !important;
  font-weight: 600;
  color: var(--accent-green);
}

/* ============ GRILLE NOTATION ============ */
.grading-table {
  margin: 1rem 0;
}

.grading-table table {
  font-size: 0.8rem;
}

.grading-table thead {
  background: var(--primary-light);
}

.grading-table td:first-child {
  text-align: center;
  font-weight: 700;
  width: 60px;
}

/* ============ INFO BOXES ============ */
.info-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 4px solid;
  font-size: 0.9rem;
}

.info-box.info {
  background: #e3f2fd;
  border-color: var(--accent);
  color: #1565c0;
}

.info-box.warning {
  background: #fff8e1;
  border-color: var(--accent-orange);
  color: #e65100;
}

.info-box.success {
  background: #e8f5e9;
  border-color: var(--accent-green);
  color: #2e7d32;
}

.info-box.danger {
  background: #fde8e8;
  border-color: var(--accent-red);
  color: #c62828;
}

.info-box .info-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============ DEFINITION LIST ============ */
.def-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}

.def-grid dt {
  background: var(--border-light);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.def-grid dd {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

/* ============ HOME PAGE CARDS ============ */
.home-hero {
  background: var(--bg-card);
  color: var(--text);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.home-hero h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.home-hero .hero-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.home-hero .hero-module {
  display: inline-block;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.nav-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: none;
  transition: border-color 0.15s ease;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.nav-card:hover {
  border-color: var(--accent);
  box-shadow: none;
  transform: none;
}

.nav-card .card-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.nav-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.nav-card .card-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
  flex: 1;
}

.nav-card .card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* ============ LEGEND BADGES ============ */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.critical { background: #e74c3c; }
.legend-dot.high { background: #e67e22; }
.legend-dot.medium { background: #f1c40f; }
.legend-dot.low { background: #27ae60; }

/* ============ PHASE TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 1.5rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item.critical::before { background: var(--accent-red); box-shadow: 0 0 0 2px var(--accent-red); }
.timeline-item.high::before { background: var(--accent-orange); box-shadow: 0 0 0 2px var(--accent-orange); }
.timeline-item.standard::before { background: var(--accent-green); box-shadow: 0 0 0 2px var(--accent-green); }

.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.timeline-item .timeline-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.timeline-item p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  margin-top: auto;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ============ TABLE OF CONTENTS (sidebar) ============ */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 120px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.toc h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc ul {
  list-style: none;
}

.toc ul li {
  margin-bottom: 0.4rem;
}

.toc ul a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.2rem 0;
  display: block;
  transition: var(--transition);
}

.toc ul a:hover,
.toc ul a.active {
  color: var(--accent);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-top {
    padding: 0.75rem 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-list a {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .main-content {
    padding: 1rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .section-card {
    padding: 1.25rem;
  }

  .home-hero {
    padding: 2rem 1.5rem;
  }

  .home-hero h1 {
    font-size: 1.6rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .def-grid {
    grid-template-columns: 1fr;
  }

  .def-grid dt {
    border-bottom: none;
  }

  table {
    font-size: 0.75rem;
  }

  thead th, tbody td {
    padding: 0.5rem 0.6rem;
  }
}

/* ============ PRINT ============ */
@media print {
  .site-header, .site-footer, .toc, .menu-toggle {
    display: none;
  }
  .main-content {
    max-width: 100%;
    padding: 0;
  }
  .section-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
