/**
 * components.css — Typographie, logo, liens animés, boutons aimantés,
 * curseur, lignes de services, formulaire.
 */

/* ================= TYPOGRAPHIE ================= */
.eyebrow {
  margin-bottom: 1.6rem;
  color: var(--blue);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
}

.display {
  max-width: 11em;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.display--md {
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
}

.lead {
  max-width: 26em;
  font-size: clamp(1.15rem, 1.9vw, 1.75rem);
  line-height: 1.3;
}

.lead--sm {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
}

.solution-card__text {
  max-width: 30em;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(2, 3, 15, 0.78);
}

/* ================= LOGO ================= */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
}

.logo__text {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.1;
}

.float-nav__logo .logo__text {
  font-size:0.72rem;
}

.logo__text b {
  font-weight: 700;
}

.logo__text span {
  font-weight: 400;
}

/* ================= SÉLECTEUR DE LANGUE ================= */
.lang {
  display: flex;
  gap: 1rem;
  padding-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
}

.lang a,
.lang span {
  display: inline-block; /* nécessaire pour que l'aimant puisse les déplacer */
  will-change: transform;
}

.lang [aria-disabled='true'] {
  opacity: 0.55;
  font-weight: 400;
  cursor: not-allowed;
}

/* ================= LIENS ANIMÉS (en-tête + pied de page) =================
 * Une flèche apparaît à gauche du lien en glissant de gauche à droite,
 * et repart en faisant le mouvement inverse.
 */
.nav-link {
  position: relative;
  display: inline-block;
  padding-block: 0.2rem;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-link--strong,
.nav-link[aria-current='page'] {
  font-weight: 700;
}

.nav-link--small {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.site-footer .nav-link:not(.nav-link--small) {
  font-size: 0.85rem;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(100% + 0.7em);
  width: 1.15em;
  height: 1.15em;
  margin-top: -0.575em;
  background: url('/assets/img/arrow-left.svg') center / contain no-repeat;
  opacity: 0;
  transform: translateX(-1.1em);
  transition: transform 0.55s var(--ease-out), opacity 0.35s ease;
  pointer-events: none;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-link--icon::before {
  display: none; /* l'icône est signalée par l'anneau du curseur, pas par la flèche */
}

.nav-link--icon svg {
  width: 1.15rem;
  height: 1.15rem;
  will-change: transform;
}

/* Liens sans flèche (bord gauche de page) : seul le curseur réagit. */
.site-footer__contact a,
.contact__mail {
  transition: opacity 0.3s ease;
}

/* ================= BOUTON AIMANTÉ =================
 * Le carré à flèche est déplacé/agrandi par le JS (magnet.js) et
 * devient un rond orange au survol.
 */
.btn {
  --btn-h: 3em;
  --btn-bg: var(--blue-black);
  --btn-fg: var(--white);
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  isolation: isolate;
  position: relative;
}

.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
}

.btn--blue {
  --btn-bg: var(--blue);
  --btn-fg: var(--white);
}

/* Variante « fantôme » : pas de fond, juste le texte et un contour sur l'icône — celle-ci
   est aimantée et entourée par le curseur en anneau (comme Instagram ou le retour en haut),
   au lieu de se remplir comme les boutons classiques. */
.btn--ghost .btn__label {
  background: transparent;
  color: var(--white);
  padding-inline: 0 1.2em;
}

.btn--ghost .btn__icon {
  background: transparent;
  color: var(--white);
}

.btn__label,
.btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--radius);
}

.btn__label {
  padding-inline: 1.5em;
}

.btn__icon {
  position: relative;
  z-index: 1;
  width: var(--btn-h);
  will-change: transform;
  transition: background-color 0.35s ease, border-radius 0.45s var(--ease-out), color 0.35s ease;
}

.btn__icon svg {
  width: 1.3em;
  height: 1.3em;
}

.btn.is-active .btn__icon {
  background: var(--orange);
  color: var(--white);
  border-radius: 50%;
}

/* ================= CURSEUR ORANGE ================= */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}

.cursor__dot {
  display: block;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0;
  transition:
    transform 0.5s var(--ease-out),
    width 0.55s var(--ease-out),
    height 0.55s var(--ease-out),
    margin 0.55s var(--ease-out),
    border-radius 0.55s var(--ease-out),
    background-color 0.3s ease,
    border-color 0.3s ease,
    opacity 0.3s ease;
}

.cursor.is-visible .cursor__dot {
  opacity: 1;
}

/* Survol d'un lien : plus gros, orange clair, opacité réduite */
.cursor.is-link .cursor__dot {
  transform: scale(4.5);
  background: var(--orange-light);
  opacity: 0.4;
}

