// landing-i18n.jsx — translations (es/en/de/nl/fr), language context, rich-text, language dropdown.
// NOTE: "Pote" (brand), "pote/potes" (product noun) and "Poti" (guide) are NEVER translated.

const STR = {
  es: {
    code: 'es-ES',
    nav: { how: 'Cómo funciona', plus: 'Pote+', security: 'Seguridad' },
    cta: 'Apuntarme a la lista',
    hero: {
      h1: 'Ahorra para tus planes,\n*pote a pote.*',
      sub: 'Crea objetivos, marca tu capacidad mensual y deja que Poti calcule el ritmo para llenarlos.',
      proof: '+2.400 personas ya esperan a Pote',
      chipDue: 'Vence 1 oct', chipNext: 'Próximo aporte', chipGoal: 'Japón', chipPoti: 'Vas a ritmo', chipRate: '$130 / mes',
    },
    tension: {
      title: 'Cuando tus planes tienen ritmo, ahorrar se siente *distinto.*',
      before: 'Antes', after: 'Con Pote',
      beforeList: ['Ideas de ahorro sueltas en notas y cabeza.', 'Fechas aproximadas, sin un plan claro.', 'Aportes difíciles de seguir.'],
      afterList: ['Objetivos vivos, cada uno con su pote.', 'Próximos pasos claros que marca Poti.', 'Progreso que se ve llenarse.'],
    },
    how: {
      eyebrow: 'Cómo funciona', title: 'Tres pasos. Sin líos.',
      steps: [
        { t: 'Crea tu pote', d: 'Dale nombre, meta y fecha a cada plan que quieres cumplir.' },
        { t: 'Elige tu ritmo', d: 'Marca cuánto puedes ahorrar al mes y Poti calcula el reparto.' },
        { t: 'Registra cada avance', d: 'Anota tus aportes y mira cómo se llena cada objetivo.' },
      ],
    },
    features: {
      a: { eyebrow: 'Un pote por objetivo', title: 'Cada plan tiene su *pote.*', body: 'Viajes, regalos, festivales o emergencias. Crea un espacio para cada objetivo y mira cuánto falta para llenarlo.' },
      b: { eyebrow: 'Poti, tu guía', title: 'Poti te marca el *ritmo.*', body: 'Con tu capacidad mensual, reparte el esfuerzo entre tus potes y te propone el próximo aporte.' },
      c: { eyebrow: 'Progreso visible', title: 'El progreso se *ve.*', body: 'Orbes que se llenan, metas y pequeñas celebraciones para que cada avance tenga su momento.' },
      d: { eyebrow: 'Mejor en compañía', title: 'Planes *compartidos.*', body: 'Crea potes con tu pareja o tus amigos y seguid el progreso desde el mismo lugar.' },
    },
    plus: {
      title: 'Más potes,\nmás *calma.*',
      body: 'Pote+ amplía la experiencia con reparto avanzado, sprints, avisos, widgets y recaps. Free funciona de sobra; Pote+ te da margen.',
      feats: [
        { t: 'Reparto con Poti', d: 'Distribución avanzada de tu capacidad.' },
        { t: 'Sprints', d: 'Recupera el ritmo cuando te desvías.' },
        { t: 'Avisos', d: 'Te avisa antes de que un pote se atrase.' },
        { t: 'Widgets', d: 'Tu próximo paso, en la pantalla de inicio.' },
        { t: 'Recaps', d: 'Resúmenes para celebrar tus avances.' },
      ],
    },
    trust: {
      eyebrow: 'Tu ahorro, a tu manera', title: 'Tú llevas el ritmo.',
      lead: 'Pote se centra en el plan: objetivos, ritmo y aportes que registras tú. Tú decides dónde guardar cada avance.',
      points: [
        { t: 'A tu ritmo', d: 'Cambia tu capacidad mensual cuando quieras. Poti recalcula al momento.' },
        { t: 'Tú registras', d: 'Cada aporte lo anotas tú. Sin automatismos ni sorpresas.' },
        { t: 'Todo a la vista', d: 'Objetivos, fechas y progreso, siempre claros y delante.' },
      ],
    },
    final: { title: 'Tu primer pote\nempieza en la *lista.*', sub: 'Únete y te avisamos cuando Pote abra acceso para iOS.' },
    footer: {
      tagline: 'Ahorra para tus planes, pote a pote. Llega pronto a iOS.',
      cols: [
        { h: 'Producto', items: ['Cómo funciona', 'Pote+', 'Potes compartidos'] },
        { h: 'Recursos', items: ['Seguridad', 'Soporte', 'Novedades'] },
        { h: 'Legal', items: ['Privacidad', 'Términos'] },
      ],
      made: 'Hecho con calma · 16+',
    },
    form: {
      placeholder: 'tu@email.com', cta: 'Apuntarme a la lista de espera', loading: 'Apuntando…',
      successT: 'Listo, estás en la lista.', successD: 'Te avisaremos cuando Pote abra acceso.',
      error: 'Revisa el email e inténtalo otra vez.', helper: 'Te avisamos cuando abramos acceso. Solo te escribiremos sobre Pote.',
    },
    mock: { nuevo: 'Nuevo pote', mes: '/mes', reg: '+ Registrar aporte', gJapan: 'Japón', gFestival: 'Festival', gGift: 'Regalo', gEmergency: 'Emergencia', gSummer: 'Verano', gConcert: 'Concierto', due: 'Vence 1 oct', potiProposes: 'Poti propone', splitMsg: 'Reparto tu esfuerzo entre *4 potes* este mes.', of: 'de', onTrack: 'A ritmo', goingGreat: '¡Vas genial!', trip: 'Viaje a Lisboa', added: 'añadió', today: 'HOY', days: ['SÁB','DOM','LUN','MAR','MIÉ','JUE','VIE'], date: '25 may', day: 'Día', week: 'Sem', capacity: 'Capacidad de ahorro · mensual', adjust: 'Ajustar', priority: 'Prioridad', thisWeek: 'Esta semana', viewPlan: 'Ver plan', tabHome: 'Inicio', tabActivity: 'Actividad', tabProfile: 'Perfil' },
  },

  en: {
    code: 'en',
    nav: { how: 'How it works', plus: 'Pote+', security: 'Security' },
    cta: 'Join the waitlist',
    hero: {
      h1: 'Save for your plans,\n*pote by pote.*',
      sub: 'Set your goals, enter your monthly budget and let Poti work out the pace to fill them.',
      proof: '+2,400 people are already waiting for Pote',
      chipDue: 'Due Oct 1', chipNext: 'Next deposit', chipGoal: 'Japan', chipPoti: 'On track', chipRate: '$130 / mo',
    },
    tension: {
      title: 'When your plans have a rhythm, saving feels *different.*',
      before: 'Before', after: 'With Pote',
      beforeList: ['Savings ideas scattered across notes and your head.', 'Rough dates, no clear plan.', 'Deposits hard to keep track of.'],
      afterList: ['Living goals, each with its own pote.', 'Clear next steps set by Poti.', 'Progress you can watch fill up.'],
    },
    how: {
      eyebrow: 'How it works', title: 'Three steps. No fuss.',
      steps: [
        { t: 'Create your pote', d: 'Give a name, target and date to each plan you want to reach.' },
        { t: 'Pick your pace', d: 'Set how much you can save each month and Poti splits it up.' },
        { t: 'Log every step', d: 'Record your deposits and watch each goal fill up.' },
      ],
    },
    features: {
      a: { eyebrow: 'One pote per goal', title: 'Every plan has its *pote.*', body: 'Trips, gifts, festivals or emergencies. Make a space for each goal and see how much is left to fill it.' },
      b: { eyebrow: 'Poti, your guide', title: 'Poti sets your *pace.*', body: 'With your monthly budget, it splits the effort across your potes and suggests your next deposit.' },
      c: { eyebrow: 'Visible progress', title: 'Progress you can *see.*', body: 'Orbs that fill up, milestones and small celebrations so every step gets its moment.' },
      d: { eyebrow: 'Better together', title: 'Shared *plans.*', body: 'Create potes with your partner or friends and follow the progress from the same place.' },
    },
    plus: {
      title: 'More potes,\nmore *calm.*',
      body: 'Pote+ extends the experience with advanced splitting, sprints, alerts, widgets and recaps. Free works great; Pote+ gives you room.',
      feats: [
        { t: 'Splitting with Poti', d: 'Advanced distribution of your budget.' },
        { t: 'Sprints', d: 'Get back on pace when you drift.' },
        { t: 'Alerts', d: 'Heads-up before a pote falls behind.' },
        { t: 'Widgets', d: 'Your next step, right on your home screen.' },
        { t: 'Recaps', d: 'Summaries to celebrate your progress.' },
      ],
    },
    trust: {
      eyebrow: 'Your savings, your way', title: 'You set the pace.',
      lead: 'Pote focuses on the plan: goals, pace and deposits you log yourself. You decide where to keep each step.',
      points: [
        { t: 'At your pace', d: 'Change your monthly budget whenever you like. Poti recalculates instantly.' },
        { t: 'You log it', d: 'You record every deposit. No automation, no surprises.' },
        { t: 'All in view', d: 'Goals, dates and progress, always clear and up front.' },
      ],
    },
    final: { title: 'Your first pote\nstarts on the *list.*', sub: 'Join and we\u2019ll let you know when Pote opens access for iOS.' },
    footer: {
      tagline: 'Save for your plans, pote by pote. Coming soon to iOS.',
      cols: [
        { h: 'Product', items: ['How it works', 'Pote+', 'Shared potes'] },
        { h: 'Resources', items: ['Security', 'Support', 'What\u2019s new'] },
        { h: 'Legal', items: ['Privacy', 'Terms'] },
      ],
      made: 'Made calmly · 16+',
    },
    form: {
      placeholder: 'you@email.com', cta: 'Join the waitlist', loading: 'Joining…',
      successT: 'Done, you\u2019re on the list.', successD: 'We\u2019ll let you know when Pote opens up.',
      error: 'Check your email and try again.', helper: 'We\u2019ll email you when we open access. Only about Pote.',
    },
    mock: { nuevo: 'New pote', mes: '/mo', reg: '+ Add deposit', gJapan: 'Japan', gFestival: 'Festival', gGift: 'Gift', gEmergency: 'Emergency', gSummer: 'Summer', gConcert: 'Concert', due: 'Due Oct 1', potiProposes: 'Poti suggests', splitMsg: 'I’m splitting your effort across *4 potes* this month.', of: 'of', onTrack: 'On track', goingGreat: 'You’re doing great!', trip: 'Trip to Lisbon', added: 'added', today: 'TODAY', days: ['SAT','SUN','MON','TUE','WED','THU','FRI'], date: 'May 25', day: 'Day', week: 'Wk', capacity: 'Savings capacity · monthly', adjust: 'Adjust', priority: 'Priority', thisWeek: 'This week', viewPlan: 'View plan', tabHome: 'Home', tabActivity: 'Activity', tabProfile: 'Profile' },
  },

  de: {
    code: 'de',
    nav: { how: 'So funktioniert\u2019s', plus: 'Pote+', security: 'Sicherheit' },
    cta: 'Auf die Warteliste',
    hero: {
      h1: 'Spare für deine Pläne,\n*Pote für Pote.*',
      sub: 'Erstelle Ziele, leg dein Monatsbudget fest und lass Poti das Tempo zum Füllen berechnen.',
      proof: '+2.400 Menschen warten schon auf Pote',
      chipDue: 'Fällig 1. Okt', chipNext: 'Nächste Einzahlung', chipGoal: 'Japan', chipPoti: 'Im Plan', chipRate: '130 $ / Mon.',
    },
    tension: {
      title: 'Wenn deine Pläne einen Rhythmus haben, fühlt sich Sparen *anders* an.',
      before: 'Vorher', after: 'Mit Pote',
      beforeList: ['Sparideen verstreut in Notizen und im Kopf.', 'Ungefähre Termine, kein klarer Plan.', 'Einzahlungen schwer zu verfolgen.'],
      afterList: ['Lebendige Ziele, jedes mit eigenem Pote.', 'Klare nächste Schritte von Poti.', 'Fortschritt, den du wachsen siehst.'],
    },
    how: {
      eyebrow: 'So funktioniert\u2019s', title: 'Drei Schritte. Ganz einfach.',
      steps: [
        { t: 'Pote erstellen', d: 'Gib jedem Plan einen Namen, ein Ziel und ein Datum.' },
        { t: 'Tempo wählen', d: 'Leg fest, wie viel du monatlich sparst, und Poti teilt es auf.' },
        { t: 'Jeden Schritt festhalten', d: 'Erfasse deine Einzahlungen und sieh jedes Ziel wachsen.' },
      ],
    },
    features: {
      a: { eyebrow: 'Ein Pote pro Ziel', title: 'Jeder Plan hat seinen *Pote.*', body: 'Reisen, Geschenke, Festivals oder Notfälle. Schaff für jedes Ziel einen Platz und sieh, wie viel noch fehlt.' },
      b: { eyebrow: 'Poti, dein Guide', title: 'Poti gibt dir den *Rhythmus.*', body: 'Mit deinem Monatsbudget verteilt es den Aufwand auf deine Potes und schlägt die nächste Einzahlung vor.' },
      c: { eyebrow: 'Sichtbarer Fortschritt', title: 'Fortschritt, den man *sieht.*', body: 'Orbs, die sich füllen, Meilensteine und kleine Feiern, damit jeder Schritt seinen Moment hat.' },
      d: { eyebrow: 'Zusammen besser', title: 'Geteilte *Pläne.*', body: 'Erstelle Potes mit Partner oder Freunden und verfolgt den Fortschritt am selben Ort.' },
    },
    plus: {
      title: 'Mehr Potes,\nmehr *Ruhe.*',
      body: 'Pote+ erweitert die App mit smarter Verteilung, Sprints, Hinweisen, Widgets und Recaps. Free reicht völlig; Pote+ gibt dir Spielraum.',
      feats: [
        { t: 'Verteilung mit Poti', d: 'Smarte Aufteilung deines Budgets.' },
        { t: 'Sprints', d: 'Komm wieder in den Rhythmus.' },
        { t: 'Hinweise', d: 'Warnung, bevor ein Pote zurückfällt.' },
        { t: 'Widgets', d: 'Dein nächster Schritt auf dem Homescreen.' },
        { t: 'Recaps', d: 'Zusammenfassungen, um Fortschritte zu feiern.' },
      ],
    },
    trust: {
      eyebrow: 'Dein Sparen, dein Weg', title: 'Du bestimmst das Tempo.',
      lead: 'Pote konzentriert sich auf den Plan: Ziele, Tempo und Einzahlungen, die du selbst erfasst. Du entscheidest, wo du jeden Schritt aufbewahrst.',
      points: [
        { t: 'In deinem Tempo', d: 'Ändere dein Monatsbudget jederzeit. Poti rechnet sofort neu.' },
        { t: 'Du erfasst', d: 'Jede Einzahlung trägst du ein. Keine Automatik, keine Überraschungen.' },
        { t: 'Alles im Blick', d: 'Ziele, Termine und Fortschritt, immer klar und präsent.' },
      ],
    },
    final: { title: 'Dein erster Pote\nbeginnt auf der *Liste.*', sub: 'Mach mit und wir sagen dir Bescheid, sobald Pote für iOS öffnet.' },
    footer: {
      tagline: 'Spare für deine Pläne, Pote für Pote. Bald für iOS.',
      cols: [
        { h: 'Produkt', items: ['So funktioniert\u2019s', 'Pote+', 'Geteilte Potes'] },
        { h: 'Ressourcen', items: ['Sicherheit', 'Support', 'Neuigkeiten'] },
        { h: 'Rechtliches', items: ['Datenschutz', 'AGB'] },
      ],
      made: 'Mit Ruhe gemacht · 16+',
    },
    form: {
      placeholder: 'du@email.com', cta: 'Auf die Warteliste', loading: 'Wird gesendet…',
      successT: 'Fertig, du bist auf der Liste.', successD: 'Wir melden uns, sobald Pote öffnet.',
      error: 'Prüfe deine E-Mail und versuch es erneut.', helper: 'Wir schreiben dir, wenn wir öffnen. Nur über Pote.',
    },
    mock: { nuevo: 'Neuer Pote', mes: '/Mon.', reg: '+ Einzahlung', gJapan: 'Japan', gFestival: 'Festival', gGift: 'Geschenk', gEmergency: 'Notfall', gSummer: 'Sommer', gConcert: 'Konzert', due: 'Fällig 1. Okt', potiProposes: 'Poti schlägt vor', splitMsg: 'Ich verteile deinen Aufwand auf *4 Potes* diesen Monat.', of: 'von', onTrack: 'Im Plan', goingGreat: 'Läuft super!', trip: 'Reise nach Lissabon', added: 'ergänzte', today: 'HEUTE', days: ['SA','SO','MO','DI','MI','DO','FR'], date: '25. Mai', day: 'Tag', week: 'Wo', capacity: 'Sparkapazität · monatlich', adjust: 'Anpassen', priority: 'Priorität', thisWeek: 'Diese Woche', viewPlan: 'Plan ansehen', tabHome: 'Start', tabActivity: 'Aktivität', tabProfile: 'Profil' },
  },

  nl: {
    code: 'nl',
    nav: { how: 'Hoe het werkt', plus: 'Pote+', security: 'Beveiliging' },
    cta: 'Op de wachtlijst',
    hero: {
      h1: 'Spaar voor je plannen,\n*pote voor pote.*',
      sub: 'Maak doelen, stel je maandbudget in en laat Poti het tempo berekenen om ze te vullen.',
      proof: '+2.400 mensen wachten al op Pote',
      chipDue: 'Vervalt 1 okt', chipNext: 'Volgende inleg', chipGoal: 'Japan', chipPoti: 'Op schema', chipRate: '$130 / mnd',
    },
    tension: {
      title: 'Als je plannen een ritme hebben, voelt sparen *anders.*',
      before: 'Eerder', after: 'Met Pote',
      beforeList: ['Spaarideeën verspreid over notities en je hoofd.', 'Vage datums, geen duidelijk plan.', 'Inleg moeilijk bij te houden.'],
      afterList: ['Levende doelen, elk met eigen pote.', 'Duidelijke volgende stappen van Poti.', 'Voortgang die je ziet vollopen.'],
    },
    how: {
      eyebrow: 'Hoe het werkt', title: 'Drie stappen. Geen gedoe.',
      steps: [
        { t: 'Maak je pote', d: 'Geef elk plan een naam, doel en datum.' },
        { t: 'Kies je tempo', d: 'Stel in hoeveel je per maand spaart en Poti verdeelt het.' },
        { t: 'Leg elke stap vast', d: 'Noteer je inleg en zie elk doel vollopen.' },
      ],
    },
    features: {
      a: { eyebrow: 'Eén pote per doel', title: 'Elk plan heeft zijn *pote.*', body: 'Reizen, cadeaus, festivals of noodgevallen. Maak ruimte voor elk doel en zie hoeveel er nog mist.' },
      b: { eyebrow: 'Poti, je gids', title: 'Poti bepaalt je *tempo.*', body: 'Met je maandbudget verdeelt het de inspanning over je potes en stelt je volgende inleg voor.' },
      c: { eyebrow: 'Zichtbare voortgang', title: 'Voortgang die je *ziet.*', body: 'Orbs die vollopen, mijlpalen en kleine vieringen zodat elke stap zijn moment krijgt.' },
      d: { eyebrow: 'Samen beter', title: 'Gedeelde *plannen.*', body: 'Maak potes met je partner of vrienden en volg de voortgang op dezelfde plek.' },
    },
    plus: {
      title: 'Meer potes,\nmeer *rust.*',
      body: 'Pote+ breidt de app uit met slim verdelen, sprints, meldingen, widgets en recaps. Free werkt prima; Pote+ geeft je ruimte.',
      feats: [
        { t: 'Verdelen met Poti', d: 'Slimme verdeling van je budget.' },
        { t: 'Sprints', d: 'Kom terug op tempo als je afwijkt.' },
        { t: 'Meldingen', d: 'Seintje voordat een pote achterloopt.' },
        { t: 'Widgets', d: 'Je volgende stap op je beginscherm.' },
        { t: 'Recaps', d: 'Overzichten om je voortgang te vieren.' },
      ],
    },
    trust: {
      eyebrow: 'Jouw sparen, jouw manier', title: 'Jij bepaalt het tempo.',
      lead: 'Pote draait om het plan: doelen, tempo en inleg die je zelf noteert. Jij bepaalt waar je elke stap bewaart.',
      points: [
        { t: 'In jouw tempo', d: 'Pas je maandbudget aan wanneer je wilt. Poti rekent direct opnieuw.' },
        { t: 'Jij noteert', d: 'Elke inleg voer je zelf in. Geen automatisme, geen verrassingen.' },
        { t: 'Alles in beeld', d: 'Doelen, datums en voortgang, altijd helder en vooraan.' },
      ],
    },
    final: { title: 'Je eerste pote\nbegint op de *lijst.*', sub: 'Doe mee en we laten het weten zodra Pote opent voor iOS.' },
    footer: {
      tagline: 'Spaar voor je plannen, pote voor pote. Binnenkort op iOS.',
      cols: [
        { h: 'Product', items: ['Hoe het werkt', 'Pote+', 'Gedeelde potes'] },
        { h: 'Bronnen', items: ['Beveiliging', 'Support', 'Nieuws'] },
        { h: 'Juridisch', items: ['Privacy', 'Voorwaarden'] },
      ],
      made: 'Met rust gemaakt · 16+',
    },
    form: {
      placeholder: 'jij@email.com', cta: 'Op de wachtlijst', loading: 'Bezig…',
      successT: 'Klaar, je staat op de lijst.', successD: 'We laten het weten zodra Pote opent.',
      error: 'Controleer je e-mail en probeer opnieuw.', helper: 'We mailen je zodra we openen. Alleen over Pote.',
    },
    mock: { nuevo: 'Nieuwe pote', mes: '/mnd', reg: '+ Inleg toevoegen', gJapan: 'Japan', gFestival: 'Festival', gGift: 'Cadeau', gEmergency: 'Noodgeval', gSummer: 'Zomer', gConcert: 'Concert', due: 'Vervalt 1 okt', potiProposes: 'Poti stelt voor', splitMsg: 'Ik verdeel je inspanning over *4 potes* deze maand.', of: 'van', onTrack: 'Op schema', goingGreat: 'Je doet het top!', trip: 'Reis naar Lissabon', added: 'stortte', today: 'VANDAAG', days: ['ZA','ZO','MA','DI','WO','DO','VR'], date: '25 mei', day: 'Dag', week: 'Wk', capacity: 'Spaarcapaciteit · maandelijks', adjust: 'Aanpassen', priority: 'Prioriteit', thisWeek: 'Deze week', viewPlan: 'Plan bekijken', tabHome: 'Start', tabActivity: 'Activiteit', tabProfile: 'Profiel' },
  },

  fr: {
    code: 'fr',
    nav: { how: 'Comment ça marche', plus: 'Pote+', security: 'Sécurité' },
    cta: 'Rejoindre la liste',
    hero: {
      h1: 'Épargne pour tes projets,\n*pote après pote.*',
      sub: 'Crée des objectifs, indique ta capacité mensuelle et laisse Poti calculer le rythme pour les remplir.',
      proof: '+2 400 personnes attendent déjà Pote',
      chipDue: 'Échéance 1 oct', chipNext: 'Prochain versement', chipGoal: 'Japon', chipPoti: 'Dans les temps', chipRate: '130 $ / mois',
    },
    tension: {
      title: 'Quand tes projets ont un rythme, épargner devient *différent.*',
      before: 'Avant', after: 'Avec Pote',
      beforeList: ['Des idées d\u2019épargne éparpillées dans tes notes et ta tête.', 'Des dates approximatives, sans plan clair.', 'Des versements difficiles à suivre.'],
      afterList: ['Des objectifs vivants, chacun avec son pote.', 'Des prochaines étapes claires fixées par Poti.', 'Une progression qu\u2019on voit se remplir.'],
    },
    how: {
      eyebrow: 'Comment ça marche', title: 'Trois étapes. Sans prise de tête.',
      steps: [
        { t: 'Crée ton pote', d: 'Donne un nom, un objectif et une date à chaque projet.' },
        { t: 'Choisis ton rythme', d: 'Indique combien tu peux épargner par mois et Poti répartit.' },
        { t: 'Note chaque avancée', d: 'Enregistre tes versements et regarde chaque objectif se remplir.' },
      ],
    },
    features: {
      a: { eyebrow: 'Un pote par objectif', title: 'Chaque projet a son *pote.*', body: 'Voyages, cadeaux, festivals ou imprévus. Crée un espace pour chaque objectif et vois ce qu\u2019il reste à remplir.' },
      b: { eyebrow: 'Poti, ton guide', title: 'Poti donne le *rythme.*', body: 'Avec ta capacité mensuelle, il répartit l\u2019effort entre tes potes et propose ton prochain versement.' },
      c: { eyebrow: 'Progression visible', title: 'La progression se *voit.*', body: 'Des orbes qui se remplissent, des jalons et de petites célébrations pour que chaque avancée ait son moment.' },
      d: { eyebrow: 'Mieux à plusieurs', title: 'Projets *partagés.*', body: 'Crée des potes avec tes proches ou tes amis et suivez la progression au même endroit.' },
    },
    plus: {
      title: 'Plus de potes,\nplus de *calme.*',
      body: 'Pote+ enrichit l\u2019app avec répartition avancée, sprints, alertes, widgets et récaps. Free suffit largement ; Pote+ te donne de la marge.',
      feats: [
        { t: 'Répartition avec Poti', d: 'Distribution avancée de ta capacité.' },
        { t: 'Sprints', d: 'Reprends le rythme quand tu dévies.' },
        { t: 'Alertes', d: 'Un signal avant qu\u2019un pote prenne du retard.' },
        { t: 'Widgets', d: 'Ta prochaine étape sur ton écran d\u2019accueil.' },
        { t: 'Récaps', d: 'Des résumés pour célébrer tes avancées.' },
      ],
    },
    trust: {
      eyebrow: 'Ton épargne, à ta façon', title: 'C\u2019est toi qui mènes le rythme.',
      lead: 'Pote se concentre sur le plan : objectifs, rythme et versements que tu notes toi-même. Tu décides où garder chaque avancée.',
      points: [
        { t: 'À ton rythme', d: 'Change ta capacité mensuelle quand tu veux. Poti recalcule aussitôt.' },
        { t: 'Tu enregistres', d: 'Chaque versement, c\u2019est toi qui le notes. Sans automatisme ni surprise.' },
        { t: 'Tout en vue', d: 'Objectifs, dates et progression, toujours clairs et devant toi.' },
      ],
    },
    final: { title: 'Ton premier pote\ncommence sur la *liste.*', sub: 'Rejoins-nous et on te prévient dès que Pote ouvre l\u2019accès iOS.' },
    footer: {
      tagline: 'Épargne pour tes projets, pote après pote. Bientôt sur iOS.',
      cols: [
        { h: 'Produit', items: ['Comment ça marche', 'Pote+', 'Potes partagés'] },
        { h: 'Ressources', items: ['Sécurité', 'Support', 'Nouveautés'] },
        { h: 'Légal', items: ['Confidentialité', 'Conditions'] },
      ],
      made: 'Fait avec calme · 16+',
    },
    form: {
      placeholder: 'toi@email.com', cta: 'Rejoindre la liste d\u2019attente', loading: 'Envoi…',
      successT: 'C\u2019est fait, tu es sur la liste.', successD: 'On te prévient dès que Pote ouvre.',
      error: 'Vérifie ton e-mail et réessaie.', helper: 'On t\u2019écrit quand on ouvre l\u2019accès. Uniquement sur Pote.',
    },
    mock: { nuevo: 'Nouveau pote', mes: '/mois', reg: '+ Ajouter un versement', gJapan: 'Japon', gFestival: 'Festival', gGift: 'Cadeau', gEmergency: 'Imprévu', gSummer: 'Été', gConcert: 'Concert', due: 'Échéance 1 oct', potiProposes: 'Poti propose', splitMsg: 'Je répartis ton effort entre *4 potes* ce mois-ci.', of: 'sur', onTrack: 'Dans les temps', goingGreat: 'Tu assures !', trip: 'Voyage à Lisbonne', added: 'a ajouté', today: 'AUJOURD’HUI', days: ['SAM','DIM','LUN','MAR','MER','JEU','VEN'], date: '25 mai', day: 'Jour', week: 'Sem', capacity: 'Capacité d’épargne · mensuelle', adjust: 'Ajuster', priority: 'Priorité', thisWeek: 'Cette semaine', viewPlan: 'Voir le plan', tabHome: 'Accueil', tabActivity: 'Activité', tabProfile: 'Profil' },
  },
};

