/* ============================================================
   MyWebERP-WWW – Styles personnalisés optimisés
   Basé sur Bootstrap 5.3.7 avec palette MyWebERP
   ============================================================ */

/* ── Variables CSS & Typographie ───────────────────────── */
:root {
  /* Couleurs principales du logo MyWebERP */
  --mwe-primary: #396aaa;
  --mwe-primary-light: #5d8bcc;
  --mwe-primary-dark: #2a4d7a;
  --mwe-primary-50: rgba(57, 106, 170, 0.5);
  --mwe-primary-25: rgba(57, 106, 170, 0.25);
  
  /* Vert DSI.BZH */
  --mwe-success: #286751;
  --mwe-success-light: #3d8a6c;
  --mwe-success-dark: #1e4a3a;
  --mwe-success-50: rgba(40, 103, 81, 0.5);
  --mwe-success-25: rgba(40, 103, 81, 0.25);
  
  /* Gris neutre */
  --mwe-gray: #818384;
  --mwe-gray-light: #a1a3a4;
  --mwe-gray-dark: #616364;
  
  /* Couleurs dérivées */
  --mwe-accent: #396aaa;
  --mwe-info: #396aaae6;
  --mwe-warning: #f59e0b;
  --mwe-danger: #ef4444;
  
  /* Arrière-plans */
  --mwe-light-bg: #f8fafc;
  --mwe-surface-muted: #f8f9fb;
  --mwe-white: #ffffff;
  --mwe-black: #1e293b;
  --mwe-text: #1e293b;
  --mwe-text-muted: #64748b;
  --mwe-border: #e2e8f0;
  --mwe-border-strong: #cdd3dc;
  --mwe-text-subtle: #98a2b3;
  --mwe-control-radius: 3px;
  
  /* Gradient principal */
  --mwe-gradient-primary: linear-gradient(135deg, #396aaa 0%, #2a4d7a 100%);
  --mwe-gradient-success: linear-gradient(135deg, #286751 0%, #1e4a3a 100%);
  --mwe-gradient-light: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  
  /* Shadow */
  --mwe-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --mwe-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --mwe-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --mwe-shadow-primary: 0 8px 24px rgba(57, 106, 170, 0.2);
  --mwe-shadow-success: 0 8px 24px rgba(40, 103, 81, 0.2);
}

/* Override Bootstrap colors */
:root {
  --bs-primary: var(--mwe-primary);
  --bs-primary-bg-subtle: var(--mwe-primary-25);
  --bs-success: var(--mwe-success);
  --bs-success-bg-subtle: var(--mwe-success-25);
  --bs-gray-600: var(--mwe-gray);
  --bs-info: var(--mwe-info);
  --bs-warning: var(--mwe-warning);
  --bs-danger: var(--mwe-danger);
  --bs-light: var(--mwe-light-bg);
  --bs-dark: var(--mwe-black);
  --bs-white: var(--mwe-white);
  --bs-body-color: var(--mwe-text);
  --bs-body-bg: var(--mwe-white);
  --bs-border-color: var(--mwe-border);
}

/* ── Base Styles ───────────────────────────────────────── */
html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--mwe-text);
  background-color: var(--mwe-white);
  line-height: 1.6;
}

/* Certains navigateurs ne chargent pas correctement Inter depuis Google Fonts */
@supports (font: -apple-system) and (font-feature-settings: normal) {
  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
}

/* Amélioration de la lisibilité */
p {
  margin-bottom: 1rem;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  min-height: 56px;
  background: var(--mwe-white) !important;
  border-bottom: 1px solid var(--mwe-border);
  box-shadow: none !important;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--mwe-shadow-sm) !important;
}

.navbar .container {
  min-height: 56px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  letter-spacing: -0.5px;
}

.navbar-brand img {
  width: auto;
  height: auto;
  max-width: 190px;
  max-height: 44px;
  object-fit: contain;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 0.2s ease;
}

.navbar-brand img:hover {
  transform: scale(1.02);
}

.bg-orange {
  background-color: #b45309 !important;
}

.border-orange {
  border-color: #b45309 !important;
}

.text-orange {
  color: #b45309 !important;
}

