/* Gestion Crédit — public site + admin styles.
   Corporate-finance palette: deep navy, slate, and a warm gold accent. */
:root {
  --navy: #0b2545;
  --navy-700: #13315c;
  --navy-500: #1c4b82;
  --slate: #3d4d63;
  /* #64748b measured 4.43:1 on --bg-soft and 4.23:1 on --bg-alt — both under the
     4.5:1 minimum, and .muted carries real body copy on those backgrounds
     (section intros, form notes). Darkened just far enough to clear it. */
  --muted: #5f6e85;
  --gold: #c9a24b;
  /* Surface gold: a background fill, read against navy text. */
  --gold-600: #b08d38;
  /* Text gold: the same family darkened until it is legible as small text on a
     light background. --gold-600 measures only 3.15:1 on white, which fails the
     4.5:1 minimum, and darkening --gold-600 itself was not an option — it is the
     .btn-primary hover fill, where navy text needs it to stay light. Two uses,
     two tokens. This one is 5.4:1 on white and 4.8:1 on --bg-alt. */
  --gold-text: #856520;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-alt: #eef2f7;
  --line: #e2e8f0;
  /* Borders that have to carry definition on their own — form fields sitting on
     a white card, where a fill would read as "disabled". */
  --line-strong: #cbd5e1;
  --white: #ffffff;
  --radius: 14px;
  /* Radius scale. --radius stays the large card value; these name the smaller
     steps the components already use so they stop being ad-hoc literals. */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 24px 60px rgba(11, 37, 69, 0.14);
  --maxw: 1140px;
  /* Header height, referenced by the sticky offset and in-page anchor scroll so
     the two can't silently drift apart. */
  --header-h: 72px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* Semantic status colours — one canonical value per meaning, replacing the two
     greens / two reds that were duplicated as literals across this file and
     admin.css. Text vs surface are split (the same rationale as --gold /
     --gold-text): the darker *-text tokens stay legible as small text, the base
     tokens are for fills and graphical bars. --warning is darkened to clear the
     3:1 non-text-contrast minimum on --bg-alt. */
  --success: #2e7d54;
  --success-text: #1c6b3a;
  --success-bg: #e7f4ec;
  --success-border: #b7e2c4;
  --danger: #b3261e;
  --danger-text: #a12727;
  --danger-bg: #fdecec;
  --warning: #8a6d24;
  --warning-text: #856520;
  --warning-bg: #fdf3e0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--slate);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}
h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--navy-500); text-decoration: none; }
a:hover { color: var(--gold-text); }
img { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .8rem;
  font-weight: 700; color: var(--gold-text); margin-bottom: .6rem;
}
.muted { color: var(--muted); }

/* Skip link — first tab stop, so keyboard users are not forced through the
   whole header on every page load. Visible only while focused. */
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: var(--navy); color: #fff; font-weight: 700;
  padding: .7rem 1.1rem; border-radius: 0 0 10px 10px;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* A focus indicator that is actually visible. The UA default all but disappears
   against the navy header and the gold primary button. :focus-visible so it
   appears for keyboard use without ringing every mouse click. */
:focus-visible {
  outline: 3px solid var(--navy-500);
  outline-offset: 2px;
  border-radius: 4px;
}
/* On dark surfaces the navy ring is invisible; switch to white there. */
.hero :focus-visible, .site-header .btn-primary:focus-visible,
.site-footer :focus-visible, .stats :focus-visible, .edit-bar :focus-visible {
  outline-color: #fff;
}

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 1rem; padding: .8rem 1.5rem; border-radius: var(--radius-md);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white); border: 1px solid rgba(255,255,255,.4); }

/* Hover effects only where hover is a real input mode. On touch these latch
   after a tap and stay stuck until something else is tapped. */
@media (hover: hover) {
  .btn-primary:hover { background: var(--gold-600); color: var(--navy); transform: translateY(-1px); }
  .btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }
}

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  transition: transform .28s ease;
}
/* Slides the sticky header up out of view on scroll-down; app.js toggles the
   class on scroll-up. translateY(-101%) clears the 1px bottom border too. */
.site-header.is-hidden { transform: translateY(-101%); }
/* Vestibular safety: no sliding header for readers who ask for less motion.
   app.js also skips the whole behaviour, so the header just stays put. */
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
  .site-header.is-hidden { transform: none; }
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--navy); font-size: 1.2rem; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--navy); color: var(--gold); font-weight: 800;
}
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav-links a { color: var(--slate); font-weight: 600; font-size: .98rem; }
.nav-links a:hover { color: var(--navy); }
.nav-tools { display: flex; align-items: center; gap: .8rem; }
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg-soft);
}
/* Anchors, not buttons: each language is a real page at /fr or /en, so the
   toggle is navigation and must be crawlable and middle-clickable. */
