/*
 * Cegid Life — global styles and design tokens
 *
 * Tokens are declared on :root. CSS custom properties inherit through shadow
 * boundaries, so every value below is readable from inside the LWC component
 * stylesheets even though selectors here are not. Components consume
 * var(--cegid-*) rather than repeating literals.
 *
 * Values measured from Figma file dp7e2mGhOImWIcG0myMzB9,
 * page "[copy] Webdesign CegidLife 2027" plus "Internal master components".
 */

/* Inter 700 is here because --cegid-weight-bold (700) is used in three live
   places - the hero subtitle's "Cegid Life." run, the ServiceNow ticket count,
   and .grid-title in the advertisement grid - and Figma specifies Inter Bold
   for the first two. Without it the browser synthesises a faux bold from 600. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=STIX+Two+Text:wght@400;500&display=swap");

:root {
  /* ---- Typeface -------------------------------------------------------- */
  --cegid-font-display: "STIX Two Text", Georgia, "Times New Roman", serif;
  --cegid-font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Brand ----------------------------------------------------------- */
  --cegid-brand: #2962ff;
  --cegid-brand-contrast: #ffffff;

  /* Measured from the kit's secondary hover - the stroke, the label and the
   * disc all take it, and it is the ground the primary's hover texture loads
   * over. Was #1f4ecc, set from the branding set's _PrimaryAccentColor1 ramp
   * while the kit was out of reach. Kit 7422:20775. */
  --cegid-brand-hover: #2053d1;

  /* PROVISIONAL and unused. The kit draws a disabled button as the brand at
   * 64% rather than as a tint of its own, which is what cegidLifeButtonStyles
   * does, so nothing reads this. Kit 7422:20771. */
  --cegid-brand-disabled: #a9c0ff;

  /* The palest brand tint, for the hover ground of controls that rest
   * transparent - currently the outline button. Measured as the brand at 8%
   * over white, which is exactly what the kit's secondary hover draws. */
  --cegid-brand-wash: #eef3ff;

  /* ---- Pressed --------------------------------------------------------- */
  /* The kit grades the pressed state down to navy. Primary presses to a dark
   * fill; the outline button presses to a navy stroke and label over a wash
   * twice the strength of its hover one. Kit 7422:20769 and 7422:20777.
   *
   * The wash is left at alpha rather than flattened over white like
   * --cegid-brand-wash above: it has to hold up on the tinted cards too.
   *
   * The ink is the kit's own composite, not a colour picked to look like it:
   * Secondary/Navy 68% (#022341ad) over Primary/Blue. The kit's pressed arrow
   * asset is those two fills stacked in that order, so the disc behind a
   * trailing icon takes this same value as the stroke and the label.
   *
   * --cegid-brand-pressed is unused, and kept for a pressed fill that has to
   * be a flat colour: it is the veil below flattened over Primary/Blue, which
   * is what the primary button now composites to rather than declaring. Was
   * #0b3482, read off the kit as Navy 68% while the two pointer states had not
   * been given as fills. */
  --cegid-brand-pressed: #1847a1;
  --cegid-brand-pressed-ink: #0e377e;
  --cegid-brand-pressed-wash: rgba(41, 98, 255, .12);

  /* The two pointer states of a primary button, as Figma gives them: one navy
   * veil over Primary/Blue, 12% on hover and 48% on pressed. The pair is a
   * single knob on purpose - the fill underneath does not change between them,
   * which is what lets the CTA texture keep playing while the button is held
   * down. See .cegid-btn--primary in c/cegidLifeButtonStyles.
   *
   * The pressed veil replaces a fitted rgba(8, 25, 1, .28), which stood in for
   * these while the states were only readable from renders. */
  --cegid-brand-veil-hover: rgba(6, 42, 60, .12);
  --cegid-brand-veil-pressed: rgba(6, 42, 60, .48);

  /* ---- Ink ------------------------------------------------------------- */
  --cegid-ink: #022341;
  --cegid-ink-muted: #53697e;
  --cegid-ink-deep: #06325a;
  --cegid-ink-tertiary: #666666;
  --cegid-ink-hover : #e2e3e4;

  /* ---- Surfaces -------------------------------------------------------- */
  --cegid-surface: #ffffff;
  --cegid-surface-warm: #f7f6f5;
  --cegid-surface-tint: #f0f9ff;
  --cegid-surface-tint-strong: #e5f4ff;
  --cegid-surface-blue: #cce9ff;
  --cegid-surface-grey: #ebebeb;

  /* ---- Borders --------------------------------------------------------- */
  --cegid-border: #c2cad1;
  --cegid-border-strong: #022341;
  --cegid-border-subtle: #ebebeb;
  --cegid-border-focus: #2962ff;

  /* ---- Semantic -------------------------------------------------------- */
  --cegid-success: #22cb58;
  --cegid-success-border: #3eaf3f;
  --cegid-warning: #ffbc4f;
  --cegid-error: #ed4a4a;

  /* ---- Type scale: display (STIX Two Text) ----------------------------- */
  --cegid-display-1-size: 56px;
  --cegid-display-1-line: 62px;
  --cegid-display-2-size: 48px;
  --cegid-display-2-line: 53px;
  --cegid-display-3-size: 36px;
  --cegid-display-3-line: 40px;
  --cegid-display-4-size: 28px;
  --cegid-display-4-line: 34px;
  --cegid-heading-1-size: 24px;
  --cegid-heading-1-line: 29px;
  --cegid-heading-2-size: 20px;
  --cegid-heading-2-line: 24px;
  --cegid-display-weight: 400;
  --cegid-heading-weight: 500;

  /* ---- Type scale: UI and body (Inter) --------------------------------- */
  --cegid-body-lg-size: 18px;
  --cegid-body-lg-line: 27px;
  --cegid-body-size: 16px;
  --cegid-body-line: 24px;
  --cegid-ui-size: 14px;
  --cegid-ui-line: 21px;
  --cegid-caption-size: 12px;
  --cegid-caption-line: 16px;
  --cegid-label-size: 13px;
  --cegid-label-line: 18px;
  --cegid-weight-regular: 400;
  --cegid-weight-medium: 500;
  --cegid-weight-semibold: 600;
  /* Inter 700 is rare but real: the design uses it for the emphasised run
   * inside a sentence, e.g. "Cegid Life." in the hero subtitle. */
  --cegid-weight-bold: 700;

  /* ---- Radius ---------------------------------------------------------- */
  --cegid-radius-pill: 100px;
  --cegid-radius-xl: 40px;
  --cegid-radius-lg: 32px;
  --cegid-radius-card: 12px;
  --cegid-radius-md: 10px;
  --cegid-radius-sm: 8px;
  --cegid-radius-xs: 6px;
  --cegid-radius-xxs: 4px;

  /* ---- Layout -----------------------------------------------------------
   * The page width and gutter. These used to live only in
   * c/cegidLifeLayoutStyles, declared on the .page-section selectors - which
   * put them out of reach of any component that cannot carry that class.
   * cegidLifePageAndCompanyInfo is the standing example: it paints the banner
   * background on the very box .page-section would pad, so the artwork would
   * bleed into the gutter. Such components kept private copies of these two
   * numbers, and copies drift. Declaring them here, where custom properties
   * inherit through shadow boundaries, gives every component one source.
   *
   * THE RULE THAT MAKES THIS SAFE: every consumer must supply a literal
   * fallback - var(--page-gutter, 40px), never a bare var(--page-gutter).
   *
   * The note that stood here previously forbade layout in this file, because
   * the site bundle and the component bundles deploy independently and an
   * undefined custom property invalidates its whole declaration rather than
   * falling back - so a gutter defined only here collapses to ZERO while the
   * two are out of step. That happened once on this project and the warning
   * was correct. The fallbacks are what answer it: until this file is
   * republished, the layout holds at the desktop values instead of collapsing.
   * Drop a fallback and you reintroduce that bug.
   * ---------------------------------------------------------------------- */
  --page-content-width: 1252px;
  --page-gutter: 40px;

  /* ---- Stacking order ---------------------------------------------------
   * One ladder for everything on this site that overlaps something else.
   *
   * Before this, c/header sat at 9999999 and every overlay that had to clear
   * it picked its own number: 9999999999 in c/cegidLifeEmailBilling,
   * 100000000 in c/cegidLifeOnboardingVideos, 99999999 in
   * c/cegidLifeTableOfBuyers and c/cegidLifeTableOfContacts, 10000000 in
   * c/cegidLifeModalStyles and again for .contact-modal-overlay in
   * header.css, 999999999999 for the footer tooltip. Six values for one
   * requirement, each discovered alone, none aware of the others.
   *
   * And the inverse hack to match: header.css pushed the SLDS backdrop DOWN
   * to 9999 !important so it could not cover the bar. Nothing lowered the
   * header; everything that collided with it was lowered instead. That is
   * why c/cegidLifeAccountSwitch's loading scrim painted UNDER the header
   * while its modal painted OVER it - the grey jumped planes mid-interaction.
   *
   * THE SAME FALLBACK RULE AS --page-gutter ABOVE APPLIES, and it matters
   * more here: write var(--cegid-z-overlay, 40000), never a bare var(). An
   * undefined custom property invalidates its whole declaration, and
   * z-index then computes to auto - which would drop every modal BEHIND the
   * header for as long as this file and the component bundles are out of
   * step. The fallbacks are the token values, so the ladder holds either way.
   *
   * WHY 30000 AND NOT 100: a clean-sheet scale would put the bar at two
   * digits. Components still on local literals sit in the 100-9999 range -
   * c/qualtricsFloatingButton 9999 (on mainAppPage, so on every page),
   * c/mandateManagement 9999, c/trainingDocuments and c/footerBanner 999,
   * c/understandMyInvoice 998-999, c/accountStatement 100 - and whether each
   * shares a stacking context with the header depends on region nesting, page
   * by page. Dropping the bar to 100 would put all of them above it and needs
   * each one audited first. The headroom costs nothing and regresses nothing,
   * so it stands until someone does that pass.
   * ---------------------------------------------------------------------- */
  --cegid-z-raised: 10;      /* cards, sticky table heads: local lifts */
  --cegid-z-dropdown: 20000; /* in-content popovers and their scrims */
  --cegid-z-header: 0;   /* the site bar - the one real ceiling */
  --cegid-z-overlay: 40000;  /* modal scrims and dialogs, above the bar */
  --cegid-z-tooltip: 50000;  /* tooltips, which must clear even a modal */
}