.bg-teal {
  background-color: #0f766e !important;
}

.border-teal {
  border-color: #0f766e !important;
}

.text-teal {
  color: #0f766e !important;
}

.navbar.navbar-dark .navbar-nav .nav-link,
.navbar .navbar-nav .nav-link {
  color: var(--mwe-text-muted) !important;
  font-size: 0.9333rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar.navbar-dark .navbar-nav .nav-link:hover,
.navbar.navbar-dark .navbar-nav .nav-link:focus,
.navbar.navbar-dark .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link.active {
  color: var(--mwe-primary-dark) !important;
}

.navbar .btn-outline-light {
  color: var(--mwe-primary) !important;
  border-color: var(--mwe-primary) !important;
  border-radius: var(--mwe-control-radius);
  transition: all 0.2s ease;
}

.navbar .btn-outline-light:hover {
  color: var(--mwe-white) !important;
  background: var(--mwe-primary) !important;
  transform: translateY(-1px);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--mwe-primary);
}

.navbar-collapse {
  padding: 0.75rem 0;
  border-top: 1px solid var(--mwe-border);
}

/* ── Hero Section ──────────────────────────────────────── */
.hero-section {
  background: var(--mwe-light-bg);
  border-bottom: 1px solid var(--mwe-border);
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 10% 20%, rgba(57, 106, 170, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(40, 103, 81, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.hero-section h1,
.page-header h1 {
  color: var(--mwe-text);
  letter-spacing: 0;
}

.hero-title {
  font-size: 2.6rem;
  text-align: center;
  line-height: 1.1;
}

.hero-title-line {
  display: block;
}

.hero-title-line > .text-primary {
  font-size: 1.65rem;
  line-height: 1;
  position: relative;
  display: inline-block;
}

.hero-brand-logo {
  display: inline-block;
  width: 170px;
  height: auto;
  vertical-align: middle;
}

.hero-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header-branded {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(57, 106, 170, 0.14), transparent 48%),
    linear-gradient(300deg, rgba(40, 103, 81, 0.12), transparent 52%),
    var(--mwe-light-bg);
}

.page-header-branded::after {
  position: absolute;
  right: 8%;
  bottom: -80px;
  width: 42%;
  height: 160px;
  content: "";
  border-top: 1px solid rgba(57, 106, 170, 0.2);
  border-bottom: 1px solid rgba(40, 103, 81, 0.16);
  transform: skewX(-28deg);
  pointer-events: none;
}

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

.page-header-branded .lead {
  color: var(--mwe-primary) !important;
  opacity: 1 !important;
}

.hero-section .lead,
.page-header .lead {
  color: var(--mwe-text-muted) !important;
  font-size: 1.15rem;
}

/* Hero illustration */
.hero-illustration {
  background: var(--mwe-white);
  padding: 1rem !important;
  border-radius: 0 !important;
  border: 1px solid var(--mwe-border) !important;
  box-shadow: none !important;
  transition: all 0.3s ease;
}

.hero-illustration:hover {
  border-color: var(--mwe-primary-light) !important;
  box-shadow: var(--mwe-shadow) !important;
}

.hero-illustration .stat-card,
.module-icon,
.feature-icon {
  border-radius: var(--mwe-control-radius) !important;
}

.hero-illustration .stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--mwe-border);
}

.hero-illustration .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--mwe-shadow-primary);
  border-color: var(--mwe-primary-light);
}

/* Custom stat card colors using logo colors */
.stat-card.bg-primary {
  background: var(--mwe-primary) !important;
}

.stat-card.bg-success {
  background: var(--mwe-success) !important;
}

.stat-card.bg-info {
  background: var(--mwe-info) !important;
}

/* ── Feature Cards ──────────────────────────────────────── */
.feature-card {
  border-radius: 0 !important;
  border: 1px solid var(--mwe-border) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  background: var(--mwe-white) !important;
}

.feature-card:hover {
  box-shadow: var(--mwe-shadow-lg) !important;
  transform: translateY(-4px);
  border-color: var(--mwe-primary-light) !important;
  z-index: 1;
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mwe-control-radius);
  background: var(--mwe-light-bg);
  transition: all 0.2s ease;
}

