/* =============================================
   LE C.A.R.T.E.L. - Design System
   Association de bienfaiteurs
   ============================================= */

/* ===== CSS VARIABLES ===== */
:root {
  /* Primary Colors - Based on Logo */
  --primary-900: #1E1B4B;
  --primary-800: #312E81;
  --primary-700: #4338CA;
  --primary-600: #6B21A8;
  --primary-500: #7C3AED;
  --primary-400: #A855F7;
  --primary-300: #C084FC;
  --primary-200: #DDD6FE;
  --primary-100: #EDE9FE;
  --primary-50: #FAF5FF;

  /* Accent Colors */
  --accent-gold: #F59E0B;
  --accent-gold-light: #FCD34D;
  --accent-success: #10B981;
  --accent-error: #EF4444;

  /* Neutral Colors */
  --neutral-900: #0F0D1A;
  --neutral-800: #1A1625;
  --neutral-700: #2D2640;
  --neutral-600: #4A4458;
  --neutral-500: #6B6680;
  --neutral-400: #9390A0;
  --neutral-300: #C4C2D0;
  --neutral-200: #E4E2F0;
  --neutral-100: #F5F4FA;
  --neutral-50: #FAFAFE;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-400) 100%);
  --gradient-dark: linear-gradient(135deg, var(--neutral-900) 0%, var(--primary-900) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  --gradient-hero: linear-gradient(180deg, var(--neutral-900) 0%, var(--primary-900) 50%, var(--neutral-800) 100%);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.4);
  --shadow-glow-sm: 0 0 20px rgba(168, 85, 247, 0.3);

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-tooltip: 400;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--neutral-100);
  background: var(--neutral-900);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--neutral-50);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

@media (max-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

  h4 {
    font-size: var(--text-xl);
  }
}

p {
  margin-bottom: var(--space-4);
  color: var(--neutral-300);
}

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

a:hover {
  color: var(--primary-300);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  list-style: none;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
}

.section {
  padding: var(--space-24) 0;
}

.section--dark {
  background: var(--gradient-dark);
}

.section--glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

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

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 640px) {

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

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn--primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow-sm);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn--secondary {
  background: transparent;
  color: var(--primary-400);
  border: 2px solid var(--primary-400);
}

.btn--secondary:hover {
  background: var(--primary-400);
  color: white;
}

.btn--glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--neutral-100);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-400);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* ===== CARDS ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-400);
  box-shadow: var(--shadow-glow-sm);
}

.card__icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.card__text {
  color: var(--neutral-400);
  font-size: var(--text-sm);
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-4) 0;
  transition: all var(--transition-base);
}

.navbar--scrolled {
  background: rgba(15, 13, 26, 0.95);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: var(--space-3) 0;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar__logo img {
  height: 50px;
  width: auto;
}

.navbar__logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-50);
}

.navbar__logo-text span {
  display: block;
  font-size: var(--text-xs);
  color: var(--primary-400);
  font-weight: 400;
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar__link {
  padding: var(--space-2) var(--space-4);
  color: var(--neutral-300);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--primary-400);
  background: rgba(168, 85, 247, 0.1);
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
}

.navbar__toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--neutral-100);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

@media (max-width: 1024px) {
  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-20) var(--space-6);
    background: #0F0D1A;
    /* Solid Dark Background */
    border-left: 1px solid var(--glass-border);
    transition: right var(--transition-base);
    gap: var(--space-2);
    /* Prevent rendering issues */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    z-index: var(--z-modal);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  /* Overlay fix */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Darker overlay */
    backdrop-filter: blur(5px);
    /* Only blur the content BEHIND, not the menu */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: var(--z-sticky);
    /* Below menu */
  }

  .overlay--active {
    opacity: 1;
    visibility: visible;
  }

  .navbar__menu--open {
    right: 0;
  }

  .navbar__menu--open .navbar__link {
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0;
  }

  .navbar__menu--open .navbar__link:nth-child(1) {
    animation-delay: 0.1s;
  }

  .navbar__menu--open .navbar__link:nth-child(2) {
    animation-delay: 0.2s;
  }

  .navbar__menu--open .navbar__link:nth-child(3) {
    animation-delay: 0.3s;
  }

  .navbar__menu--open .navbar__link:nth-child(4) {
    animation-delay: 0.4s;
  }

  .navbar__menu--open .navbar__link:nth-child(5) {
    animation-delay: 0.5s;
  }

  .navbar__menu--open .navbar__link:nth-child(6) {
    animation-delay: 0.6s;
  }

  .navbar__menu--open .navbar__link:nth-child(7) {
    animation-delay: 0.7s;
  }

  .navbar__link {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-lg);
    /* Larger text for better legibility */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Separators */
    -webkit-font-smoothing: antialiased;
    /* Sharper text */
  }
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(107, 33, 168, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero__logo {
  width: 180px;
  height: auto;
  margin: 0 auto var(--space-8);
  animation: float 6s ease-in-out infinite;
}

.hero__title {
  font-size: var(--text-6xl);
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--primary-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__acronym {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.hero__acronym-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  min-width: 100px;
}

.hero__acronym-letter {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary-400);
}

.hero__acronym-word {
  font-size: var(--text-xs);
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--neutral-300);
  margin-bottom: var(--space-8);
}

.hero__tagline {
  font-size: var(--text-lg);
  color: var(--primary-300);
  font-weight: 500;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero__title {
    font-size: var(--text-4xl);
  }

  .hero__acronym-item {
    min-width: 80px;
    padding: var(--space-2) var(--space-3);
  }

  .hero__acronym-letter {
    font-size: var(--text-2xl);
  }
}

/* ===== STATS SECTION ===== */
.stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding: var(--space-12) 0;
}

.stat {
  text-align: center;
  padding: var(--space-6);
}

.stat__number {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--primary-400);
  line-height: 1;
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: var(--space-2);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

.section-header__label {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-400);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-header__title {
  margin-bottom: var(--space-4);
}

.section-header__text {
  font-size: var(--text-lg);
  color: var(--neutral-400);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--neutral-800);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer__logo img {
  height: 60px;
}

.footer__description {
  color: var(--neutral-400);
  font-size: var(--text-sm);
  max-width: 300px;
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--neutral-300);
  transition: all var(--transition-fast);
}

.footer__social a:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
}

.footer__column h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  color: var(--neutral-100);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__links a {
  color: var(--neutral-400);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--primary-400);
}

.footer__bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copyright {
  color: var(--neutral-500);
  font-size: var(--text-sm);
}

.footer__legal {
  display: flex;
  gap: var(--space-6);
}

.footer__legal a {
  color: var(--neutral-500);
  font-size: var(--text-sm);
}

/* ===== ANIMATIONS ===== */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: var(--shadow-glow-sm);
  }

  50% {
    box-shadow: var(--shadow-glow);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.6s ease forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease forwards;
}

/* Scroll-triggered animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--neutral-200);
  font-size: var(--text-sm);
  font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--neutral-100);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

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

/* ===== UTILITIES ===== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary-400);
}

.text-muted {
  color: var(--neutral-400);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }
}

@media (min-width: 769px) {
  .desktop-hidden {
    display: none;
  }
}

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.overlay--active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Close */
.navbar__close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--neutral-100);
  font-size: var(--text-xl);
  cursor: pointer;
}