const { EmailShell, EmailHeader, Band, EmailHero, SectionHeading, EmailText, KeyFigures, FundSelector, StageInfographic, IconCards, EMAIL_ICONS, CheckList, Timeline, Survey, EmailFooter } = window.AFPHabitatDesignSystem_41b5e6;

const FUNDS = ['1996 – 2000', '1991 – 1995', '1986 – 1990', '1981 – 1985', '1976 – 1980', '1971 – 1975', '1966 – 1970', '1961 – 1965', '1956 – 1960', 'Antes de 1956'];

function FondoGeneracional({ stage = 3 }) {
  return (
    <EmailShell preheader="Desde el 1 de abril de 2027 tu ahorro obligatorio estará en tu Fondo Generacional. No necesitas hacer nada.">
      <EmailHeader />
      <Band padding="16px 40px 32px">
        <EmailHero icon={EMAIL_ICONS.crecimiento} title="Conoce cuál será tu fondo generacional." lead="Queremos contarte sobre cómo invertiremos tus ahorros a contar de abril de 2027." />
      </Band>
      <Band padding="0 40px 40px">
        <img src="https://cloudfilesdm.com/postcards/image_8-dc336b86.png" width="520" alt="Mujer sonriente con delantal frente a un estante de maceteros de greda" style={{ display: 'block', width: '100%', maxWidth: 520, height: 'auto', borderRadius: 16 }} />
      </Band>
      <Band padding="0 40px 24px">
        <SectionHeading title="Lo que tienes que saber" />
        <EmailText>La Reforma de Pensiones (Ley N°21.735) trae una nueva estrategia para invertir tus ahorros previsionales. Desde el 1 de abril 2027, los actuales Multifondos serán reemplazados por 10 fondos generacionales.</EmailText>
      </Band>
      <Band padding="0 40px 40px">
        <KeyFigures items={[{ label: 'Fondos generacionales', value: '10' }, { label: 'Entrada en vigencia', value: '2027', bold: false }]} />
      </Band>
      <Band padding="0 40px 32px">
        <SectionHeading title="¿Cuál será tu fondo generacional?" />
        <EmailText>Como te comentamos anteriormente, tu fondo se determinará según tu año de nacimiento.<sup style={{ fontSize: 11, lineHeight: 0 }}>1</sup> <strong>Desde el 1 de abril de 2027, tu ahorro obligatorio será invertido en:</strong></EmailText>
      </Band>
      <Band tone="gray" padding="24px 40px">
        <FundSelector title={FUNDS[stage - 1]} active={stage} note="Cambio automático · No necesitas hacer ningún trámite" />
      </Band>
      <Band padding="48px 40px 24px">
        <SectionHeading title="¿Qué significa para ti?" />
        <EmailText>Estás en una etapa donde todavía tienes un horizonte relevante para seguir haciendo crecer tus ahorros. Por eso, tu fondo mantendrá una mirada de largo plazo, <strong>pero comenzará gradualmente a incorporar una mayor orientación a la estabilidad.</strong></EmailText>
      </Band>
      <Band padding="0 40px 48px"><StageInfographic active={stage} /></Band>
      <Band tone="info" padding="40px 40px 24px">
        <SectionHeading eyebrow="Ahorro voluntario" level="h2" title="¿Qué pasará con tu Ahorro Voluntario?" />
        <EmailText margin="0 0 24px">Mantendrá sus condiciones y todos los beneficios tributarios que tiene hoy. Solo cambia la forma en que se invertirá.</EmailText>
        <IconCards items={[{ icon: EMAIL_ICONS.cobertura, title: <>APV<br /><br /></> }, { icon: EMAIL_ICONS.crecimiento, title: <>Cuenta 2<br /><br /></> }, { icon: EMAIL_ICONS.interesCompuesto, title: <>Depósito<br />Convenido</> }]} />
      </Band>
      <Band tone="info" padding="8px 40px 40px">
        <CheckList items={['Mantienen las mismas condiciones', 'Mantienen los mismos beneficios', { text: '10 Fondos generacionales para elegir', note: 'Tu ahorro voluntario tendrá más alternativas: podrás evaluar distintas estrategias según tu objetivo.' }]} />
      </Band>
      <Band tone="notice" padding="40px 40px 44px">
        <SectionHeading eyebrow="Recuerda" level="h2" titleColor="ink" title="Este cambio todavía no entra en vigencia." />
        <div style={{ height: 12 }} />
        <Timeline items={[{ date: 'HASTA EL 31 MAR 2027', text: <>Tus ahorros siguen en los <strong>Multifondos A, B, C, D y E</strong>.</> }, { date: 'DESDE EL 1 ABR 2027', text: <>Comienzan a operar los <strong>Fondos Generacionales</strong>.</>, active: true }]} />
      </Band>
      <Survey />
      <EmailFooter footnote={<><sup style={{ lineHeight: 0 }}>1</sup> Los rangos de años de nacimiento considerarán la edad de las personas al 31 de diciembre de 2026.</>} />
    </EmailShell>
  );
}

window.FondoGeneracional = FondoGeneracional;
