/* --- VARIABLES & THÈMES (PROPOSITION C - VIOLET HARMONISÉ) --- */
:root {
  --deep-purple: #2d1b4d; /* Violet Profond */
  --magenta: #a83264; /* Magenta Vibrant */
  --cobalt: #4d79ff; /* Cobalt Électrique */

  --soft-purple: #e9e4f0; /* Lilas Pâle (Le nouveau blanc) */
  --soft-pink: #fadce8; /* Rose Pâle */
  --soft-blue: #d6e8ff; /* Bleu Pâle */

  --light-bg: #f3f1f8; /* Fond d'application */
  --crystal: var(--soft-purple);

  /* Thème Clair */
  --bg-app: var(--light-bg);
  --bg-card: var(--crystal);
  --text-main: var(--deep-purple);
  --text-muted: var(--cobalt);
  --sidebar-bg: var(--deep-purple);
  --sidebar-text: var(--soft-purple);
  --border: var(--deep-purple);
  --accent: var(--magenta);
  --accent-text: var(--magenta);
  --radius: 0.75rem;
  --gap: 1.25rem;
  --shadow: 0 0.5rem 1rem rgba(45, 27, 77, 0.12);
}

[data-theme="dark"] {
  --bg-app: #0f0e17;
  --bg-card: #1c1b29;
  --text-main: var(--soft-purple);
  --text-muted: var(--soft-blue);
  --sidebar-bg: #0a0912;
  --sidebar-text: var(--soft-purple);
  --border: var(--cobalt);
  --accent: var(--magenta);
  --accent-text: var(--soft-pink);
  --shadow: 0 0.5rem 1rem rgba(205, 223, 178, 0.12);
}

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s,
    transform 0.2s;
}
html {
  font-size: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
}
ul {
  padding-left: 1.25rem;
}
a {
  text-decoration: none;
  font-weight: bold;
  color: inherit;
}

/* --- LAYOUT GLOBAL --- */
.app-container {
  display: flex;
  min-height: 100vh;
  padding: 1.5rem;
  gap: 1.5rem;
  max-width: 100rem;
  margin: 0 auto;
}
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- SIDEBAR & NAV --- */
.sidebar {
  width: 6.5rem;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  position: sticky;
  top: 1.5rem;
  height: calc(100vh - 3rem);
  box-shadow: var(--shadow);
  z-index: 100;
}
.logo-area {
  font-weight: 900;
  font-size: 1.6rem;
  color: #fff;
  background: var(--magenta);
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  align-items: center;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--sidebar-text);
  opacity: 0.5;
  width: 100%;
  cursor: pointer;
}
.nav-item img {
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 0.4rem;
  filter: brightness(0) invert(1);
}
.nav-item:hover,
.nav-item.active {
  opacity: 1;
  color: #fff;
}
.nav-item.active {
  color: var(--magenta);
}

/* --- BOUTON THEME --- */
.theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.theme-toggle img {
  position: absolute;
  width: 1.6rem;
  height: 1.6rem;
  filter: brightness(0) invert(1);
  transition: 0.5s;
}
.icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* --- HEADER --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--border);
}
header h1 {
  font-size: 2.5rem;
  font-weight: bold;
}
header h2 {
  font-size: 1.5rem;
  color: var(--accent-text);
  font-weight: bold;
  text-transform: uppercase;
}

/* --- GRILLE BENTO & CARTES --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  grid-auto-flow: dense;
}

.card {
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card.centered {
  align-items: center;
  justify-content: space-around;
  text-align: center;
  gap: var(--gap);
}
.card h3 {
  font-size: 1.35rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid currentColor;
}
.card h4 {
  font-size: 1.2rem;
  font-weight: bold;
  font-variant: small-caps;
  margin-bottom: 0.5rem;
}
.card p,
.card li {
  margin-bottom: 0.5rem;
}

.card > :last-child,
ul > :last-child {
  margin-bottom: 0;
}

/* VARIANTES C1, C2, C3 */
.card-c1 {
  background-color: var(--soft-purple);
  color: var(--deep-purple);
}
[data-theme="dark"] .card-c1 {
  background-color: var(--deep-purple);
  color: var(--soft-purple);
}