.feature-icon i.text-primary {
  color: var(--mwe-primary) !important;
}

.feature-icon i.text-success {
  color: var(--mwe-success) !important;
}

.feature-icon i.text-info {
  color: var(--mwe-info) !important;
}

.feature-icon i.text-warning {
  color: var(--mwe-warning) !important;
}

.feature-icon i.text-danger {
  color: var(--mwe-danger) !important;
}

.feature-icon i.text-secondary {
  color: var(--mwe-gray) !important;
}

.feature-card .feature-icon {
  background: var(--mwe-surface-muted);
}

/* répliqua au survol */
.feature-card:hover .feature-icon {
  background: var(--mwe-primary-25);
  transform: scale(1.1);
}

.feature-card:hover .feature-icon i.text-primary {
  color: var(--mwe-primary-dark) !important;
}

/* ── Pricing Cards ──────────────────────────────────────── */
.pricing-card {
  border-radius: 0 !important;
  border: 1px solid var(--mwe-border) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: var(--mwe-white) !important;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--mwe-shadow-lg) !important;
  border-color: var(--mwe-primary-light) !important;
}

.pricing-card.featured {
  border: 2px solid var(--mwe-primary) !important;
  box-shadow: var(--mwe-shadow-primary);
}

.pricing-card-hero {
  border-radius: 0 !important;
  border: 1px solid var(--mwe-border) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: var(--mwe-white) !important;
}

.pricing-card-hero:hover {
  transform: translateY(-4px);
  box-shadow: var(--mwe-shadow-primary);
  border-color: var(--mwe-primary-light) !important;
}

/* Pricing section background */
.bg-primary {
  background: var(--mwe-gradient-primary) !important;
}

/* ── Sections alternées ─────────────────────────────────── */
.section-alt {
  background-color: var(--mwe-surface-muted);
  border-top: 1px solid var(--mwe-border);
  border-bottom: 1px solid var(--mwe-border);
}

/* ── Module detail icon ─────────────────────────────────── */
.module-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--mwe-control-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* Profile cards styling */
.card.border-success {
  border-left: 4px solid var(--mwe-success) !important;
}

.rounded-circle.bg-primary {
  background: var(--mwe-primary) !important;
}

.rounded-circle.bg-success {
  background: var(--mwe-success) !important;
}

.rounded-circle.bg-warning {
  background: var(--mwe-warning) !important;
}

.rounded-circle.bg-info {
  background: var(--mwe-info) !important;
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  background: var(--mwe-light-bg);
  color: var(--mwe-text);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--mwe-border);
}

.page-header h1,
.page-header h2 {
  color: var(--mwe-primary-dark);
}

.page-header .opacity-75 {
  opacity: 0.65 !important;
}

/* ── Contact sidebar ────────────────────────────────────── */
.contact-info-card {
  border-left: 4px solid var(--mwe-primary) !important;
}

/* ── Footer ──────────────────────────────────────────────── */
footer,
.footer-primary {
  margin-top: 0 !important;
  background: var(--mwe-text) !important;
  border-top: 4px solid var(--mwe-primary);
}

footer .text-light {
  color: rgba(255, 255, 255, 0.9) !important;
}

footer a {
  color: rgba(255, 255, 255, 0.9) !important;
  transition: color 0.15s;
}

footer a:hover {
  color: var(--mwe-primary-light) !important;
}

footer .text-muted {
  color: var(--mwe-gray) !important;
}

.footer-logo {
  height: 34px;
  border-radius: var(--mwe-control-radius);
  box-shadow: none;
}

/* ── Badge outline ───────────────────────────────────────── */
.badge.bg-primary-subtle {
  background-color: var(--mwe-primary-25);
  color: var(--mwe-primary);
  font-weight: 600;
}

.badge.bg-success-subtle {
  background-color: var(--mwe-success-25);
  color: var(--mwe-success);
  font-weight: 600;
}

.badge.bg-warning {
  background-color: var(--mwe-warning);
  color: var(--mwe-black);
  font-weight: 600;
}

