/* ============================================================
   Proeva · Site web · feuille de styles globale
   ============================================================
   Architecture :
     - Tokens (couleurs, typo, espacement) en CSS variables
     - Thèmes clair + Nuit, switch sur [data-theme="dark"]
     - Base + layout primitives + composants
   ============================================================ */

/* ----- Tokens : direction A · clair ----- */
:root {
  --bg: #F5F2EC;
  --surface: #FFFFFF;
  --surface-alt: #FAF8F3;
  --ink: #14130F;
  --muted: #75726A;
  --border: #E6E1D6;
  --border-strong: #D5CFC0;
  --primary: #2D4A2A;
  --primary-ink: #FFFFFF;
  --accent: #5BA84A;
  --accent-strong: #4A9239;
  --accent-ink: #FFFFFF;
  --tone-soft: #E5EBD9;
  --warning: #C56A4A;

  --font-display: "Instrument Serif", "Cambria", "Georgia", serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", Consolas, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 22px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --e-1: 0 1px 2px rgba(20,19,15,0.06), 0 0 0 1px rgba(20,19,15,0.04);
  --e-2: 0 4px 14px rgba(20,19,15,0.08), 0 0 0 1px rgba(20,19,15,0.04);
  --e-3: 0 18px 48px -12px rgba(20,19,15,0.18), 0 2px 6px rgba(20,19,15,0.06);

  --logo-light: url('assets/proeva-logo.svg');
  --logo-dark:  url('assets/proeva-logo-dark.svg');

  --max-w: 1240px;
  --header-h: 72px;
  --easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0E1110;
  --surface: #14171A;
  --surface-alt: #181C1E;
  --ink: #ECEAE4;
  --muted: #8C8C85;
  --border: #2A3530;
  --border-strong: #3A4540;
  --primary: #5BA84A;
  --primary-ink: #0E1110;
  --accent: #7AB144;
  --accent-strong: #8FC456;
  --accent-ink: #0E1110;
  --tone-soft: #1A2018;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.55;
  transition: background 0.4s var(--easing), color 0.4s var(--easing);
}
img { max-width:100%; display:block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
hr { border:0; height:1px; background: var(--border); margin: var(--s-6) 0; }

/* ----- Type primitives ----- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--primary); }
h1.display { font-size: clamp(48px, 7vw, 96px); }
h2.display { font-size: clamp(36px, 5vw, 60px); line-height: 1.05; }
h3.display { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.lead {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
  max-width: 60ch;
}
.mono { font-family: var(--font-mono); letter-spacing: 0; }

/* ----- Layout primitives ----- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
@media (max-width: 720px) {
  .container { padding: 0 var(--s-4); }
}
.section { padding: var(--s-10) 0; }
.section--tight { padding: var(--s-8) 0; }

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.site-header__inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5);
}
.site-logo {
  display: inline-flex; align-items: center;
  height: 32px;
}
.site-logo img { height: 45px; width: auto; display: block; }
.site-logo .logo-dark { display: none; }
[data-theme="dark"] .site-logo .logo-light { display: none; }
[data-theme="dark"] .site-logo .logo-dark { display: block; }

.site-nav {
  display: flex; align-items: center; gap: var(--s-6);
}
.site-nav a {
  font-size: 14px; font-weight: 500; color: var(--ink);
  text-decoration: none; position: relative; padding: 6px 0;
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--easing);
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.cta {
  background: var(--primary); color: var(--primary-ink);
  padding: 9px 16px; border-radius: var(--r-sm);
}
.site-nav a.cta::after { display: none; }
.site-nav a.cta:hover { background: color-mix(in srgb, var(--primary) 88%, black); text-decoration: none; }

/* Boutons-icônes ronds dans le header (thème + menu mobile) — même base visuelle. */
.theme-toggle,
.menu-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 36px; height: 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, transform 0.4s;
}
.theme-toggle:hover,
.menu-toggle:hover { color: var(--ink); border-color: var(--border-strong); }
.theme-toggle .icon { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* Mobile menu trigger — caché sur desktop, affiché sur mobile (cf. @media plus bas). */
.menu-toggle { display: none; }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex; flex-direction: column; position: absolute;
    top: var(--header-h); left: 0; right: 0;
    background: var(--surface); padding: var(--s-5);
    border-bottom: 1px solid var(--border);
    gap: var(--s-4);
  }
  .menu-toggle { display: inline-flex; }
}