/* The breakpoint ladder for the gutter. Not designed - it applies only below
   the point where the 1252 content box stops fitting with its full gutter. */
@media (max-width: 767px) {
  :root {
    --page-gutter: 24px;
  }
}

@media (max-width: 479px) {
  :root {
    --page-gutter: 16px;
  }
}

/* -------------------------------------------------------------------------
 * Base document
 * ---------------------------------------------------------------------- */

.component-wrapper-spacer{
  margin-bottom: 0px !important;
}

/* min-height, not height: `height: 100%` fixes the body to exactly the
   viewport, so every page longer than one screen overflows its own box. The
   footer needs the page to be *at least* a screen tall, never exactly one. */
html,
body {
  min-height: 100%;
}

html {
  background: var(--cegid-surface);
}

body {
  margin: 0;
  font-family: var(--cegid-font-body);
  font-size: var(--cegid-body-size);
  line-height: var(--cegid-body-line);
  color: var(--cegid-ink);
}

.cegid-h2 {
  margin: 0;
  font-family: var(--cegid-font-display);
  font-weight: var(--cegid-display-weight);
  font-size: var(--cegid-display-2-size);
  line-height: var(--cegid-display-2-line);
  letter-spacing: -0.01em;
  color: var(--cegid-ink);
}

.cegid-body-lg {
  margin: 0;
  font-family: var(--cegid-font-body);
  font-weight: var(--cegid-weight-regular);
  font-size: var(--cegid-body-lg-size);
  line-height: var(--cegid-body-lg-line);
  color: var(--cegid-ink-deep);
}

