/* ==========================================================================
   CODEPI - Collectif Oralité pour Diffusion Enrichissement Promotion Interculturelle
   Association Loi 1901 - Production CSS Framework
   Compliant with French Non-Profit Regulatory Standards
   ========================================================================== */

:root {
  --primary: #1e3a8a;
  --primary-dark: #0f172a;
  --primary-light: #3b82f6;
  --accent: #0284c7;
  --accent-warm: #d97706;
  --civic-green: #059669;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --container-max: 1240px;
  --transition: all 0.25s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Typography & Base Headings
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

h3 {
  font-size: 1.45rem;
  margin-top: 1.5rem;
}

h4 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

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

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Layout Containers & Grids
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.content-section {
  padding: 3.5rem 0;
}

.content-section-subtle {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ==========================================================================
   Mandatory Image Framing & Figcaption Protocol (Donit Style)
   ========================================================================== */

.civic-photo-frame {
  margin: 1.5rem 0 1rem 0;
  display: block;
}

.civic-photo-frame img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin: 20px 0 8px 0;
  object-fit: cover;
  max-height: 480px;
  display: block;
}

.civic-photo-frame figcaption {
  font-size: 0.875rem;
  color: #64748B;
  margin-bottom: 20px;
  font-style: italic;
  line-height: 1.4;
  padding: 0 4px;
}

/* ==========================================================================
   Top Regulatory Utility Bar
   ========================================================================== */

.top-utility-bar {
  background-color: #0b1329;
  color: #94a3b8;
  font-size: 0.8125rem;
  border-bottom: 1px solid #1e293b;
  padding: 0.55rem 0;
}

.top-utility-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.utility-badge-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.utility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: #e2e8f0;
}

.utility-badge .dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.utility-contact-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: #cbd5e1;
}

.utility-contact-info a {
  color: #e2e8f0;
  text-decoration: none;
}

.utility-contact-info a:hover {
  text-decoration: underline;
  color: #38bdf8;
}

/* ==========================================================================
   Main Header & Navigation Architecture
   ========================================================================== */

.main-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

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

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-title:hover {
  text-decoration: none;
  color: var(--primary);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--bg-subtle);
  text-decoration: none;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease-in-out;
  z-index: 1100;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item a {
  display: block;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.dropdown-item a:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

/* Strictly Enforced Action Button: Contact Only */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
  transition: var(--transition);
  text-decoration: none !important;
}

.btn-contact:hover {
  background-color: #172554;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
  transform: translateY(-1px);
}

.btn-contact-outline {
  background-color: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-contact-outline:hover {
  background-color: var(--primary);
  color: #ffffff !important;
}

/* Mobile Toggle Hamburger */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

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

/* ==========================================================================
   Hero Banners & 2-Sentence Summary Box
   ========================================================================== */

.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 4.5rem 0 3.5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-banner-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.hero-headline {
  font-size: 3rem;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-subheadline {
  font-size: 1.25rem;
  color: #93c5fd;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Direct 2-Sentence Summary Box (MANDATORY) */
.hero-summary-box {
  background-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border-left: 4px solid #38bdf8;
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-summary-box p {
  color: #f1f5f9;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 0;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Key Indicators Bar
   ========================================================================== */

.indicators-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.indicator-card {
  text-align: center;
  padding: 1rem;
}

.indicator-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.indicator-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   Core Mission Section & Exact Paragraph
   ========================================================================== */

.mission-highlight-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.mission-core-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #1e293b;
  font-weight: 500;
  background-color: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1.75rem 2rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}

/* Mandatory Funding Disclosure Banner */
.funding-disclosure-banner {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 5px solid var(--civic-green);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.funding-disclosure-banner p {
  color: #065f46;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
}

.funding-disclosure-banner strong {
  color: #047857;
  font-weight: 700;
}

/* ==========================================================================
   Cards, Program Features, & Accordions
   ========================================================================== */

.civic-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.civic-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background-color: #dbeafe;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.card-body {
  flex-grow: 1;
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.6;
}

.card-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Data Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.civic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.civic-table th {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.civic-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.civic-table tr:last-child td {
  border-bottom: none;
}

.civic-table tr:hover td {
  background-color: #f8fafc;
}

/* Accordion */
.faq-accordion {
  margin: 2rem 0;
}

.accordion-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-surface);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.accordion-header:hover {
  background-color: var(--bg-subtle);
}

.accordion-body {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  line-height: 1.65;
  background-color: #fafbfc;
}

/* Forms */
.civic-form-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 0.4rem;
}

/* ==========================================================================
   Unified Legal Compliance Footer
   ========================================================================== */

.main-footer {
  background-color: #0b1329;
  color: #94a3b8;
  margin-top: auto;
  border-top: 1px solid #1e293b;
  font-size: 0.925rem;
}

.footer-top {
  padding: 4rem 0 2.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
}

.footer-col-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1e293b;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
  padding: 2px 0;
  min-height: 24px;
}

.footer-links a:hover {
  color: #38bdf8;
  transform: translateX(3px);
}

.footer-registration-box {
  background-color: #111c3a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1rem;
}

.footer-registration-box p {
  color: #cbd5e1;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

.footer-registration-box p:last-child {
  margin-bottom: 0;
}

.footer-middle-disclosure {
  background-color: #070c1b;
  border-top: 1px solid #16203c;
  border-bottom: 1px solid #16203c;
  padding: 1.5rem 0;
}

.footer-disclosure-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #94a3b8;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.footer-bottom {
  background-color: #040812;
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
}

/* ==========================================================================
   AJAX Confirmation Popup Modal
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
  position: relative;
  animation: modalEnter 0.25s ease-out;
}

@keyframes modalEnter {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-icon {
  width: 64px;
  height: 64px;
  background-color: #ecfdf5;
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  font-size: 2rem;
}

.modal-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.modal-message {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.modal-close-btn {
  min-height: 44px;
  min-width: 120px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background-color: var(--primary-dark);
}

/* ==========================================================================
   Responsive Breakpoints (@media (max-width: 992px) and (max-width: 768px))
   ========================================================================== */

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

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-drawer.active {
    display: block;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    z-index: 1000;
  }

  .mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-nav-item {
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-nav-item:last-child {
    border-bottom: none;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
  }

  .mobile-sublinks {
    list-style: none;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .mobile-sublinks a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.95rem;
    color: var(--text-muted);
  }

  .mobile-action-bar {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
  }

  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-banner-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .top-utility-bar .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .utility-badge-group, .utility-contact-info {
    font-size: 0.75rem;
    gap: 0.75rem;
  }

  .hero-headline {
    font-size: 2.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-contact {
    width: 100%;
  }

  .civic-form-card, .mission-highlight-card {
    padding: 1.5rem;
  }
}