/* First badge in hero section */
.badge.bg-primary-subtle.fs-5,
.badge.bg-primary-subtle.fs-6 {
  background-color: var(--mwe-primary-25);
  color: var(--mwe-primary-dark);
  border: 1px solid var(--mwe-primary-50);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-weight: 500;
  border-radius: var(--mwe-control-radius) !important;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--mwe-primary);
  border-color: var(--mwe-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--mwe-primary-dark);
  border-color: var(--mwe-primary-dark);
  box-shadow: var(--mwe-shadow-primary);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-primary {
  color: var(--mwe-primary);
  border-color: var(--mwe-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--mwe-primary);
  color: var(--mwe-white);
  transform: translateY(-1px);
}

.btn-outline-success {
  color: var(--mwe-success);
  border-color: var(--mwe-success);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
  background: var(--mwe-success);
  color: var(--mwe-white);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  color: var(--mwe-gray);
  border-color: var(--mwe-gray);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--mwe-gray);
  color: var(--mwe-white);
  transform: translateY(-1px);
}

.btn-light {
  background: var(--mwe-white);
  color: var(--mwe-primary);
  border-color: var(--mwe-white);
}

.btn-light:hover,
.btn-light:focus {
  background: var(--mwe-light-bg);
  color: var(--mwe-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--mwe-shadow-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
}

/* Language selector buttons */
.btn.btn-light.text-primary {
  background: var(--mwe-white) !important;
  color: var(--mwe-primary) !important;
  border-color: var(--mwe-white) !important;
}

.btn.btn-outline-light {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn.btn-outline-light:hover,
.btn.btn-outline-light:focus {
  background: var(--mwe-white);
  color: var(--mwe-primary);
}

/* Check icons in hero section */
.hero-section .text-success {
  color: var(--mwe-success) !important;
}

/* ── Form Elements ───────────────────────────────────────── */
.form-control,
.form-select,
.input-group-text {
  border-radius: var(--mwe-control-radius) !important;
  border-color: var(--mwe-border-strong);
  min-height: 32px;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mwe-primary);
  box-shadow: 0 0 0 3px rgba(57, 106, 170, 0.16);
  outline: none;
}

.form-check-input {
  border-radius: var(--mwe-control-radius);
  border: 2px solid var(--mwe-border-strong);
}

.form-check-input:checked {
  background-color: var(--mwe-primary);
  border-color: var(--mwe-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(57, 106, 170, 0.16);
}

.is-invalid {
  border-color: var(--mwe-danger) !important;
}

.invalid-feedback {
  color: var(--mwe-danger);
  font-size: 0.875rem;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  border-radius: 0 !important;
  border: 1px solid var(--mwe-border) !important;
  box-shadow: none !important;
  background: var(--mwe-white) !important;
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--mwe-primary-light) !important;
  box-shadow: var(--mwe-shadow) !important;
}

.card-body {
  padding: 1.5rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.table {
  margin-bottom: 1rem;
}

.table-bordered {
  border: 1px solid var(--mwe-border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--mwe-border);
}

.table-primary {
  background-color: var(--mwe-primary-25);
}

.table-primary th {
  color: var(--mwe-primary-dark);
  font-weight: 600;
}

.table-light {
  background-color: var(--mwe-surface-muted);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: rgba(0, 0, 0, 0.02);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-type: rgba(57, 106, 170, 0.05);
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--mwe-control-radius);
  border: 1px solid var(--mwe-border);
  padding: 0.75rem 1.25rem;
}

.alert-primary {
  background-color: var(--mwe-primary-25);
  color: var(--mwe-primary-dark);
  border-color: var(--mwe-primary-light);
}

.alert-success {
  background-color: var(--mwe-success-25);
  color: var(--mwe-success-dark);
  border-color: var(--mwe-success-light);
}

.alert-info {
  background-color: rgba(57, 106, 170, 0.1);
  color: var(--mwe-primary-dark);
  border-color: var(--mwe-primary-light);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--mwe-warning);
  border-color: var(--mwe-warning);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--mwe-danger);
  border-color: var(--mwe-danger);
}

.alert-dismissible .btn-close {
  filter: opacity(0.7);
}

.alert-dismissible .btn-close:hover {
  filter: opacity(1);
}