.cegid-text-center {
  text-align: center;
}

/* -------------------------------------------------------------------------
 * Inline URLs
 *
 * The ramp .cegid-btn--text walks in c/cegidLifeButtonStyles - Figma "Text
 * link" I50:1847;422:4525 - with the box and the type left off. That variant
 * is a 40px flex control sized for the header's Login container; a link in
 * running text has to take its paragraph's font and sit on its line, so only
 * the colours, the decoration and the fade come across.
 *
 *   rest     --cegid-brand              #2962ff
 *   hover    --cegid-brand-hover        #2053d1
 *   pressed  --cegid-brand-pressed-ink  #0e377e
 *
 * On bare <a>, so a link is right without an author reaching for a class.
 * Specificity 0,0,1 and no !important, on purpose: an anchor that is not an
 * inline URL opts out by stating its own colour, which every styled anchor in
 * the site already does - the footer's white links, the menu rows' navy
 * labels, quickLinks' tiles. What is left is the unclassed anchor in running
 * text, which is the case this is for.
 * ---------------------------------------------------------------------- */

a {
  color: var(--cegid-brand) !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
}

/* text-decoration is restated because the platform's own link styling
   underlines an <a> under the cursor; the `none` above only covers the rest
   state. Same reason the header's contact e-mail and the invoices table's
   multi-download both restate it. */
