/* ==========================================================================
   Flexitel — Styles de base, mise en page et sections
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
  font-weight: 800;
  line-height: 1.05;
}

h2 {
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.12;
}

h3 {
  font-size: var(--step-2);
  line-height: 1.25;
}

h4 {
  font-size: var(--step-1);
  line-height: 1.3;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Liens et focus
   -------------------------------------------------------------------------- */

a {
  transition: color var(--transition);
}

.text-link {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}

.text-link:hover {
  color: var(--color-primary);
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-white);
  color: var(--color-primary-dark);
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   Mise en page
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.section--light {
  background-color: var(--color-white);
}

.section--tinted {
  background-color: var(--color-background-light);
  background-image: var(--texture-dots);
  background-size: 22px 22px;
}

.section--gradient {
  background: var(--gradient-soft);
}

.section--deep {
  background-color: #0b1e2d;
  background-image: var(--texture-dots-light), var(--gradient-deep);
  background-size: 20px 20px, cover;
  color: rgba(255, 255, 255, 0.86);
}

.section--deep h2,
.section--deep h3,
.section--deep h4 {
  color: var(--color-white);
}

.section__header {
  max-width: 54rem;
  margin-bottom: var(--space-2xl);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

/* Filet d'accent éditorial SOUS le titre de section (signe la marque) */
.section__header > h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: var(--space-md);
  border-radius: 3px;
  background: var(--gradient-brand);
}

.section__header--center > h2::after {
  margin-inline: auto;
}

.section--deep .section__header > h2::after {
  background: var(--color-accent);
}

.section__intro {
  margin-top: var(--space-lg);
  font-size: var(--step-1);
  color: var(--color-text-muted);
  line-height: 1.65;
}

.section--deep .section__intro {
  color: rgba(255, 255, 255, 0.78);
}

.lead {
  font-size: var(--step-1);
  color: var(--color-text-muted);
  line-height: 1.65;
}

.prose > * + * {
  margin-top: var(--space-md);
}

.prose h2 {
  margin-top: var(--space-2xl);
}

.prose h3 {
  margin-top: var(--space-xl);
}

.prose p,
.prose li {
  color: var(--color-text-muted);
  line-height: 1.75;
}

.prose ul {
  padding-left: 1.15rem;
}

.prose ul li::marker {
  color: var(--color-primary);
}

.prose li + li {
  margin-top: var(--space-2xs);
}

/* Grilles génériques */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.split {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(2.75rem, 2rem + 4.5vw, 6rem) clamp(3rem, 2rem + 4vw, 5.5rem);
  background:
    radial-gradient(115% 85% at 90% -8%, var(--color-background-light) 0%, rgba(232, 244, 251, 0) 55%),
    var(--color-background);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -12%;
  inset-block-start: -30%;
  width: min(46rem, 70vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(51, 185, 223, 0.16) 0%, rgba(51, 185, 223, 0) 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 4vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

.hero__eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand);
}

.hero__title {
  margin-top: var(--space-md);
}

/* Filet bleu sous le titre H1 du hero d'accueil (signe éditorial de la marque) */
.hero__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: var(--space-lg);
  border-radius: 4px;
  background: var(--gradient-brand);
}

.hero__title em {
  font-style: normal;
  color: var(--color-primary-dark);
}

.hero__subtitle {
  max-width: 34rem;
  margin-top: var(--space-lg);
  font-size: var(--step-1);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.hero__reassurance {
  display: grid;
  gap: var(--space-sm) var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.hero__media {
  position: relative;
}

/* Mockup softphone : centré, ombre douce, léger flottement */
.hero-illustration {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 30px 55px rgba(15, 37, 53, 0.18));
  animation: hero-float 7s ease-in-out infinite;
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-illustration {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Barre de confiance
   -------------------------------------------------------------------------- */

.trustbar {
  padding-block: var(--space-xl);
  border-block: 1px solid var(--color-border);
  background: var(--color-white);
}

.trustbar__inner {
  display: grid;
  gap: var(--space-lg) var(--space-2xl);
  align-items: center;
  grid-template-columns: 1fr;
}

.trustbar__text {
  max-width: 30rem;
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.trustbar__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Schéma de fonctionnement (SVG / HTML)
   -------------------------------------------------------------------------- */

.diagram {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.diagram__caption {
  margin-top: var(--space-lg);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Encart / citation
   -------------------------------------------------------------------------- */

.callout {
  display: flex;
  gap: var(--space-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  background: var(--color-background-light);
  border: 1px solid rgba(0, 138, 197, 0.18);
}

.callout__icon {
  flex-shrink: 0;
  color: var(--color-primary-dark);
}

.callout__title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
}

.callout p {
  color: var(--color-text-muted);
}

.callout p + p {
  margin-top: var(--space-xs);
}

.callout--quote {
  background: transparent;
  border: 0;
  border-left: 3px solid var(--color-primary);
  border-radius: 0;
  padding-block: var(--space-xs);
}

.callout--quote p {
  font-family: var(--font-heading);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.section--deep .callout {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.section--deep .callout p,
.section--deep .callout__icon {
  color: rgba(255, 255, 255, 0.82);
}

.section--deep .callout--quote p {
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Note / mention de prudence
   -------------------------------------------------------------------------- */

.note {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-background);
  border: 1px dashed var(--color-border-strong);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.section--deep .note {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
}

/* --------------------------------------------------------------------------
   Zone image remplaçable
   -------------------------------------------------------------------------- */

/* Conteneur prévu pour recevoir une photographie définitive fournie par Immotic.
   L'illustration SVG interne sert de visuel provisoire. */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-background-light);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.media-frame > svg,
.media-frame > img {
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Animations d'apparition (désactivées sans JS et si mouvement réduit)
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

.stack-sm > * + * {
  margin-top: var(--space-sm);
}

.stack-md > * + * {
  margin-top: var(--space-md);
}

.stack-lg > * + * {
  margin-top: var(--space-lg);
}

.stack-xl > * + * {
  margin-top: var(--space-xl);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mt-2xl {
  margin-top: var(--space-2xl);
}
