diff --git a/assets/css/tools.css b/assets/css/tools.css index cff16df..0baae97 100644 --- a/assets/css/tools.css +++ b/assets/css/tools.css @@ -242,14 +242,15 @@ body { position: relative; display: flex; flex-direction: column; - padding: 18px 20px; + gap: .55rem; + padding: 26px 28px; border: 1px solid var(--dbn-line); - border-radius: 8px; + border-radius: 10px; background: rgba(255, 255, 255, 0.82); color: var(--dbn-ink); text-decoration: none; overflow: hidden; - min-height: 200px; + min-height: 260px; cursor: pointer; } diff --git a/dashboard.php b/dashboard.php index babb056..a377626 100644 --- a/dashboard.php +++ b/dashboard.php @@ -227,9 +227,9 @@ $langSuffix = $uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : ''; /* card footer links always sit above the div onclick */ .dash-card-footer a, .dash-card-footer button { position: relative; z-index: 1; } - .dash-card-footer { padding-top: 0.65rem; margin-top: auto; border-top: 1px solid rgba(0,0,0,.07); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; } + .dash-card-footer { padding-top: 0.85rem; margin-top: auto; border-top: 1px solid rgba(0,0,0,.07); display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; } /* pill badges on acct bar */ - .dash-tier-badge { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid currentColor; flex-shrink: 0; } + .dash-tier-badge { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid currentColor; flex-shrink: 0; } @@ -258,68 +258,68 @@ window.DBN_TOOLS_LANG = ; ?> -
+
- - · + + · - : + : - - : + + :
- + - + - +
-
-
-

-

-

· ·

+
+
+

+

+

· ·

- -

-

+
+

+

0 ? round($used / 1048576, 1) : 0; $quotaMb = $quota > 0 ? round($quota / 1048576, 0) : 0; ?> -

MB / MB

+

MB / MB

- -

-

-

+
+

+

+

- -

+
+

-

+

- -

+
+

-

+

@@ -337,16 +337,16 @@ window.DBN_TOOLS_LANG = ; onclick="location.href=''" onkeydown="if(event.key==='Enter'||event.key===' ')location.href=''">
- - + + dbn.case_workbench_plan + style="font-size:.78rem; background:#f1f5f9; border:1px solid #e2e8f0; color:#64748b; padding:3px 9px; border-radius:4px; cursor:pointer; white-space:nowrap; flex-shrink:0;">dbn.case_workbench_plan
-

+

@@ -363,28 +363,28 @@ window.DBN_TOOLS_LANG = ; onclick="location.href=''" onkeydown="if(event.key==='Enter'||event.key===' ')location.href=''">
- - + + + style="font-size:.78rem; background:#f1f5f9; border:1px solid #e2e8f0; color:#64748b; padding:3px 9px; border-radius:4px; cursor:pointer; white-space:nowrap; flex-shrink:0;">
-

+

