/* ==========================================================================
   FinRadar — home-product.css
   Fonctionnalités (bento : récap du lundi, alerte J-60, veille légale, radar
   des échéances) et comparatif avant / avec FinRadar.
   Ne déclare aucune valeur brute : tout vient de tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Bento — quatre tuiles, deux larges. Les larges posent texte et visuel
   côte à côte dès qu'il y a la place.
   -------------------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.bento__tile {
  gap: var(--space-6);
  overflow: hidden;
}

.bento__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bento__visual {
  margin-top: auto;
}

.bento__extras {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

.bento__extras .chips {
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Le récap du lundi — l'email, et ses lignes qui se posent une à une
   -------------------------------------------------------------------------- */
.mail__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-panel-line);
}

.mail__avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background-image: var(--g-brand);
  box-shadow: inset 0 1px 0 rgb(var(--rgb-white) / 0.5);
}

.mail__meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mail__from {
  font-weight: var(--fw-bold);
}

.mail__to {
  font-weight: var(--fw-regular);
  color: var(--c-ink-muted);
}

.mail__subject {
  overflow: hidden;
  font-size: var(--fs-ui-sm);
  color: var(--c-ink-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mail__time {
  flex: 0 0 auto;
  font-size: var(--fs-ui-xs);
  color: var(--c-ink-faint);
}

.mail__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}

.mail__hello {
  padding-bottom: var(--space-1);
  font-size: var(--fs-ui-sm);
  color: var(--c-ink-muted);
}

.mail__more {
  padding-top: var(--space-1);
  font-size: var(--fs-ui-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-ink-accent);
}

/* --------------------------------------------------------------------------
   Alerte J-60 — l'anneau du compte à rebours. --ring (0 à 100) s'anime grâce
   à @property ; sans support, l'anneau s'affiche à sa valeur, sans mouvement.
   -------------------------------------------------------------------------- */
@property --ring {
  syntax: '<number>';
  inherits: false;
  initial-value: 97;
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--ring-size);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: var(--radius-pill);
  background-image: conic-gradient(var(--c-mint), var(--c-accent) calc(var(--ring) * 1%), var(--c-panel-line) 0);
}

.ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background-color: var(--c-panel);
  box-shadow: inset 0 2px 8px rgb(var(--rgb-bg) / 0.08);
}

.ring__label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring__value {
  font-size: var(--fs-h2);
  font-weight: var(--fw-heavy);
  line-height: 1;
  letter-spacing: -0.05em;
}

.ring__unit {
  font-size: var(--fs-ui-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
}

/* --------------------------------------------------------------------------
   Veille légale — un vrai radar, sombre : le faisceau tourne, chaque registre
   s'allume quand il le touche (délai calé sur l'angle de l'écho).
   -------------------------------------------------------------------------- */
.sweep {
  position: relative;
  width: 100%;
  max-width: var(--sweep-size);
  aspect-ratio: 1;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--c-accent-line);
  border-radius: var(--radius-pill);
  background-color: var(--c-bg-deep);
  background-image:
    radial-gradient(circle closest-side, transparent 32%, rgb(var(--rgb-accent) / 0.3) 32.5% 33.3%, transparent 34% 65.5%, rgb(var(--rgb-accent) / 0.3) 66% 66.8%, transparent 67.5%),
    linear-gradient(transparent calc(50% - 0.5px), rgb(var(--rgb-accent) / 0.22) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgb(var(--rgb-accent) / 0.22) 50%, transparent calc(50% + 0.5px));
  box-shadow: inset 0 0 48px rgb(var(--rgb-accent) / 0.16), var(--shadow-md);
}

.sweep__beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: conic-gradient(transparent 76%, rgb(var(--rgb-accent-light) / 0.5));
}

.sweep__blip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-ui-xs);
  font-weight: var(--fw-bold);
  color: var(--c-mint);
}

.sweep__blip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background-color: var(--c-mint);
  box-shadow: 0 0 10px var(--c-accent-light);
}

.sweep__blip:nth-of-type(2) { top: 29%; left: 62%; }
.sweep__blip:nth-of-type(3) { top: 74%; left: 62%; }
.sweep__blip:nth-of-type(4) { top: 62%; left: 14%; }
.sweep__blip:nth-of-type(5) { top: 21%; left: 15%; }

/* --------------------------------------------------------------------------
   Avant / avec — la même liste, deux métiers
   -------------------------------------------------------------------------- */
.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.compare__before {
  background: none;
  box-shadow: none;
}

.compare__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--fs-h3);
  font-weight: var(--fw-heavy);
  letter-spacing: -0.02em;
}

.compare__before .compare__title {
  color: var(--c-text-muted);
}

.compare__list li {
  display: flex;
  gap: var(--space-3);
  padding-block: var(--space-4);
  border-top: 1px solid var(--c-line);
  line-height: var(--lh-small);
}

.compare__list li::before {
  content: '';
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 0.15em;
  background-color: var(--c-text-faint);
  -webkit-mask: var(--ico-cross) center / contain no-repeat;
  mask: var(--ico-cross) center / contain no-repeat;
}

.compare__before li {
  color: var(--c-text-faint);
}

.compare__after li::before {
  background-color: var(--c-accent-light);
  -webkit-mask-image: var(--ico-check);
  mask-image: var(--ico-check);
}

/* --------------------------------------------------------------------------
   Montées en taille
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }

  .bento__tile--wide {
    display: grid;
    grid-column: span 2;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
    gap: var(--space-7);
  }

  .bento__tile--wide .bento__visual {
    margin-top: 0;
  }

  /* Deux lignes de trois plutôt qu'une puce orpheline. */
  .bento__extras .chips {
    display: grid;
    grid-template-columns: repeat(3, auto);
  }

  .bento__extras .chip {
    justify-content: center;
  }

  .compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

@media (min-width: 1080px) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Mouvement — l'anneau se remplit une fois ; le radar, lui, tourne en
   continu : c'est la veille, elle ne s'arrête pas (sauf hors écran).
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .ring {
    animation: ring-fill 1.6s var(--ease-out) 0.3s both;
  }

  .sweep__beam {
    animation: spin 6s linear infinite;
  }

  .sweep__blip {
    opacity: 0.35;
    animation: echo 6s linear infinite;
  }

  .sweep__blip:nth-of-type(2) { animation-delay: 0.63s; }
  .sweep__blip:nth-of-type(3) { animation-delay: 2.55s; }
  .sweep__blip:nth-of-type(4) { animation-delay: 4.1s; }
  .sweep__blip:nth-of-type(5) { animation-delay: 5.1s; }
}

@keyframes ring-fill {
  from { --ring: 0; }
}

@keyframes echo {
  0% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}