.card-c2 {
  background-color: var(--soft-pink);
  color: var(--magenta);
}
[data-theme="dark"] .card-c2 {
  background-color: var(--magenta);
  color: var(--soft-pink);
}

.card-c3 {
  background-color: var(--soft-blue);
  color: var(--cobalt);
}
[data-theme="dark"] .card-c3 {
  background-color: var(--cobalt);
  color: var(--soft-blue);
}

.card-border-accent {
  border: 2px solid var(--accent) !important;
}

/* SIZES */
.span-2 {
  grid-column: span 2;
}
.span-3 {
  grid-column: span 3;
}
.row-2 {
  grid-row: span 2;
}

/* --- IMAGES & :HAS --- */
.card:has(> .img-avatar:only-child) {
  box-shadow: none;
  background-color: transparent;
  display: flex;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: none;
}
.img-avatar {
  height: 100%;
  width: auto;
  max-height: 16rem;
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  border: 3px solid var(--accent);
  object-fit: cover;
  box-shadow: var(--shadow);
}
.img-content {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) / 2);
  margin-bottom: 1rem;
  object-fit: cover;
}

/* --- LAYOUTS INTERNES --- */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  height: 100%;
}
.split-content {
  height: 100%;
  display: flex;
  gap: var(--gap);
}
.split-content > div,
.split-content > ul {
  flex: 1;
  min-width: 0;
}
.profile-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
}
.social-links {
  width: 30%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--gap);
}

/* --- FORMULAIRES & CAPTCHA --- */
#contact-form {
  display: flex;
  flex-direction: column;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0 1rem 0;
  font-size: 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: rgba(45, 27, 77, 0.05);
  color: var(--text-main);
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  background: #fff;
  box-shadow: 0 0 0 4px var(--soft-blue);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.05);
}

input[type="submit"] {
  width: 100%;
  font-size: 1rem;
  margin: 1rem auto 0;
  background: var(--accent);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
}

.status-message {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
}
.status-message.success {
  background: var(--cobalt);
  color: #fff;
}
.status-message.error {
  background: var(--magenta);
  color: #fff;
}

/* CAPTCHA (CORRECTIF) */
.captcha-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.captcha-label {
  margin: 0;
  min-width: 180px;
  text-align: right;
  font-size: 1rem;
}
.captcha-question {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
}
.captcha-input {
  width: 60px;
  padding: 0.5rem;
  text-align: center;
  height: 2.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#captcha {
  width: 4rem;
  margin: 0;
}
#refresh-captcha {
  background: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  padding: 0;
  margin: 0;
}

/* --- FOOTER --- */
footer {
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: center;
  gap: var(--gap);
  color: var(--text-muted);
  font-weight: 600;
}
footer a {
  color: var(--accent-text);
}

/* --- COOKIES --- */
#cookie {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--deep-purple);
  color: #fff;
  padding: 25px;
  border-radius: 1.5rem;
  border: 2px solid var(--magenta);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  max-width: 350px;
  transform: translateY(150%);
}
#cookie.show {
  transform: translateY(0);
}
#cookie button {
  background: var(--magenta);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 0.75rem;
  width: 100%;
  margin-top: 1rem;
  cursor: pointer;
  font-weight: bold;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    padding: 1rem;
    padding-bottom: 5.5rem;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    width: 100%;
    height: 3.5rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: center;
    padding: 0;
    border-radius: 1rem 1rem 0 0;
    border-top: 2px solid var(--border);
  }
  .logo-area,
  .nav-item span {
    display: none;
  }
  .nav-links {
    display: contents;
  }
  .theme-toggle {
    width: 100% !important;
    border-radius: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-grid > * {
    grid-column: 1 / -1 !important;
  }
  .cols-2 {
    grid-template-columns: 1fr;
  }
  .split-content {
    flex-direction: column;
  }
  .split-content:has(ul) {
    gap: 0.5rem;
  }
  footer {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* --- Messages du formulaire (étape contact) --- */
.alerte {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
}
.alerte-ok {
  background: var(--deep-purple);
  color: var(--soft-purple);
}
.alerte-erreur {
  background: var(--magenta);
  color: var(--soft-pink);
}