diff --git a/pricing.php b/pricing.php index 6094316..9a5bd3f 100644 --- a/pricing.php +++ b/pricing.php @@ -6,7 +6,6 @@ require_once __DIR__ . '/includes/FreeTier.php'; require_once __DIR__ . '/includes/PricingCatalog.php'; $uiLang = dbnToolsCurrentLanguage(); -$isNorwegian = $uiLang === 'no'; $isAuthed = dbnToolsIsAuthenticated(); $currentTier = $isAuthed ? dbnToolsCurrentTier() : 'free'; $surveyDone = false; @@ -34,79 +33,211 @@ function credits(int $amount): string return PricingCatalog::formatCredits($amount); } -$copy = $isNorwegian ? [ - 'title' => 'Priser - DBN Tools', - 'description' => 'NOK-priser, kreditter og abonnement for tools.dobetternorge.no.', - 'eyebrow' => 'NOK-priser for DBN Tools', - 'headline' => 'Kreditter som gir mening', - 'subhead' => 'Månedlige kreditter brukes først. Forhåndsbetalte kreditter legges på toppen og utløper ikke.', - 'trial' => 'Pluss har 14 dagers prøveperiode. Kort kreves, og du kan kansellere når som helst.', - 'survey_title' => 'Få 25 ekstra kreditter', - 'survey_text' => 'Svar på fem korte spørsmål om hvordan du bruker verktøyene.', - 'survey_cta' => 'Ta undersøkelsen', - 'current' => 'Din plan', - 'choose' => 'Velg', - 'login' => 'Logg inn for å velge', - 'available' => 'Tilgjengelig', - 'topups_title' => 'Ekstra kreditter', - 'topups_lead' => 'Top-ups er engangskjøp. De utløper ikke og brukes etter månedlige kreditter.', - 'buy' => 'Kjøp', - 'login_buy' => 'Logg inn for å kjøpe', - 'tool_costs' => 'Verktøykostnader', - 'tool_costs_lead' => 'Kreditter trekkes bare når verktøyet fullfører med et gyldig resultat.', - 'organisation' => 'Organisasjon', - 'organisation_price' => 'Kontakt', - 'organisation_text' => 'For rådgivere, frivillige miljøer og større familieteam som trenger flere brukere, særskilte avtaler eller onboarding.', - 'contact' => 'Snakk med oss', - 'billing_note' => 'Stripe brukes for kortbetaling, abonnement og kvitteringer. Lokale DBN-kreditter er fasiten for tilgang.', - 'status_success' => 'Betalingen er bekreftet. Kontoen oppdateres når Stripe-webhooken er behandlet.', - 'status_canceled' => 'Betalingen ble avbrutt. Ingen endringer er gjort.', - 'connecting' => 'Kobler til Stripe...', - 'checkout_error' => 'Kunne ikke starte betaling. Prøv igjen.', -] : [ - 'title' => 'Pricing - DBN Tools', - 'description' => 'NOK pricing, credits, and subscriptions for tools.dobetternorge.no.', - 'eyebrow' => 'NOK pricing for DBN Tools', - 'headline' => 'Credits that make sense', - 'subhead' => 'Monthly credits are spent first. Prepaid credits sit on top and never expire.', - 'trial' => 'Plus includes a 14-day trial. Card required, cancel anytime.', - 'survey_title' => 'Get 25 extra credits', - 'survey_text' => 'Answer five short questions about how you use the tools.', - 'survey_cta' => 'Take the survey', - 'current' => 'Current plan', - 'choose' => 'Choose', - 'login' => 'Log in to choose', - 'available' => 'Available', - 'topups_title' => 'Extra credits', - 'topups_lead' => 'Top-ups are one-time purchases. They never expire and are spent after monthly credits.', - 'buy' => 'Buy', - 'login_buy' => 'Log in to buy', - 'tool_costs' => 'Tool costs', - 'tool_costs_lead' => 'Credits are charged only when a tool completes with a valid result.', - 'organisation' => 'Organisation', - 'organisation_price' => 'Contact', - 'organisation_text' => 'For advisers, volunteer groups, and larger family teams that need more users, custom terms, or onboarding.', - 'contact' => 'Talk to us', - 'billing_note' => 'Stripe handles cards, subscriptions, and receipts. Local DBN credits remain authoritative for access.', - 'status_success' => 'Payment confirmed. Your account updates when the Stripe webhook is processed.', - 'status_canceled' => 'Payment was canceled. No changes were made.', - 'connecting' => 'Connecting to Stripe...', - 'checkout_error' => 'Could not start checkout. Please try again.', -]; +$copy = match ($uiLang) { + 'no' => [ + 'title' => 'Priser - DBN Tools', + 'description' => 'NOK-priser, kreditter og abonnement for tools.dobetternorge.no.', + 'eyebrow' => 'NOK-priser for DBN Tools', + 'headline' => 'Kreditter som gir mening', + 'subhead' => 'Månedlige kreditter brukes først. Forhåndsbetalte kreditter legges på toppen og utløper ikke.', + 'trial' => 'Pluss har 14 dagers prøveperiode. Kort kreves, og du kan kansellere når som helst.', + 'survey_title' => 'Få 25 ekstra kreditter', + 'survey_text' => 'Svar på fem korte spørsmål om hvordan du bruker verktøyene.', + 'survey_cta' => 'Ta undersøkelsen', + 'current' => 'Din plan', + 'choose' => 'Velg', + 'login' => 'Logg inn for å velge', + 'available' => 'Tilgjengelig', + 'topups_title' => 'Ekstra kreditter', + 'topups_lead' => 'Top-ups er engangskjøp. De utløper ikke og brukes etter månedlige kreditter.', + 'buy' => 'Kjøp', + 'login_buy' => 'Logg inn for å kjøpe', + 'tool_costs' => 'Verktøykostnader', + 'tool_costs_lead' => 'Kreditter trekkes bare når verktøyet fullfører med et gyldig resultat.', + 'organisation' => 'Organisasjon', + 'organisation_price' => 'Kontakt', + 'organisation_text' => 'For rådgivere, frivillige miljøer og større familieteam som trenger flere brukere, særskilte avtaler eller onboarding.', + 'contact' => 'Snakk med oss', + 'billing_note' => 'Stripe brukes for kortbetaling, abonnement og kvitteringer. Lokale DBN-kreditter er fasiten for tilgang.', + 'status_success' => 'Betalingen er bekreftet. Kontoen oppdateres når Stripe-webhooken er behandlet.', + 'status_canceled' => 'Betalingen ble avbrutt. Ingen endringer er gjort.', + 'connecting' => 'Kobler til Stripe...', + 'checkout_error' => 'Kunne ikke starte betaling. Prøv igjen.', + 'per_month' => '/ mnd', + 'starter_tier' => 'Startnivå', + 'credit_unit' => 'kreditt', + 'credits_unit' => 'kreditter', + 'custom_terms' => 'Tilpasset avtale', + 'more_users' => 'Flere brukere', + 'custom_credits' => 'Tilpassede kreditter', + 'onboarding_support' => 'Onboarding og støtte', + 'agreed_directly' => 'Avtales direkte', + 'paid_runs_per_hour' => 'betalte kjøringer per time', + 'table_cost' => 'Kostnad', + 'table_tools' => 'Verktøy', + 'variable' => 'variabel', + 'transcribe_cost' => 'transcribe: 1 kreditt per startet lydminutt, minst 5', + ], + 'uk' => [ + 'title' => 'Ціни - DBN Tools', + 'description' => 'Ціни в NOK, кредити та підписки для tools.dobetternorge.no.', + 'eyebrow' => 'Ціни в NOK для DBN Tools', + 'headline' => 'Кредити, які мають сенс', + 'subhead' => 'Щомісячні кредити витрачаються першими. Передоплачені кредити додаються зверху і не закінчуються.', + 'trial' => 'Plus включає 14-денний пробний період. Картка обов\'язкова, скасування в будь-який час.', + 'survey_title' => 'Отримайте 25 додаткових кредитів', + 'survey_text' => 'Дайте відповідь на п\'ять коротких запитань про те, як ви використовуєте інструменти.', + 'survey_cta' => 'Пройти опитування', + 'current' => 'Ваш план', + 'choose' => 'Вибрати', + 'login' => 'Увійти для вибору', + 'available' => 'Доступно', + 'topups_title' => 'Додаткові кредити', + 'topups_lead' => 'Поповнення — це одноразові покупки. Вони не закінчуються і витрачаються після щомісячних кредитів.', + 'buy' => 'Купити', + 'login_buy' => 'Увійти для покупки', + 'tool_costs' => 'Вартість інструментів', + 'tool_costs_lead' => 'Кредити знімаються лише тоді, коли інструмент завершує роботу з дійсним результатом.', + 'organisation' => 'Організація', + 'organisation_price' => 'Зв\'язатися', + 'organisation_text' => 'Для консультантів, волонтерських організацій та великих сімейних команд, яким потрібно більше користувачів, особливі умови або підтримка.', + 'contact' => 'Зв\'яжіться з нами', + 'billing_note' => 'Stripe обробляє картки, підписки та квитанції. Місцеві кредити DBN залишаються авторитетними для доступу.', + 'status_success' => 'Оплату підтверджено. Ваш обліковий запис оновиться після обробки вебхука Stripe.', + 'status_canceled' => 'Оплату скасовано. Жодних змін не внесено.', + 'connecting' => 'Підключення до Stripe...', + 'checkout_error' => 'Не вдалося розпочати оплату. Спробуйте ще раз.', + 'per_month' => '/ міс', + 'starter_tier' => 'Стартовий рівень', + 'credit_unit' => 'кредит', + 'credits_unit' => 'кредитів', + 'custom_terms' => 'Індивідуальні умови', + 'more_users' => 'Більше користувачів', + 'custom_credits' => 'Індивідуальні кредити', + 'onboarding_support' => 'Підтримка та онбординг', + 'agreed_directly' => 'Погоджується безпосередньо', + 'paid_runs_per_hour' => 'платних запусків на годину', + 'table_cost' => 'Вартість', + 'table_tools' => 'Інструменти', + 'variable' => 'змінна', + 'transcribe_cost' => 'transcribe: 1 кредит за розпочату хвилину аудіо, мінімум 5', + ], + 'pl' => [ + 'title' => 'Cennik - DBN Tools', + 'description' => 'Ceny w NOK, kredyty i subskrypcje dla tools.dobetternorge.no.', + 'eyebrow' => 'Ceny w NOK dla DBN Tools', + 'headline' => 'Kredyty, które mają sens', + 'subhead' => 'Miesięczne kredyty są wydawane jako pierwsze. Opłacone z góry kredyty są dodawane na wierzchu i nigdy nie wygasają.', + 'trial' => 'Plus zawiera 14-dniowy okres próbny. Wymagana karta, anulowanie w dowolnym momencie.', + 'survey_title' => 'Zdobądź 25 dodatkowych kredytów', + 'survey_text' => 'Odpowiedz na pięć krótkich pytań dotyczących korzystania z narzędzi.', + 'survey_cta' => 'Wypełnij ankietę', + 'current' => 'Twój plan', + 'choose' => 'Wybierz', + 'login' => 'Zaloguj się, aby wybrać', + 'available' => 'Dostępny', + 'topups_title' => 'Dodatkowe kredyty', + 'topups_lead' => 'Doładowania to jednorazowe zakupy. Nigdy nie wygasają i są wydawane po miesięcznych kredytach.', + 'buy' => 'Kup', + 'login_buy' => 'Zaloguj się, aby kupić', + 'tool_costs' => 'Koszty narzędzi', + 'tool_costs_lead' => 'Kredyty są pobierane tylko wtedy, gdy narzędzie kończy pracę z prawidłowym wynikiem.', + 'organisation' => 'Organizacja', + 'organisation_price' => 'Kontakt', + 'organisation_text' => 'Dla doradców, organizacji wolontariackich i większych zespołów rodzinnych potrzebujących więcej użytkowników, niestandardowych warunków lub wsparcia.', + 'contact' => 'Skontaktuj się z nami', + 'billing_note' => 'Stripe obsługuje karty, subskrypcje i paragony. Lokalne kredyty DBN pozostają miarodajne dla dostępu.', + 'status_success' => 'Płatność potwierdzona. Twoje konto zostanie zaktualizowane po przetworzeniu webhooka Stripe.', + 'status_canceled' => 'Płatność została anulowana. Nie wprowadzono żadnych zmian.', + 'connecting' => 'Łączenie ze Stripe...', + 'checkout_error' => 'Nie można rozpocząć płatności. Spróbuj ponownie.', + 'per_month' => '/ mies', + 'starter_tier' => 'Poziom startowy', + 'credit_unit' => 'kredyt', + 'credits_unit' => 'kredytów', + 'custom_terms' => 'Warunki niestandardowe', + 'more_users' => 'Więcej użytkowników', + 'custom_credits' => 'Niestandardowe kredyty', + 'onboarding_support' => 'Wsparcie i onboarding', + 'agreed_directly' => 'Uzgadniane bezpośrednio', + 'paid_runs_per_hour' => 'płatnych uruchomień na godzinę', + 'table_cost' => 'Koszt', + 'table_tools' => 'Narzędzia', + 'variable' => 'zmienny', + 'transcribe_cost' => 'transcribe: 1 kredyt za rozpoczętą minutę audio, minimum 5', + ], + default => [ + 'title' => 'Pricing - DBN Tools', + 'description' => 'NOK pricing, credits, and subscriptions for tools.dobetternorge.no.', + 'eyebrow' => 'NOK pricing for DBN Tools', + 'headline' => 'Credits that make sense', + 'subhead' => 'Monthly credits are spent first. Prepaid credits sit on top and never expire.', + 'trial' => 'Plus includes a 14-day trial. Card required, cancel anytime.', + 'survey_title' => 'Get 25 extra credits', + 'survey_text' => 'Answer five short questions about how you use the tools.', + 'survey_cta' => 'Take the survey', + 'current' => 'Current plan', + 'choose' => 'Choose', + 'login' => 'Log in to choose', + 'available' => 'Available', + 'topups_title' => 'Extra credits', + 'topups_lead' => 'Top-ups are one-time purchases. They never expire and are spent after monthly credits.', + 'buy' => 'Buy', + 'login_buy' => 'Log in to buy', + 'tool_costs' => 'Tool costs', + 'tool_costs_lead' => 'Credits are charged only when a tool completes with a valid result.', + 'organisation' => 'Organisation', + 'organisation_price' => 'Contact', + 'organisation_text' => 'For advisers, volunteer groups, and larger family teams that need more users, custom terms, or onboarding.', + 'contact' => 'Talk to us', + 'billing_note' => 'Stripe handles cards, subscriptions, and receipts. Local DBN credits remain authoritative for access.', + 'status_success' => 'Payment confirmed. Your account updates when the Stripe webhook is processed.', + 'status_canceled' => 'Payment was canceled. No changes were made.', + 'connecting' => 'Connecting to Stripe...', + 'checkout_error' => 'Could not start checkout. Please try again.', + 'per_month' => '/ mo', + 'starter_tier' => 'Starter tier', + 'credit_unit' => 'credit', + 'credits_unit' => 'credits', + 'custom_terms' => 'Custom terms', + 'more_users' => 'More users', + 'custom_credits' => 'Custom credits', + 'onboarding_support' => 'Onboarding and support', + 'agreed_directly' => 'Agreed directly', + 'paid_runs_per_hour' => 'paid runs per hour', + 'table_cost' => 'Cost', + 'table_tools' => 'Tools', + 'variable' => 'variable', + 'transcribe_cost' => 'transcribe: 1 credit per started audio minute, minimum 5', + ], +}; $plans = PricingCatalog::plans(); $topups = PricingCatalog::topups(); -$planFeaturesNo = [ - 'free' => ['30 kreditter per måned', 'Verktøy på innlimt tekst', 'Juridisk korpussøk', 'Ingen Min Sak-lagring'], - 'plus' => ['250 kreditter per måned', '500 MB Min Sak-lagring', '1 bruker', '14 dagers prøveperiode'], - 'pro' => ['900 kreditter per måned', '5 GB Min Sak-lagring', '3 brukere', 'Full Azure-modellrute'], + +$planFeatures = [ + 'no' => [ + 'free' => ['30 kreditter per måned', 'Verktøy på innlimt tekst', 'Juridisk korpussøk', 'Ingen Min Sak-lagring'], + 'plus' => ['250 kreditter per måned', '500 MB Min Sak-lagring', '1 bruker', '14 dagers prøveperiode'], + 'pro' => ['900 kreditter per måned', '5 GB Min Sak-lagring', '3 brukere', 'Full Azure-modellrute'], + ], + 'uk' => [ + 'free' => ['30 кредитів на місяць', 'Інструменти для вставленого тексту', 'Пошук юридичного корпусу', 'Без збереження «Моя справа»'], + 'plus' => ['250 кредитів на місяць', '500 МБ сховища «Моя справа»', '1 користувач', '14-денний пробний період'], + 'pro' => ['900 кредитів на місяць', '5 ГБ сховища «Моя справа»', '3 користувачі', 'Повний маршрут моделі Azure'], + ], + 'pl' => [ + 'free' => ['30 kredytów miesięcznie', 'Narzędzia na wklejonym tekście', 'Wyszukiwanie zasobów prawnych', 'Brak zapisu Mojej Sprawy'], + 'plus' => ['250 kredytów miesięcznie', '500 MB pamięci Mojej Sprawy', '1 użytkownik', '14-dniowy okres próbny'], + 'pro' => ['900 kredytów miesięcznie', '5 GB pamięci Mojej Sprawy', '3 użytkownicy', 'Pełna trasa modelu Azure'], + ], + 'en' => [ + 'free' => ['30 credits per month', 'Tools on pasted text', 'Legal corpus search', 'No My Case storage'], + 'plus' => ['250 credits per month', '500 MB My Case storage', '1 user', '14-day trial'], + 'pro' => ['900 credits per month', '5 GB My Case storage', '3 users', 'Full Azure model route'], + ], ]; -$planFeaturesEn = [ - 'free' => ['30 credits per month', 'Tools on pasted text', 'Legal corpus search', 'No My Case storage'], - 'plus' => ['250 credits per month', '500 MB My Case storage', '1 user', '14-day trial'], - 'pro' => ['900 credits per month', '5 GB My Case storage', '3 users', 'Full Azure model route'], -]; -$planFeatures = $isNorwegian ? $planFeaturesNo : $planFeaturesEn; +$planFeatureSet = $planFeatures[$uiLang] ?? $planFeatures['en']; $toolCostRows = [ ['0', 'search, corpus-search, clarify-only gates'], @@ -115,7 +246,7 @@ $toolCostRows = [ ['3', 'barnevernet, advocate, korrespond, legal-analysis'], ['4', 'discrepancy'], ['6', 'deep-research'], - [$isNorwegian ? 'variabel' : 'variable', $isNorwegian ? 'transcribe: 1 kreditt per startet lydminutt, minst 5' : 'transcribe: 1 credit per started audio minute, minimum 5'], + [$copy['variable'], $copy['transcribe_cost']], ]; ?> @@ -135,70 +266,65 @@ $toolCostRows = [ -
- - -
+
- + +
+ + +
@@ -235,20 +361,20 @@ $toolCostRows = [

- +

- + - kr / + kr /

    - +
  • -
  • +
@@ -274,12 +400,12 @@ $toolCostRows = [

-

+

    -
  • -
  • -
  • -
  • +
  • +
  • +
  • +

@@ -298,8 +424,8 @@ $toolCostRows = [

-
-
kr /
+
+
kr /
@@ -321,8 +447,8 @@ $toolCostRows = [ - - + + @@ -339,6 +465,8 @@ $toolCostRows = [ + +