/* ----- Footer ----- */
.site-footer {
  margin-top: var(--s-10);
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--s-8) 0 var(--s-6);
}
.site-footer__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-7);
}
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .site-footer__brand { grid-column: 1 / -1; }
}
.site-footer__brand img { height: 28px; margin-bottom: var(--s-3); }
.site-footer__brand p { font-size: 13px; color: var(--muted); margin: var(--s-3) 0 0; max-width: 32ch; }
.site-footer__col h4 {
  font-size: 11px; font-family: var(--font-mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin: 0 0 var(--s-4); font-weight: 500;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.site-footer__col a { color: var(--ink); font-size: 14px; text-decoration: none; }
.site-footer__col a:hover { color: var(--primary); }
.site-footer__bottom {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: var(--s-3);
  font-size: 12px; color: var(--muted);
  font-family: var(--font-mono);
}
.site-footer__bottom a { color: var(--muted); }
.site-footer__bottom a:hover { color: var(--primary); }

/* ----- Buttons ----- */
.btn {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  padding: 12px 20px; border-radius: var(--r-sm); border: 0;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  line-height: 1; transition: transform 0.15s var(--easing), background 0.2s, color 0.2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn--accent  { background: var(--accent); color: var(--accent-ink); }
.btn--ghost   { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--large { padding: 16px 26px; font-size: 15px; }
.btn .arrow { transition: transform 0.2s var(--easing); }
.btn:hover .arrow { transform: translateX(3px); }

/* ----- Card / surfaces ----- */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: var(--s-5);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-strong); }

/* ----- Tags & chips ----- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: var(--tone-soft); color: var(--primary);
}
.tag--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }

/* ----- Forms ----- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-4); }
.field label {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 15px;
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  width: 100%; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field textarea { min-height: 140px; resize: vertical; }
.field--inline { display: flex; align-items: flex-start; gap: var(--s-3); flex-direction: row; }
.field--inline input[type="checkbox"] { width: auto; margin-top: 3px; }
.field--inline label { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ----- Notice / info blocks ----- */
.notice {
  display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--tone-soft); border-radius: var(--r-md);
  border-left: 3px solid var(--accent);
  font-size: 13.5px; line-height: 1.55; color: var(--ink);
}
.notice__icon {
  width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.notice__title {
  font-weight: 600; color: var(--ink); margin: 0 0 4px;
  font-family: var(--font-body); font-size: 13.5px;
}
.notice__body { color: var(--muted); }
.notice--warning { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 8%, var(--bg)); }
.notice--warning .notice__icon { background: var(--warning); color: white; }

/* ----- Page intro pattern (used on Contact / Espace client / Login) ----- */
.page-intro {
  padding: var(--s-9) 0 var(--s-7);
  border-bottom: 1px solid var(--border);
}
.page-intro .eyebrow { margin-bottom: var(--s-3); }
.page-intro h1 { margin-bottom: var(--s-4); }
.page-intro .lead { max-width: 56ch; }

/* ----- Reveal animation (used on most pages) ----- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--easing), transform 0.7s var(--easing);
}
.reveal.is-visible {
  opacity: 1; transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* ----- Utility ----- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----- Password field (œil + critères live) -----
   Voir public/assets/password-policy.js pour la logique. La politique
   miroir vit dans App\Services\ValidationService::passwordPolicy. */
.field--password .password-input-wrap { position: relative; }
.field--password .password-input-wrap input[type="password"],
.field--password .password-input-wrap input[type="text"] { padding-right: 44px; }

.password-toggle {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  background: transparent; border: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.password-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.password-toggle .icon-eye-on  { display: none; }
.password-toggle .icon-eye-off { display: block; }
.password-toggle[data-shown="1"] .icon-eye-on  { display: block; }
.password-toggle[data-shown="1"] .icon-eye-off { display: none; }

.password-policy {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.password-policy__title {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 6px;
}
.password-policy__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-family: var(--font-mono); font-size: 12px;
}
@media (max-width: 480px) { .password-policy__list { grid-template-columns: 1fr; } }
.password-policy__item {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted);
  transition: color 0.15s;
}
.password-policy__item::before {
  content: '○';
  width: 12px; text-align: center;
  color: var(--muted); font-weight: 700;
  transition: color 0.15s;
}
.password-policy__item.is-ok { color: #2c6b3f; }
.password-policy__item.is-ok::before { content: '✓'; color: #2c6b3f; }
.password-policy__item.is-ko { color: #b8392f; }
.password-policy__item.is-ko::before { content: '×'; color: #b8392f; }

/* ----- Privacy banner (RGPD / CNIL) -----
   Volontairement nommé `.privacy-banner` plutôt que `.cookie-banner` :
   les filtres anti-trackers (Malwarebytes, uBlock, AdBlock) bloquent par
   défaut tout sélecteur contenant « cookie-consent », ce qui rendrait
   notre bandeau invisible pour les utilisateurs équipés de ces outils.
   Caché par défaut. privacy.js ajoute `.is-visible` quand l'utilisateur
   n'a pas encore exprimé de choix. Posé en `fixed` bas d'écran, par-dessus
   tout le contenu — non bloquant. */
.privacy-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--surface); color: var(--ink);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 12%, transparent);
  transform: translateY(110%);
  transition: transform 0.35s var(--easing);
  padding: var(--s-4) var(--s-5);
}
.privacy-banner.is-visible { transform: translateY(0); }
.privacy-banner__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-5);
  align-items: center;
}
@media (max-width: 720px) {
  .privacy-banner__inner { grid-template-columns: 1fr; }
}
.privacy-banner__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 18px; letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.privacy-banner__text {
  font-size: 13.5px; line-height: 1.55; color: var(--muted);
  margin: 0; max-width: 70ch;
}
.privacy-banner__text a { color: var(--primary); text-decoration: underline; }
.privacy-banner__text strong { color: var(--ink); font-weight: 600; }
.privacy-banner__actions {
  display: flex; gap: var(--s-3); flex-shrink: 0;
}
@media (max-width: 720px) {
  .privacy-banner__actions { flex-direction: column; }
  .privacy-banner__actions .btn { width: 100%; justify-content: center; }
}

/* ===========================================================
   Modale de confirmation (remplace window.confirm) — confirm.js
   Utilise <dialog> HTML5 ; styles alignés sur le design system.
   =========================================================== */
.confirm-modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 480px;
  width: calc(100% - 32px);
}
.confirm-modal::backdrop {
  background: rgba(20, 19, 15, 0.55);
  backdrop-filter: blur(2px);
}
.confirm-modal__inner {
  padding: var(--s-5);
  margin: 0;
}
.confirm-modal__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-3);
  font-weight: 500;
}
.confirm-modal__message {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 var(--s-5);
  white-space: pre-line;
}
.confirm-modal__actions {
  display: flex;
  gap: var(--s-3);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.confirm-modal__actions .btn {
  min-width: 110px;
  justify-content: center;
}

/* Variante destructive du bouton (clic supprime / désactive). */
.btn--danger {
  background: #b8392f;
  color: #fff;
}
.btn--danger:hover { background: #9a2f27; }

/* Dark mode : ::backdrop déjà OK ; on n'ajuste que la profondeur de l'ombre. */
[data-theme="dark"] .confirm-modal {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .confirm-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