const LANGS = [
  { k: 'es', code: 'ES', name: 'Español' },
  { k: 'en', code: 'EN', name: 'English' },
  { k: 'de', code: 'DE', name: 'Deutsch' },
  { k: 'nl', code: 'NL', name: 'Nederlands' },
  { k: 'fr', code: 'FR', name: 'Français' },
];

const LangContext = React.createContext({ lang: 'es', t: STR.es, setLang: () => {} });
function useT() { return React.useContext(LangContext); }

// Rich text: "\n" → <br/>, *segments* → lime highlight.
function RT({ text }) {
  const lines = String(text).split('\n');
  return (
    <>
      {lines.map((line, li) => (
        <React.Fragment key={li}>
          {li > 0 && <br />}
          {line.split('*').map((seg, i) => (i % 2 === 1 ? <span key={i} className="hl">{seg}</span> : <React.Fragment key={i}>{seg}</React.Fragment>))}
        </React.Fragment>
      ))}
    </>
  );
}

function LangProvider({ children }) {
  const [lang, setLangState] = React.useState(() => {
    try {
      const q = new URLSearchParams(location.search).get('lang');
      if (q && STR[q]) return q;
      const s = localStorage.getItem('pote_lang');
      return (s && STR[s]) ? s : 'es';
    } catch (e) { return 'es'; }
  });
  const setLang = React.useCallback((l) => {
    if (!STR[l]) return;
    setLangState(l);
    try { localStorage.setItem('pote_lang', l); } catch (e) {}
  }, []);
  React.useEffect(() => {
    try { document.documentElement.setAttribute('lang', STR[lang].code); } catch (e) {}
  }, [lang]);
  const value = React.useMemo(() => ({ lang, t: STR[lang], setLang }), [lang, setLang]);
  return <LangContext.Provider value={value}>{children}</LangContext.Provider>;
}