a:hover {
  color: var(--cegid-brand-hover) !important;
  text-decoration: none !important;
}

/* The :not() guard carries the weight that beats the hover above, which a bare
   :active would only tie with, and keeps the state off a link rendered inert -
   an anchor takes no :disabled, so aria-disabled is the only hook. */
a:not([aria-disabled="true"]):active {
  color: var(--cegid-brand-pressed-ink) !important;
}

/* .cegid-btn--text has no focus ring - as a 40px control in the header it was
   never asked for one. An inline link needs it. The radius keeps a link that
   wraps across two lines from being boxed in a bare rectangle. */
a:focus-visible {
  outline: 2px solid var(--cegid-brand) !important;
  outline-offset: 2px !important;
  border-radius: 2px !important;
}

/* CMS rich text is where the opt-out above backfires: the editor writes the
   author's colour pick as an inline style, and the platform's own
   `a:link:not(...)` is (0,2,2). Both outrank (0,0,1), hence !important.
   [part="formatted-rich-text"] is the wrapper span, matched as the plain
   attribute it is - ::part() names it but can select nothing beneath it. */
:is(
  lightning-formatted-rich-text,
  .slds-rich-text-editor__output,
  [part="formatted-rich-text"]
) a {
  color: var(--cegid-brand) !important;
  text-decoration: none !important;
}

:is(
  lightning-formatted-rich-text,
  .slds-rich-text-editor__output,
  [part="formatted-rich-text"]
) a:hover {
  color: var(--cegid-brand-hover) !important;
  text-decoration: none !important;
}

/* Without this the inline colour wins back the moment the link is pressed,
   and the press reads as a flash of the author's blue. */
:is(
  lightning-formatted-rich-text,
  .slds-rich-text-editor__output,
  [part="formatted-rich-text"]
) a:not([aria-disabled="true"]):active {
  color: var(--cegid-brand-pressed-ink) !important;
}

/* The editor wraps a recoloured run in its own tag, so the anchor can take
   the brand while the text inside it keeps the author's inline colour. */
:is(
  lightning-formatted-rich-text,
  .slds-rich-text-editor__output,
  [part="formatted-rich-text"]
) a :is(span, u, strong, em, b, i) {
  color: inherit !important;
}

/* -------------------------------------------------------------------------
 * Sticky footer
 *
 * Every view puts c/footer in the last community_layout:section of
 * sldsFlexibleLayout's "content" region, so on a short page - the knowledge
 * base is six cards - the footer lands mid-viewport with white space beneath.
 *
 * The wrappers between <body> and the footer are generated by LWR: they are
 * not in the retrieved metadata and cannot be named here with any confidence.
 * So rather than guess class names, :has() is used to select *whatever* those
 * wrappers turn out to be, by the one thing that is known about them - that
 * they contain the footer. `body :has(c-footer)` is exactly the ancestor
 * chain and nothing else; elements inside the footer do not contain one.
 *
 * Each link in that chain becomes a growing flex column, so the leftover
 * viewport space is handed down to the footer's own section, and the auto top
 * margin on the host pushes the footer to the bottom of it. Sections that do
 * NOT contain the footer are never matched and keep sizing to their content.
 *
 * If the chain is unreachable (real shadow DOM rather than synthetic, or a
 * different host tag), nothing matches and the page renders as it does today.
 * This is additive: the failure mode is the current behaviour, not a break.
 * ---------------------------------------------------------------------- */

body:has(c-footer) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:has(c-footer) :has(c-footer) {
  display: flex;
  flex-direction: column;
  /* grow, but never shrink below the content's own height */
  flex: 1 0 auto;
}

