/* ==========================================================================
   RÉVEIL LIBERTAIRE — Système de Design Pur Noir & Rouge (Anarcho-Solidaire)
   Palette : Noir absolu, Anthracite neutre, Rouge écarlate (Zéro nuance bleue)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Palette pure noir, gris neutre et rouge (aucun bleu) */
  --bg-deep: #080808;
  --bg-surface: #111111;
  --bg-card: #151515;
  --bg-card-hover: #1c1c1c;
  --bg-elevated: #222222;
  --bg-glass: rgba(12, 12, 12, 0.88);

  --border-subtle: #242424;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(220, 38, 38, 0.5);
  --border-focus: #ef4444;

  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-red-bright: #ef4444;
  --accent-red-glow: rgba(220, 38, 38, 0.35);
  --accent-crimson: #991b1b;

  --text-primary: #f5f5f5;
  --text-secondary: #d4d4d4;
  --text-muted: #888888;
  --text-dim: #555555;
  --text-highlight: #ffffff;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 30px rgba(220, 38, 38, 0.25);

  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 240ms cubic-bezier(0.16, 1, 0.3, 1);

  --container-max: 1160px;
  --container-narrow: 840px;
}

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

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Fond 100% neutre noir et rouge, aucune composante bleue */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(220, 38, 38, 0.16), transparent 70%),
    radial-gradient(circle at 10% 40%, rgba(153, 27, 27, 0.08), transparent 45%),
    linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
}

/* Accessibilité au focus */
:focus-visible {
  outline: 2px solid var(--accent-red-bright);
  outline-offset: 3px;
}

/* Typographie */
h1, h2, h3, h4, h5 {
  color: var(--text-highlight);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.2rem, 4vw, 2.2rem);
  padding-right: clamp(1.2rem, 4vw, 2.2rem);
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* Header */
.site-header {
  position: relative;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-normal);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  position: relative;
}

.brand-logo {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid var(--accent-red);
  background: #000;
  box-shadow: 0 0 10px var(--accent-red-glow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.brand-link:hover .brand-logo {
  transform: scale(1.05);
  box-shadow: 0 0 18px var(--accent-red);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-title span {
  color: var(--accent-red);
}

.brand-subtitle {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.4rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-red);
  transition: width var(--transition-normal);
  border-radius: var(--radius-full);
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-repo-item {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Sélecteur de langue */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  flex-shrink: 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-red-glow);
}

/* Bouton Codeberg officiel dans la navbar */
.codeberg-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: #2185d0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.codeberg-nav-btn:hover {
  color: #ffffff;
  background: #2185d0;
  border-color: #2185d0;
  box-shadow: 0 0 14px rgba(33, 133, 208, 0.45);
  transform: translateY(-1px);
}

/* Boutons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-crimson) 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px var(--accent-red-glow);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(220, 38, 38, 0.45);
  background: linear-gradient(135deg, var(--accent-red-bright) 0%, var(--accent-red) 100%);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Badge de statut : Rouge et noir (zéro jaune) */
.capacity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #fca5a5;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.4rem;
  text-transform: uppercase;
}

.status-dot-red {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
  animation: pulse-red 2.4s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Hero Section — Parfaitement cadrée sur le premier écran (Zéro coupure en bas) */
.hero-section {
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  display: flex;
  align-items: center;
  padding: 1.5rem 0 3rem;
  position: relative;
  box-sizing: border-box;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2.2rem;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.8rem;
  }
}

.capacity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #fca5a5;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}

.status-dot-red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulse-red 2.4s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: #ffffff;
  line-height: 1.2;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #fca5a5 0%, #dc2626 60%, #991b1b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(0.96rem, 1.4vw, 1.08rem);
  line-height: 1.6;
  color: #d4d4d4;
  margin-bottom: 1.3rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 960px) {
  .hero-cta-group {
    justify-content: center;
  }
}

/* Email Box */
.email-copy-box {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.4rem 0.3rem 0.95rem;
  box-shadow: var(--shadow-sm);
}

.email-address {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #f5f5f5;
}

.btn-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Terminal Simulator (Compact & Sleek) */
.terminal-card {
  background: #0d0d0d;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: left;
}