// Compact globe dropdown — fits 5 languages cleanly.
function LangSwitch() {
  const { lang, setLang } = useT();
  const [open, setOpen] = React.useState(false);
  const ref = React.useRef(null);
  React.useEffect(() => {
    if (!open) return;
    const onDoc = (e) => { if (ref.current && !ref.current.contains(e.target)) setOpen(false); };
    const onKey = (e) => { if (e.key === 'Escape') setOpen(false); };
    document.addEventListener('mousedown', onDoc);
    document.addEventListener('keydown', onKey);
    return () => { document.removeEventListener('mousedown', onDoc); document.removeEventListener('keydown', onKey); };
  }, [open]);
  const cur = LANGS.find(l => l.k === lang) || LANGS[0];
  return (
    <div className="lang-dd" ref={ref}>
      <button type="button" className="lang-trigger" aria-haspopup="listbox" aria-expanded={open} aria-label="Idioma / Language" onClick={() => setOpen(o => !o)}>
        <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>
        <span className="lang-trigger-code">{cur.code}</span>
        <svg className={'lang-chev' + (open ? ' up' : '')} width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round"><path d="M6 9l6 6 6-6"/></svg>
      </button>
      {open && (
        <div className="lang-menu" role="listbox">
          {LANGS.map(l => (
            <button key={l.k} type="button" role="option" aria-selected={l.k === lang}
              className={'lang-mi' + (l.k === lang ? ' on' : '')}
              onClick={() => { setLang(l.k); setOpen(false); }}>
              <span className="lang-mi-code">{l.code}</span>
              <span className="lang-mi-name">{l.name}</span>
              {l.k === lang && (
                <svg className="lang-mi-check" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12l5 5 9-11"/></svg>
              )}
            </button>
          ))}
        </div>
      )}
    </div>
  );
}

Object.assign(window, { STR, LANGS, LangContext, useT, RT, LangProvider, LangSwitch });
