/* HeroRadioGroup — the RadioGroup part of the Hero With Slot.
 * Layout tokens from Figma node 7680:1795 (desktop/tablet) & 7680:5394 (mobile):
 *   - vertical stack, 24px gap between heading / radios / CTA
 *   - title: 20/24, letter-spacing 0.5px (weight via the Title weight prop)
 *   - subtitle: body-md 16/24, regular
 *   - text color Neutral/Darkest #292929
 *   - radio list: 4px gap between options
 *   - group width 423px on desktop/tablet; full width on mobile
 * Radio visuals themselves come from @creditas-ui/radio (DS theme). */

:host {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: block;
}

.hero-radio-group {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 423px;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  color: #292929;
}

.hero-radio-group *,
.hero-radio-group *::before,
.hero-radio-group *::after {
  box-sizing: border-box;
}

/* ----- heading ---------------------------------------------------- */

.hrg-heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hrg-title {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.5px;
  color: #292929;
}

.hrg-subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: #292929;
}

/* ----- radios ----------------------------------------------------- */
/* Own container (not the DS RadioGroup wrapper) so the 4px option gap from the
 * design is exact; each option is a real @creditas-ui/radio. */

.hrg-radios {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

/* ----- CTA -------------------------------------------------------- */
/* The CTA is the shared <CardCtaButton>; this wrapper just positions it after
 * the group. `.card-cta-slot` (CardCtaButton's own wrapper) handles width. */

.hrg-cta {
  display: flex;
  width: 100%;
}

/* ----- interaction animations ------------------------------------ */
/* Subtle, and only for users who haven't asked to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Block fades + rises slightly on mount. */
  .hero-radio-group {
    animation: hrg-in 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* Heading rises in just after the block. */
  .hrg-heading {
    animation: hrg-in 400ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
  }

  /* Radios only FADE in on mount (opacity, not transform) so the hover/press
   * transform below stays free — a finished transform animation would otherwise
   * override :hover. Staggered for a light cascade. */
  .hrg-radios > * {
    animation: hrg-fade 320ms ease both;
    transition: transform 150ms ease;
  }
  .hrg-radios > *:nth-child(1) { animation-delay: 100ms; }
  .hrg-radios > *:nth-child(2) { animation-delay: 150ms; }
  .hrg-radios > *:nth-child(3) { animation-delay: 200ms; }
  .hrg-radios > *:nth-child(4) { animation-delay: 250ms; }
  .hrg-radios > *:nth-child(5) { animation-delay: 300ms; }
  .hrg-radios > *:nth-child(6) { animation-delay: 350ms; }

  /* Gentle nudge on hover / press for each radio row. */
  .hrg-radios > *:hover {
    transform: translateX(2px);
  }
  .hrg-radios > *:active {
    transform: translateX(1px) scale(0.99);
  }

  /* CTA slides in when it appears after a selection. */
  .hrg-cta {
    animation: hrg-cta-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes hrg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hrg-cta-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hrg-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