/* Survol d'une icône (Instagram, retour en haut) : anneau orange autour de l'icône */
.cursor.is-ring .cursor__dot {
  width: var(--ring-w, 40px);
  height: var(--ring-h, 40px);
  margin: calc(var(--ring-h, 40px) / -2) 0 0 calc(var(--ring-w, 40px) / -2);
  border-radius: var(--ring-r, 50%);
  background: transparent;
  border-color: var(--orange);
}

/* Survol d'un bouton : le rond disparaît (le bouton devient le rond orange) */
.cursor.is-button .cursor__dot {
  opacity: 0;
}

/* Survol de l'image « Découvrir » : le rond grossit et devient le badge plein (transition continue,
   pas de disparition/réapparition) ; le texte s'y superpose avec un léger temps de retard. */
.cursor.is-reveal .cursor__dot {
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  background: var(--orange);
}

.cursor__label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity ease 0.15s; /* apparaît une fois le rond bien avancé dans sa croissance */
}

.cursor.is-reveal .cursor__label {
  opacity: 1;
  transition: opacity 0.35s ease 0.15s;
}

/* Survol d'une ligne de service : le rond s'efface, l'aperçu image le remplace (voir service-preview.js) */
.cursor.is-preview .cursor__dot {
  opacity: 0;
}

/* Le curseur système s'efface uniquement là où notre propre vignette prend le relais
   (survol des services) : sur l'image « Découvrir » le curseur système reste visible. */
@media (hover: hover) and (pointer: fine) {
  .service-row:hover {
    cursor: none;
  }
}

/* ================= APERÇU IMAGE AU SURVOL (services) ================= */
.hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  width: 168px;
  height: 126px;
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 18px 40px -12px rgba(2, 3, 15, 0.35);
  transition: opacity 0.35s ease;
  will-change: transform;
}

.hover-preview.is-visible {
  opacity: 1;
}

.hover-preview__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= LIGNES DE SERVICES ================= */
.service-row {
  position: relative;
  display: grid;
  gap: 0.6rem 1.5rem;
  padding: clamp(1.4rem, 2.6vw, 2.4rem) clamp(1.2rem, 2.4vw, 2.3rem);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s ease;
}

/* Aperçu caché du service (source pour l'image flottante ; ne s'affiche jamais tel quel) */
.service-row__preview {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.service-row:last-child {
  border-bottom-color: transparent;
}

.service-row__title {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 700;
  line-height: 1.2;
}

.service-row__text {
  max-width: 34em;
  font-size: 0.85rem;
  line-height: 1.35;
}

/* Texte légèrement plus grand dans « Notre expertise » (accueil) uniquement. */
.services .service-row__text {
  font-size: 0.95rem;
  line-height: 1.45;
}

@media (min-width: 700px) {
  .service-row {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    align-items: center;
  }
}

/* ================= FORMULAIRE ================= */
.form {
  display: grid;
  gap: 1.4rem;
}

.form__row {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 640px) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Champ piège anti-robot : hors écran, invisible pour les humains */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field label {
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field label small {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.field input:not([type='checkbox']),
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 0;
  border: 0;
  border-bottom: 1px solid rgba(11, 31, 94, 0.28);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  appearance: none;
  transition: border-color 0.3s ease;
}

.field select {
  background: url('/assets/img/chevron.svg') right 0.2rem center / 1rem no-repeat;
  padding-right: 1.6rem;
}

.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(11, 31, 94, 0.4);
}

.field input:not([type='checkbox']):focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--blue-light);
  box-shadow: 0 1px 0 0 var(--blue-light);
}

.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 0.75rem;
}

.field--check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: var(--blue);
}

.field--check label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
}

.field--check label a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field--check .field__error {
  grid-column: 2;
}

.field__error {
  min-height: 0;
  color: #c2410c;
  font-size: 0.75rem;
}

.field.has-error input:not([type='checkbox']),
.field.has-error select,
.field.has-error textarea {
  border-bottom-color: #c2410c;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.form-status {
  font-size: 0.9rem;
  line-height: 1.4;
}

.form-status--success {
  color: #0f7b45;
}

.form-status--error {
  color: #c2410c;
}

.contact__panel > .form-status {
  margin-bottom: 1.4rem;
}

.form.is-sending .btn {
  opacity: 0.6;
  pointer-events: none;
}

/* ================= RETOUR EN HAUT ================= */
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  justify-self: start;
  color: var(--white);
  font-weight: 700;
}

.to-top svg {
  width: 1.1rem;
  height: 1.1rem;
  will-change: transform;
}