/* ── Nav Pills ───────────────────────────────────────────── */
.nav-pills .nav-link {
  color: var(--mwe-gray-dark);
  border: 1px solid var(--mwe-border);
  background: var(--mwe-white);
  border-radius: var(--mwe-control-radius);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-pills .nav-link:hover {
  background: var(--mwe-light-bg);
  color: var(--mwe-primary);
  border-color: var(--mwe-primary-light);
}

.nav-pills .nav-link.active {
  background: var(--mwe-primary);
  color: var(--mwe-white);
  border-color: var(--mwe-primary);
}

/* Tab content styling */
.tab-content {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* ── Accordion ───────────────────────────────────────────── */
.accordion {
  --bs-accordion-bg: var(--mwe-white);
  --bs-accordion-transition: all 0.2s ease;
}

.accordion-button {
  border-radius: var(--mwe-control-radius) !important;
  padding: 1rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.accordion-button:not(.collapsed) {
  box-shadow: none;
  background-color: var(--mwe-surface-muted);
  color: var(--mwe-primary);
}

.accordion-button:hover {
  z-index: 2;
}

.accordion-button::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  transition: transform 0.2s ease, background-image 0.2s ease;
}

.accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3E%3Cpath fill-rule='evenodd' d='M1.646 11.354a.5.5 0 0 1 0-.708L7.293 5 1.646.646a.5.5 0 0 1 .708-.708L8 4.293l5.646-5.647a.5.5 0 0 1 .708.708L8.707 5l5.647 5.646a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708 0z'/%3E%3C/svg%3E");
}

.accordion-collapse {
  transition: all 0.3s ease;
}

.accordion-body {
  padding: 1rem 1.5rem;
  color: var(--mwe-text-muted);
}

/* ── List Styles ─────────────────────────────────────────── */
.list-unstyled li {
  padding: 0.25rem 0;
}

.list-unstyled li i.fa-check {
  width: 18px;
  text-align: center;
}

/* ── Spacing Utilities ──────────────────────────────────── */
.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.py-lg-6 {
  padding-top: 4.5rem !important;
  padding-bottom: 4.5rem !important;
}

/* ── Responsive adjustments ──────────────────────────────── */
@media (max-width: 767.98px) {
  .hero-section {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-brand-logo {
    width: 145px;
  }

  .navbar .navbar-collapse {
    padding: 0.75rem 0;
    border-top: 1px solid var(--mwe-border);
  }

  .navbar-nav {
    padding-left: 0;
  }

  .display-4 {
    font-size: 2.5rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .fs-5 {
    font-size: 1rem !important;
  }

  .section-alt {
    padding: 2rem 0;
  }

  /* Mobile navigation */
  .navbar-nav .nav-link {
    padding: 0.5rem 0;
    display: block;
  }

  .navbar .btn-outline-light {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }

  /* Hero illustration on mobile */
  .hero-illustration {
    margin-top: 1.5rem;
  }

  .hero-illustration .row > div {
    margin-bottom: 0.5rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .display-6 {
    font-size: 2.75rem;
  }
}

@media (min-width: 992px) {
  .page-header {
    padding: 4rem 0 3rem;
  }

  .py-5 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
  }

  .hero-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

/* Accessibilité - Focus states */
*:focus {
  outline: 2px solid var(--mwe-primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--mwe-primary);
  outline-offset: 2px;
}

/* Accessibilité - Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--mwe-primary);
  color: var(--mwe-white);
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Accessibilité - High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--mwe-border-strong);
  }

  .btn {
    border: 2px solid currentColor;
  }

  .nav-pills .nav-link {
    border: 2px solid var(--mwe-border-strong);
  }
}

/* Accessibilité - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Accessibilité - Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --mwe-light-bg: #1a1a1a;
    --mwe-white: #2d2d2d;
    --mwe-text: #e0e0e0;
    --mwe-text-muted: #c1c9d4;
    --mwe-border: #4b5563;
    --mwe-surface-muted: #24272c;
    --bs-body-color: var(--mwe-text);
    --bs-body-color-rgb: 224, 224, 224;
    --bs-secondary-color: var(--mwe-text-muted);
    --bs-secondary-color-rgb: 193, 201, 212;
    --bs-tertiary-color: #aeb8c5;
    --bs-tertiary-color-rgb: 174, 184, 197;
    --bs-heading-color: var(--mwe-text);
    --bs-emphasis-color: #f8fafc;
    --bs-emphasis-color-rgb: 248, 250, 252;
    --bs-body-bg: var(--mwe-light-bg);
    --bs-secondary-bg: var(--mwe-surface-muted);
    --bs-tertiary-bg: #202328;
    --bs-border-color: var(--mwe-border);
    --bs-link-color: #8bbcff;
    --bs-link-hover-color: #b8d4ff;
  }

  body {
    background-color: var(--mwe-light-bg);
    color: var(--mwe-text);
  }

  .card,
  .feature-card,
  .pricing-card,
  .hero-illustration {
    background: var(--mwe-white) !important;
    border-color: var(--mwe-border) !important;
  }

  .section-alt {
    background-color: var(--mwe-surface-muted);
  }

  .card .text-dark,
  .pricing-card-hero.text-dark {
    color: var(--mwe-text) !important;
  }

  .form-control,
  .form-select {
    color: var(--mwe-text);
    background-color: #202328;
    border-color: var(--mwe-border);
  }

  .form-control::placeholder {
    color: #aeb8c5;
    opacity: 1;
  }

  .page-header,
  .hero-section {
    background: var(--mwe-surface-muted);
  }

  footer,
  .footer-primary {
    background: var(--mwe-black) !important;
    border-top: 4px solid var(--mwe-primary);
  }

  footer .text-light {
    color: rgba(255, 255, 255, 0.9) !important;
  }

  footer a {
    color: var(--mwe-primary-light) !important;
  }

  footer a:hover {
    color: var(--mwe-white) !important;
  }
}

/* ── Custom scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--mwe-light-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--mwe-primary-50);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mwe-primary);
}

/* ── Selection color ──────────────────────────────────────── */
::selection {
  background: var(--mwe-primary-50);
  color: var(--mwe-primary-dark);
}

/* ── Code blocks styling ──────────────────────────────────── */
code {
  background: var(--mwe-surface-muted);
  color: var(--mwe-primary-dark);
  padding: 0.2rem 0.4rem;
  border-radius: var(--mwe-control-radius);
  font-size: 0.9em;
}

/* Links styling */
a {
  color: var(--mwe-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--mwe-primary-dark);
  text-decoration: underline;
}

a.text-decoration-none:hover {
  text-decoration: none;
}

/* Bootstrap table responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Image optimization */
img {
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* Picture element fallback */
picture {
  display: contents;
}

/* Checkbox and radio customization */
.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
  cursor: pointer;
}

.form-check-input[type="checkbox"]:focus,
.form-check-input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(57, 106, 170, 0.25);
}

/* Button pointer cursor */
button,
[type="button"],
[type="submit"],
[type="reset"],
.a {
  cursor: pointer;
}

/* Disable pointer events on disabled elements */
button:disabled,
[type="button"]:disabled,
[type="submit"]:disabled,
[type="reset"]:disabled,
.a:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Loading state for buttons */
button.loading,
button[data-loading] {
  position: relative;
  pointer-events: none;
}

button.loading::after,
button[data-loading]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--mwe-white);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: buttonLoadingSpin 0.6s linear infinite;
}

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

/* Smooth anchor links */
a[href*="#"]:not([href="#"]):not([href="#0"]) {
  transition: all 0.3s ease;
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card,
  .feature-card,
  .pricing-card {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: none;
  }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
  .feature-card:hover,
  .pricing-card:hover,
  .hero-illustration .stat-card:hover {
    transform: none;
    box-shadow: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Larger tap targets for mobile */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
}

/* High DPI screens */
@media 
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
  /* Retina/High DPI specific styles */
}

/*IE11 fix */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  html {
    height: -webkit-fill-available;
  }
  body {
    height: -webkit-fill-available;
  }
}

/*Optimisation des performances */
.contain-intrinsic-size {
  contain-intrinsic-size: 100px;
}

/* CSS Grid for feature cards layout */
@supports (display: grid) {
  .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}
