/* Styles réservés au simulateur et à ses points d’entrée. */
.time-simulator, .time-banner, .solutions-accordion {
  /* Couleurs déjà présentes dans la charte, stables dans les deux thèmes. */
  --time-night: #1B2A6B;
  --time-deep: #0B1028;
  --time-white: #FFFFFF;
  --time-ink: #1F2B4F;
  --time-pale: #EDF2FB;
  --time-cyan: #00b0ff;
}
.time-simulator {
  --time-violet: #5B3FD8;
  --time-violet-hover: #6C4DE6;
  max-width: var(--container);
}
.time-simulator-section { scroll-margin-top: 100px; }
.time-simulator .time-title { max-width: 24ch; }
.time-intro { max-width: 65ch; }
.time-columns { display: grid; gap: 1.5rem; align-items: stretch; }
.time-inputs, .time-results { min-width: 0; border-radius: 0; padding: clamp(1.25rem, 3vw, 2rem); }
.time-inputs { background: var(--time-white); color: var(--time-night); border: 1px solid var(--color-border); }
.time-inputs fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.time-inputs legend { font-weight: 500; padding: 0; margin-bottom: .75rem; }
.time-task { padding-top: 1.25rem; }
.time-task-heading { display: flex; align-items: baseline; gap: .75rem; justify-content: space-between; }
.time-task label { font-weight: 500; line-height: 1.4; }
.time-task output { flex-shrink: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.time-task input[type="range"] { display: block; width: 100%; min-height: 44px; margin: .25rem 0 0; padding: 0; accent-color: var(--time-night); color-scheme: light; cursor: pointer; }
.time-results { background: var(--time-night); color: var(--time-white); }
.time-results > .eyebrow { margin-top: 0; }
.time-result { margin: 1rem 0 1.25rem; }
.time-result-value { margin: 0; line-height: 1.1; }
.time-week-unit { margin: .35rem 0 .75rem; }
.time-annual { margin: 0; }
.time-result-label { margin: 1rem 0 .5rem; }
.time-declared { margin: 0 0 1.25rem; }
.time-invite { margin: 1rem 0; }
.time-actions { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.time-actions:has(.time-start:not([hidden])) { display: grid; grid-auto-rows: 1fr; }
.time-actions .time-start { background: var(--time-violet); border-color: transparent; }
.time-start:hover { background: var(--time-violet-hover); }
.time-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .8rem 1rem;
  border: 1px solid var(--time-white);
  border-radius: 0;
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.time-booking { background: var(--time-white); color: var(--time-ink); border-color: var(--time-ink); }
.time-booking:hover { background: var(--time-pale); }
.time-action:hover { text-decoration: underline; text-underline-offset: .2em; }
.time-disclaimer { margin: 1rem 0 0; }
.time-method { max-width: var(--container); padding-bottom: 2rem; }
.time-floating { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100vw - 2rem); font-size: .875rem; padding: .65rem 1rem; min-height: 44px; text-align: center; white-space: normal; }
.time-floating-space { height: calc(80px + env(safe-area-inset-bottom)); }
.time-simulator [hidden], .time-floating[hidden] { display: none !important; }
.time-simulator :is(a, button, input):focus-visible, .time-banner a:focus-visible, .time-floating:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 4px; }
.time-results a:focus-visible { outline-color: var(--time-white); }
.time-inputs input:focus-visible { outline-color: var(--time-night); }
@media (min-width: 900px) { .time-columns { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .time-floating, .time-simulator *, .time-banner-link { animation: none !important; transition: none !important; }
}
/* Respecter les rôles typographiques existants et leurs règles prioritaires. */
@layer typography {
  html[data-theme] .time-simulator .time-title {
    color: var(--color-primary) !important;
    -webkit-text-fill-color: var(--color-primary) !important;
  }
  html[data-theme] .time-simulator .time-inputs :is(legend, label, output) {
    color: var(--time-night) !important;
    -webkit-text-fill-color: var(--time-night) !important;
  }
  html[data-theme] .time-simulator .time-results p {
    color: var(--time-white) !important;
    -webkit-text-fill-color: var(--time-white) !important;
  }
  html[data-theme] .time-simulator .time-results .time-annual {
    color: var(--time-cyan) !important;
    -webkit-text-fill-color: var(--time-cyan) !important;
  }
  html[data-theme] body .time-simulator .time-start {
    color: var(--time-white) !important;
    -webkit-text-fill-color: var(--time-white) !important;
    font-weight: 500 !important;
  }
  html[data-theme] .time-simulator .time-booking {
    color: var(--time-ink) !important;
    -webkit-text-fill-color: var(--time-ink) !important;
  }
  html[data-theme] body .time-simulator .time-results .time-result .time-result-value {
    font-family: var(--font-display) !important;
    font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
    line-height: 1.1 !important;
  }
  html[data-theme] body .time-simulator .time-result-label {
    font-size: var(--fs-secondary) !important;
    line-height: var(--lh-secondary) !important;
  }
  html[data-theme] body .time-simulator .time-declared {
    font-size: calc(var(--fs-introduction) * 1.5) !important;
    line-height: var(--lh-introduction) !important;
    font-weight: 400 !important;
  }
  html[data-theme] .time-simulator .time-disclaimer {
    font-size: var(--fs-secondary) !important;
    line-height: var(--lh-secondary) !important;
  }
}

/* Bandeau partagé, avec les teintes explicitement demandées. */
.time-banner {
  --banner-bg: #EDF2FB;
  --banner-border: #C3D2EA;
  --banner-title: #1F2B4F;
  --banner-text: #3B4A73;
  --banner-number: #2F62ED;
  --banner-annual: #3E3EC1;
  margin: .75rem 0;
}
.time-banner-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "intro action" "sectors sectors" "note note";
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--banner-border);
  border-radius: 26px;
  background: var(--banner-bg);
  color: var(--banner-text);
}
.time-banner-intro { grid-area: intro; min-width: 0; }
.time-banner-intro p { margin: .5rem 0 0; }
.time-banner-link {
  grid-area: action;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .875rem 1.5rem;
  border-radius: 10px;
  background: var(--banner-title);
  color: var(--time-white);
  text-align: center;
  text-decoration: none;
}
.time-banner-sectors {
  grid-area: sectors;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--banner-border);
  border-radius: 20px;
  background: var(--time-white);
  overflow: hidden;
}
.time-banner-sectors li { display: flex; min-width: 0; }
.time-banner-sectors li + li { border-left: 1px solid var(--banner-border); }
.time-banner-sector {
  display: grid;
  grid-template-areas: "name" "tasks" "weekly" "unit" "annual";
  grid-template-rows: auto minmax(2.8em, 1fr) auto auto auto;
  width: 100%;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--banner-text);
}
.time-banner-name { grid-area: name; }
.time-banner-task { grid-area: tasks; margin-top: .5rem; }
.time-banner-weekly { grid-area: weekly; margin-top: 1.25rem; }
.time-banner-unit { grid-area: unit; }
.time-banner-annual { grid-area: annual; margin-top: .75rem; }
.time-banner-note { grid-area: note; margin: 0; }
.time-banner a:hover .time-banner-name, .time-banner-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.time-banner a:focus-visible { outline: 3px solid var(--banner-title); outline-offset: -3px; }
.time-banner .time-banner-link:focus-visible { outline-offset: 3px; }
@media (max-width: 760px) {
  .time-banner-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "sectors" "action" "note"; padding: 1rem; gap: 1.25rem; }
  .time-banner-sectors { grid-template-columns: minmax(0, 1fr); }
  .time-banner-sectors li + li { border-left: 0; border-top: 1px solid var(--banner-border); }
  .time-banner-sector { grid-template-areas: "name weekly" "annual unit"; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: .75rem; row-gap: .25rem; padding: 1rem; }
  .time-banner-task { display: none; }
  .time-banner-weekly { margin-top: 0; text-align: right; }
  .time-banner-unit { text-align: right; }
  .time-banner-annual { margin-top: 0; }
  .time-banner-link { width: 100%; }
  body.home-page .time-banner-sector {
    grid-template-areas: "name" "weekly" "unit" "annual";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
  }
  body.home-page .time-banner :is(.time-banner-weekly, .time-banner-unit) { text-align: left; }

}
@layer typography {
  html[data-theme] body .time-banner h3 {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: var(--banner-title) !important;
    -webkit-text-fill-color: var(--banner-title) !important;
  }
  html[data-theme] body .time-banner :is(p, span, a, strong) {
    color: var(--banner-text) !important;
    -webkit-text-fill-color: var(--banner-text) !important;
  }
  html[data-theme] body .time-banner .time-banner-link {
    font-size: var(--fs-action) !important;
    font-weight: 700 !important;
    color: var(--time-white) !important;
    -webkit-text-fill-color: var(--time-white) !important;
  }
  html[data-theme] body .time-banner .time-banner-name {
    font-weight: 700 !important;
    color: var(--banner-title) !important;
    -webkit-text-fill-color: var(--banner-title) !important;
  }
  html[data-theme] body .time-banner .time-banner-task { font-size: 13px !important; line-height: 1.4 !important; }
  html[data-theme] body .time-banner .time-banner-weekly {
    font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: var(--banner-number) !important;
    -webkit-text-fill-color: var(--banner-number) !important;
  }
  html[data-theme] body .time-banner .time-banner-annual {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--banner-annual) !important;
    -webkit-text-fill-color: var(--banner-annual) !important;
  }
  html[data-theme] body .time-banner .time-banner-note { font-size: 12px !important; line-height: 1.45 !important; }
}