.lang-toggle a {
  display: inline-flex; align-items: center; border: 0; background: transparent;
  font-family: inherit; font-weight: 700; color: var(--muted); font-size: .85rem;
  /* 44px minimum touch target; the pill shape comes from the parent's radius. */
  padding: .6rem .9rem; min-height: 44px;
}
.lang-toggle a:hover { color: var(--navy); }
.lang-toggle a.active { background: var(--navy); color: #fff; }
.nav-cta { padding: .55rem 1rem; }

/* Hamburger — hidden on desktop, revealed with the nav breakpoint below. */
.menu-btn {
  display: none; border: 1px solid var(--line); background: var(--white); cursor: pointer;
  width: 44px; height: 44px; border-radius: var(--radius-md); padding: 0; place-items: center;
}
@media (hover: hover) { .menu-btn:hover { background: var(--bg-soft); } }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,162,75,.18), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 55%, var(--navy-500) 100%);
  color: #dbe6f3; padding: 5.5rem 0 6rem;
}
.hero .eyebrow { color: var(--gold); }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.2rem); max-width: 16ch; }
.hero p { font-size: 1.18rem; max-width: 60ch; color: #c7d5e6; }
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* Stats */
.stats { background: var(--navy-700); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 2.6rem 0; }
.stat { text-align: center; }
.stat .value { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; color: var(--gold); }
.stat .label { color: #c7d5e6; font-size: .95rem; }

/* Sections */
/* Offset anchor targets so the sticky header does not cover the heading the
   visitor just navigated to. Header height plus a 16px breathing gap. */
main[id], section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
section.block { padding: 5rem 0; }
section.block.alt { background: var(--bg-soft); }
.section-head { max-width: 720px; margin-bottom: 2.6rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { font-size: 1.1rem; }

/* Services grid */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
}
.card .icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.6rem; background: var(--bg-alt); margin-bottom: 1rem;
}
.card h3 { font-size: 1.2rem; }
.card p { margin: 0; color: var(--slate); }

/* Approach steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.step {
  background: var(--white); border-radius: var(--radius); padding: 1.6rem; border-top: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.step h3 { font-size: 1.1rem; }
.step p { margin: 0; font-size: .98rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: start; }
.about-body p { font-size: 1.08rem; margin-bottom: 1.1rem; }
.values { display: grid; gap: 1rem; }
.value {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--navy-500);
  border-radius: 10px; padding: 1.1rem 1.3rem;
}
.value h4 { margin: 0 0 .25rem; color: var(--navy); }
.value p { margin: 0; font-size: .96rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
.contact-info li { list-style: none; margin: 0 0 1rem; padding-left: 1.8rem; position: relative; }
.contact-info { padding: 0; margin: 1.5rem 0 0; }
.contact-info .k { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.contact-info li::before { content: ""; position: absolute; left: 0; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .35rem; font-size: .95rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .7rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-family: inherit;
  /* White, not --bg-soft: a grey fill inside the white .form card is the
     conventional signal for a disabled field, which these are not. Definition
     comes from the border instead. */
  font-size: 1rem; color: var(--slate); background: var(--white);
}
/* background already white above; focus only adds the ring. */
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--navy-500); border-color: transparent; }
.field textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: .9rem; margin-top: .8rem; }
.form-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); padding: .9rem 1rem; border-radius: var(--radius-md); }

/* Footer */
.site-footer { background: var(--navy); color: #b9c8dc; padding: 3rem 0 2rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.site-footer .brand { color: #fff; }
.site-footer a { color: #cdd9e8; }
.footer-blurb { max-width: 42ch; margin-top: .8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.2rem; font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}
/* Nav collapses into a drop-down before the full row (brand + 4 links + toggle
   + CTA) can overflow. Measured to crowd around tablet-portrait width, so the
   hamburger engages at 820px — earlier than the 640px content-grid breakpoint
   below. app.js keys its resize-reset on the same 820px value. */
@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .nav-cta { display: none; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .9rem 24px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
  .cards, .steps, .stats-grid { grid-template-columns: 1fr; }
  .hero { padding: 4rem 0; }
}

/* Shared utility. Also declared in admin.css, which admin.html loads on top of
   this file; the public page loads styles.css alone and needs its own copy. */
.hidden { display: none !important; }

/* Respect the visitor's motion preference: drop smooth scrolling and the
   hover/transition movement, keeping colour changes intact. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .btn-primary:hover, .card:hover { transform: none; }
}

/* Edit-mode hint banner (shown to logged-in superusers on the public site) */
.edit-bar {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: var(--navy); color: #fff; padding: .7rem .8rem .7rem 1rem; border-radius: 999px;
  box-shadow: var(--shadow-lg); display: none; align-items: center; gap: .7rem; font-size: .9rem;
}
.edit-bar a { color: var(--gold); font-weight: 700; }
.edit-bar .edit-bar-close {
  border: 0; background: transparent; color: #9fb3cc; cursor: pointer; font-family: inherit;
  font-size: 1.1rem; line-height: 1; border-radius: 50%;
  min-width: 44px; min-height: 44px; display: grid; place-items: center;
}
.edit-bar .edit-bar-close:hover { background: rgba(255,255,255,.15); color: #fff; }

@media (max-width: 640px) {
  /* Anchored bottom-right it covered the contact form's submit button. Full
     width along the bottom keeps it out of the tap path of anything above it. */
  .edit-bar {
    left: 10px; right: 10px; bottom: 10px; border-radius: 12px;
    justify-content: center; font-size: .85rem;
  }
}