/* An LWC host is display: inline by default; as a flex item it is blockified,
   but the auto margin is what actually moves it to the bottom of the space
   its section just grew into. */
c-footer {
  margin-top: auto;
}

/* Theme header region: the section wrapping c/header kept its default content
   width, surface and rule - grey either side of the bar, a line under it. The
   footer section avoids this with maxContentWidth "none" and zero padding; same
   thing here. Wrappers are LWR-generated, so they are matched by what they
   contain; :not(:has(c-footer)) keeps the rule inside the header region. */
body :has(c-header):not(:has(c-footer)) {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}


/* Qualtrics feedback tab ("Donner mon avis") - navy ink ground, rounded on the
 * side facing the page, white bold label. */
#QSIFeedbackButton-btn > div {
  background: var(--cegid-ink, #022341) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0 8px 8px 0 !important;
  box-shadow: none !important;
}
#QSIFeedbackButton-btn > div,
#QSIFeedbackButton-btn > div * {
  color: #ffffff !important;
  font-family: var(--cegid-font-body) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}
/* Qualtrics puts an icon beside the label; the tab carries the text alone. */
#QSIFeedbackButton-btn img,
#QSIFeedbackButton-btn svg,
#QSIFeedbackButton-btn i,
#QSIFeedbackButton-btn [class*="icon" i] {
  display: none !important;
}

/* Qualtrics feedback popup - only the frame around the survey is reachable
 * from here. The survey itself is a cross-origin iframe, so its contents are
 * styled in Qualtrics (Look & Feel > Style > Custom CSS), mirroring the same
 * modules by hand.
 *
 * Frame: .cegid-modal (c/cegidLifeModalStyles) - tint ground, 1px blue border,
 * radius xl. Close: .cegid-btn-close (c/cegidLifeButtonStyles). */
#QSIFeedbackButton-target-container {
  background-color: var(--cegid-surface-tint, #f0f9ff) !important;
  border: 1px solid var(--cegid-surface-blue, #cce9ff) !important;
  border-radius: var(--cegid-radius-xl, 40px) !important;
  box-shadow: none !important;
  overflow: clip !important;
}
#QSIFeedbackButton-survey-iframe {
  border: 0 !important;
  border-radius: var(--cegid-radius-xl, 40px) !important;
  background: transparent !important;
}
#QSIFeedbackButton-close-btn-container {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  top: 24px !important;
  right: 24px !important;
  background: var(--cegid-surface-tint-strong, #e5f4ff) !important;
  border: 1.5px solid var(--cegid-surface-blue, #cce9ff) !important;
  border-radius: var(--cegid-radius-pill, 100px) !important;
  box-shadow: none !important;
  color: var(--cegid-brand, #2962ff) !important;
  cursor: pointer;
  transition:
    background-color 250ms cubic-bezier(.2, .8, .2, 1),
    border-color 250ms cubic-bezier(.2, .8, .2, 1) !important;
}
#QSIFeedbackButton-close-btn-container:hover {
  background: var(--cegid-brand, #2962ff) !important;
  border-color: var(--cegid-brand, #2962ff) !important;
  color: var(--cegid-brand-contrast, #ffffff) !important;
}
/* Qualtrics' own cross is an image positioned on its own, so it never sat on
   the disc and could not follow currentColor. It stays in place as the click
   target - stretched over the disc, invisible - and the cross is redrawn
   below as two currentColor bars, so it inverts with the disc's transition
   like .cegid-btn-close does. */
#QSIFeedbackButton-close-btn-container > * {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 1;
}
#QSIFeedbackButton-close-btn-container::before,
#QSIFeedbackButton-close-btn-container::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  border-radius: 1px;
  background-color: currentColor;
  pointer-events: none;
  transition: background-color 250ms cubic-bezier(.2, .8, .2, 1);
}
#QSIFeedbackButton-close-btn-container::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
#QSIFeedbackButton-close-btn-container::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) {
  #QSIFeedbackButton-close-btn-container,
  #QSIFeedbackButton-close-btn-container::before,
  #QSIFeedbackButton-close-btn-container::after {
    transition-duration: 1ms !important;
  }
}

.faq-content .ql-video {
  margin: 40px auto;
  display: block;
  border-radius: 40px;
}