/* L’accueil utilise le mécanisme de thème commun du site. */
html[data-theme="light"] body.home-page .time-banner {
  --banner-bg: linear-gradient(135deg, #EFEBFC 0%, #E3ECFC 100%);
  --banner-border: #D3D6F4;
  --banner-table-bg: rgba(255, 255, 255, .8);
  --banner-button-bg: #1F2B4F;
  --banner-button-text: #FFFFFF;
}
html[data-theme="dark"] body.home-page .time-banner {
  --banner-bg: #18214F;
  --banner-border: #2C377F;
  --banner-table-bg: #10173F;
  --banner-title: #FFFFFF;
  --banner-text: #C3D2EA;
  --banner-number: #8FB4FF;
  --banner-annual: #B9B3FF;
  --banner-button-bg: #FFFFFF;
  --banner-button-text: #1F2B4F;
}
body.home-page .time-banner-sectors { background: var(--banner-table-bg); }
body.home-page .time-banner-link { background: var(--banner-button-bg); }
.time-profiles { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0; }
.time-profiles button { appearance: none; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--time-night); border-radius: 0; background: var(--time-white); color: var(--time-night); cursor: pointer; text-align: center; }
.time-profiles button[aria-pressed="true"] { background: var(--time-night); color: var(--time-white); }
.time-simulator .time-benefit { padding-left: 1.2rem; }
.time-input-hint { margin: 1rem 0 0; }
@layer typography {
  html[data-theme] body.home-page .time-banner .time-banner-link {
    color: var(--banner-button-text) !important;
    -webkit-text-fill-color: var(--banner-button-text) !important;
  }
  html[data-theme] body .time-simulator .time-profiles button {
    font-size: var(--fs-action) !important;
    font-weight: 500 !important;
    color: var(--time-night) !important;
    -webkit-text-fill-color: var(--time-night) !important;
  }
  html[data-theme] body .time-simulator .time-profiles button[aria-pressed="true"] {
    color: var(--time-white) !important;
    -webkit-text-fill-color: var(--time-white) !important;
  }
  html[data-theme] body .time-simulator .time-input-hint {
    font-size: var(--fs-secondary) !important;
    color: var(--time-night) !important;
    -webkit-text-fill-color: var(--time-night) !important;
  }
}