.terminal-header {
  background: #141414;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #dc2626; }
.terminal-dots span:nth-child(2) { background: #444444; }
.terminal-dots span:nth-child(3) { background: #888888; }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.term-badge {
  display: inline-block;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
}

.terminal-body {
  padding: 1.1rem;
  color: #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  line-height: 1.5;
}

.term-line {
  display: flex;
  gap: 0.5rem;
}

.term-prompt {
  color: var(--accent-red-bright);
  font-weight: 700;
}

.term-red {
  color: #fca5a5;
}

.term-dim {
  color: var(--text-dim);
}

/* Trust Bar (Compact, Directly Visible Above the Fold) */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.trust-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: border-color var(--transition-fast);
}

.trust-item:hover {
  border-color: var(--border-highlight);
}

.trust-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-red-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  font-size: 0.88rem;
  color: #fff;
  line-height: 1.25;
}

.trust-item span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 3.6rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-red-bright);
  margin-bottom: 0.8rem;
  background: rgba(220, 38, 38, 0.12);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
}

.section-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 1rem;
}

/* Grille Cartes */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-red-bright);
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card-features {
  list-style: none;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-features li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-features li svg {
  color: var(--accent-red-bright);
  flex-shrink: 0;
}

/* Featured Card: Auto-Hébergement */
.card-featured {
  border-color: rgba(220, 38, 38, 0.4);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.1) 0%, var(--bg-card) 60%);
  position: relative;
  overflow: hidden;
  padding: 2.8rem;
}

.card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #dc2626, #ef4444, #991b1b);
}

.badge-featured {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

/* Conditions & Sécurité */
.security-intro-box {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  margin-bottom: 2.8rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.security-intro-icon {
  color: var(--accent-red-bright);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.security-intro-text h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
  color: #fff;
}

.security-intro-text p {
  font-size: 0.96rem;
  color: #d4d4d4;
  line-height: 1.65;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

@media (max-width: 768px) {
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }
}

.rule-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.rule-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
}

.rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.rule-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--accent-red-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rule-number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-red-bright);
  background: rgba(220, 38, 38, 0.14);
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

.rule-title {
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
}

.rule-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #d4d4d4;
}

/* Process Steps */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  margin-top: 2rem;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.7rem;
  transition: border-color var(--transition-fast);
}

.step-card:hover {
  border-color: var(--border-highlight);
}

.step-index {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-red);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-red-glow);
}

.step-body h4 {
  font-size: 1.18rem;
  margin-bottom: 0.4rem;
}

.step-body p {
  font-size: 0.94rem;
  line-height: 1.65;
}

/* Template Box */
.email-template-box {
  background: #0c0c0c;
  border: 1px dashed rgba(220, 38, 38, 0.4);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 2.8rem;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.template-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #d4d4d4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.template-content {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #e5e5e5;
  background: #141414;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  line-height: 1.65;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Dialog CGU & RGPD (Discrète mais 100% blindée) */
dialog#legalModal {
  max-width: 880px;
  width: 92vw;
  max-height: 86vh;
  margin: auto;
  background: #0f0f0f;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(220, 38, 38, 0.2);
  padding: 0;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

dialog#legalModal::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.modal-header {
  padding: 1.3rem 1.8rem;
  background: #161616;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #e5e5e5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-red);
  color: #fff;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(86vh - 75px);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  line-height: 1.7;
  font-size: 0.94rem;
}

.legal-article {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1.5rem;
}

.legal-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.legal-article h4 {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.6rem;
}

.legal-article ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-article li {
  color: var(--text-secondary);
}

/* Footer (Discret, tout en bas avec CGU/RGPD) */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #080808;
  padding: 3.5rem 0 2.2rem;
  margin-top: auto;
  font-size: 0.88rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-red);
}

.footer-meta {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.86rem;
  cursor: pointer;
}

.footer-links a:hover {
  color: var(--accent-red-bright);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  gap: 1rem;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.footer-legal-links button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.footer-legal-links button:hover {
  color: #fff;
}

.codeberg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.codeberg-badge:hover {
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #141414;
  color: #ffffff;
  border: 1px solid var(--accent-red);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 2000;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile elements hidden on desktop */
.mobile-cta-item {
  display: none;
}

.mobile-menu-toggle {
  display: none;
}

/* ==========================================================================
   Responsive Mobile & Tablet Design System (100% Adaptatif)
   ========================================================================== */

@media (max-width: 1040px) {
  .nav-menu {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
  }

  .mobile-menu-toggle:hover {
    border-color: var(--accent-red);
  }

  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #111111;
    border-bottom: 2px solid var(--accent-red);
    padding: 1.6rem 1.4rem;
    gap: 1.2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    z-index: 999;
  }

  .nav-menu.open .nav-link {
    font-size: 1.05rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .mobile-repo-item {
    display: block;
  }

  .mobile-cta-item {
    display: block;
    margin-top: 0.6rem;
  }

  .nav-cta-btn {
    display: none; /* Masqué sur petit écran dans la barre fixe pour éviter tout débordement */
  }

  .hero-section {
    min-height: auto;
    padding: 2.2rem 0 3rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: clamp(0.85rem, 4vw, 1.25rem);
    padding-right: clamp(0.85rem, 4vw, 1.25rem);
  }

  .nav-wrap {
    height: 62px;
    gap: 0.6rem;
  }

  .nav-menu.open {
    top: 62px;
    max-height: calc(100vh - 62px);
    max-height: calc(100dvh - 62px);
    padding: 1.2rem 1rem;
  }

  .brand-title {
    font-size: 1.08rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
  }

  .hero-section {
    padding: 1.5rem 0 2.5rem;
  }

  .hero-title {
    font-size: clamp(1.65rem, 6.8vw, 2.2rem);
    line-height: 1.22;
  }

  .hero-description {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-secondary {
    width: 100%;
  }

  .email-copy-box {
    width: 100%;
    justify-content: space-between;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  }

  .email-address {
    font-size: 0.82rem;
    word-break: break-all;
  }

  .trust-bar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 1.5rem;
  }

  .trust-item {
    padding: 0.65rem 0.75rem;
    gap: 0.6rem;
  }

  .trust-icon {
    width: 30px;
    height: 30px;
  }

  .trust-icon svg {
    width: 17px;
    height: 17px;
  }

  .trust-item strong {
    font-size: 0.82rem;
  }

  .trust-item span {
    font-size: 0.72rem;
  }

  .section {
    padding: 3.2rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 5.5vw, 1.95rem);
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .card {
    padding: 1.4rem 1.15rem;
  }

  .card-featured {
    padding: 1.5rem 1.15rem;
  }

  .badge-featured {
    position: static;
    display: inline-block;
    margin-bottom: 0.9rem;
    align-self: flex-start;
  }

  .security-intro-box {
    flex-direction: column;
    padding: 1.2rem 1rem;
    gap: 0.8rem;
  }

  .step-card {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.2rem 1rem;
  }

  .step-index {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .email-template-box {
    padding: 1.2rem 1rem;
  }

  .template-content {
    font-size: 0.76rem;
    padding: 0.85rem;
    overflow-x: auto;
    max-width: 100%;
    word-break: break-word;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-links {
    justify-content: center;
    flex-direction: column;
    gap: 0.8rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.2rem;
  }

  .footer-legal-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
  }

  dialog#legalModal {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 0.9rem 1rem;
  }

  .modal-title {
    font-size: 1rem;
  }

  .modal-body {
    padding: 1rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 440px) {
  .nav-wrap {
    gap: 0.4rem;
  }

  .brand-link {
    gap: 0.6rem;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.96rem;
  }

  .brand-logo-wrap {
    width: 32px;
    height: 32px;
  }

  .nav-actions {
    gap: 0.45rem;
  }

  .lang-switcher {
    padding: 2px;
  }

  .lang-btn {
    padding: 2px 5px;
    font-size: 0.7rem;
  }

  .codeberg-nav-btn {
    width: 32px;
    height: 32px;
  }

  .mobile-menu-toggle {
    width: 34px;
    height: 34px;
  }

  .terminal-card {
    font-size: 0.72rem;
  }

  .terminal-title {
    font-size: 0.65rem;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .terminal-body {
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .terminal-header {
    padding: 0.4rem 0.75rem;
  }

  .hero-title {
    font-size: clamp(1.45rem, 6.5vw, 1.8rem);
  }

  .hero-description {
    font-size: 0.88rem;
  }
}

@media (max-width: 340px) {
  .brand-title {
    font-size: 0.88rem;
  }

  .lang-btn {
    padding: 2px 4px;
    font-size: 0.65rem;
  }

  .terminal-title {
    max-width: 120px;
  }
}