/* Ajustements limités au bandeau de l’accueil et au simulateur. */
body.home-page :is(.time-banner-inner, .time-banner-sectors, .time-banner-link),
.time-simulator :is(.time-inputs, .time-results, .time-profiles button, .time-action) {
  border-radius: 0 !important;
}
.time-simulator :is(.time-start, .time-booking):focus-visible { outline: 2px solid var(--time-white); outline-offset: 3px; box-shadow: 0 0 0 2px var(--time-ink); }
.time-count { position: relative; font-variant-numeric: tabular-nums; }
.time-count [data-time-final] { opacity: 0; }
.time-count [data-time-visual] { position: absolute; inset: 0; pointer-events: none; }
@layer typography {
  html[data-theme] body.home-page .time-banner :is(h3, .time-banner-name) {
    font-weight: 600 !important;
  }
  html[data-theme] body.home-page .time-banner :is(.time-banner-weekly, .time-banner-annual) {
    font-weight: 500 !important;
  }
  html[data-theme] body.home-page .time-banner .time-banner-link,
  html[data-theme] body .time-floating { font-weight: 500 !important; }
  html[data-theme] body .time-simulator :is(h1, h2, h3, p, label, output, legend, button, a, strong, span) {
    font-weight: 400 !important;
  }
  html[data-theme] body .time-simulator :is(output, legend, button) { font-weight: 500 !important; }
  html[data-theme] body :is(.time-banner, .time-simulator) .time-count > span {
    font: inherit !important;
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
  }
}

/* Une respiration identique entre les secteurs et le bandeau dans les deux thèmes. */
@media (min-width: 1051px) {
  body.home-page .time-banner { margin-top: 64px; }
}
