/* ============================================================
   "In groups" block, pricing tabs, one-off packages and group prices —
   index pages, every locale.

   Markup:   templates/partials/groups_pricing.html (macros, per-locale strings).
   Behaviour: static/js/site.js (group modes, pricing tabs, currency switch).

   Colours and fonts come from the page stylesheet (index.css for ru,
   index-en.css for en / uk / de / ar): --paper, --paper-warm, --ink,
   --ink-soft, --ink-mute, --rule, --rule-strong, --gold, --gold-bright.
   The group chat reuses the hero chat's wallpaper and bubble palette.
   Layout uses logical properties, so the Arabic page needs no overrides.
   ============================================================ */

/* Blocks below set their own display, so the hidden attribute needs help. */
.groups [hidden], .pricing [hidden] { display: none !important; }

/* First screen: "in a private chat and in groups". */
.hero .sub .hl { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold-bright); }

/* ---------- "In groups" block ---------- */
.groups { padding: 80px 32px; border-bottom: 1px solid var(--ink); }
.groups-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: 72px; row-gap: 28px; align-items: start;
}
/* Source order is the phone order (text, modes, chat, …). On wide screens the
   chat takes the first column and everything else flows down the second. */
.groups-inner > * { grid-column: 2; min-width: 0; max-width: 640px; margin: 0; }
.groups-inner > .groups-demo {
  grid-column: 1; grid-row: 1 / span 5; align-self: center; max-width: none;
  display: flex; justify-content: center;
}
.groups-tag { display: flex; align-items: center; gap: 10px; }
.groups-tag .new-badge { margin-inline-start: 0; }
.groups-head h2 { font-size: clamp(30px, 3.9vw, 48px); line-height: 1.02; }
.groups-lead { font-size: 17px; line-height: 1.5; color: var(--ink); max-width: 540px; }

.group-modes { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.group-mode {
  appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink); cursor: pointer;
  text-align: start; background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; margin: 0; padding: 15px 14px; min-height: 44px;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px; align-items: baseline;
}
.group-mode:hover { background: rgba(255,193,5,0.06); }
.group-mode.active { background: rgba(255,193,5,0.12); }
.group-mode:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.gm-num { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500; color: var(--ink-mute); }
.group-mode.active .gm-num { color: #8a5e00; }
.gm-name { display: block; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.2; }
.gm-short { display: none; }
.gm-desc { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.group-mode-desc { display: none; }

.groups-fact { font-size: 14px; color: var(--ink-soft); }
.groups-fact strong { color: var(--ink); font-weight: 600; }
.groups-ctas, .gp-ctas { display: flex; gap: 14px 22px; align-items: center; flex-wrap: wrap; }

/* Group chat example */
.gchat {
  --tg-deep: #8a5e00;
  width: 100%; max-width: 420px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--ink); box-shadow: 0 24px 48px -16px rgba(24,24,26,0.25);
  font-family: 'Inter', system-ui, sans-serif; font-size: 13.5px; line-height: 1.38; color: #1d1d1f;
  background:
    url("/static/public/img/chat-wallpaper.svg") 0 0 / 280px 280px,
    linear-gradient(180deg, #ebe4d4 0%, #dfd4ba 100%);
}
.gchat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #f7f3e8; border-bottom: 1px solid rgba(60,45,10,0.14);
}
.gchat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--gold-bright); font-weight: 700; font-size: 13px;
}
.gchat-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.gchat-title strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.gchat-title span { font-size: 11px; color: #6a6453; }
.gchat-body {
  padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 10px;
  min-height: 392px; box-sizing: border-box;
}
.gmsg { display: flex; align-items: flex-end; gap: 8px; }
.gmsg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #ffffff; font-weight: 700; font-size: 12px;
}
.gmsg-avatar-a { background: #b9801c; }
.gmsg-avatar-b { background: #3f5f8f; }
/* The bot's own Telegram avatar, the same file the first-screen chat uses. */
img.gmsg-avatar-bot { display: block; object-fit: cover; background: var(--gold-bright); }
.gbubble {
  background: #ffffff; border-radius: 17px; border-end-start-radius: 5px;
  padding: 7px 12px 8px 10px; box-shadow: 0 1px 1px rgba(60,45,10,0.14);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.gbubble-result { max-width: 300px; gap: 5px; }
.gname { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.gname-a { color: var(--tg-deep); }
.gname-b { color: #2f4f80; }
.gname-bot { color: var(--tg-deep); }
.gvoice { display: flex; align-items: center; gap: 10px; }
.gvoice-play {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--gold); color: #ffffff;
}
.gvoice-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gvoice-wave { color: var(--gold); max-width: 100%; height: auto; }
.gvoice-time { font-size: 11.5px; color: #6f5c22; }
/* Reply header and the result quote share Telegram's quote look: a tinted
   block with a stripe on the reading side. */
.gquote, .gresult-quote {
  border-inline-start: 3px solid var(--gold); border-radius: 5px;
  background: rgba(201,145,26,0.11);
}
.gquote { padding: 3px 8px; font-size: 12px; line-height: 1.3; color: #5b5b60; }
.gquote-who { display: block; color: var(--tg-deep); font-weight: 600; }
.gcommand { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500; color: var(--tg-deep); direction: ltr; unicode-bidi: isolate; }
.goffer { display: flex; flex-direction: column; gap: 5px; min-width: 210px; }
.goffer-btn {
  appearance: none; -webkit-appearance: none; font: inherit; cursor: pointer;
  min-height: 44px; border: 0; border-radius: 10px; background: #5b4a1e; color: #ffffff;
  font-size: 13.5px; font-weight: 600; padding: 10px 14px;
}
.goffer-btn:hover { background: #4a3c17; }
.goffer-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gresult-head b { font-weight: 600; }
/* The recognised text: three lines until the quote is opened, as Telegram
   shows an expandable quote. The whole block is the click target. */
.gresult-quote { position: relative; cursor: pointer; padding-block: 5px 6px; padding-inline: 8px 24px; }
.gresult-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.gresult-quote.expanded .gresult-text { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.gresult-mark {
  position: absolute; inset-block-start: 1px; inset-inline-end: 7px;
  font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 700; line-height: 1; color: var(--gold);
}
.gresult-toggle {
  appearance: none; -webkit-appearance: none; position: absolute; inset-block-end: 1px; inset-inline-end: 2px;
  width: 22px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  color: var(--tg-deep); display: grid; place-items: center;
}
.gresult-toggle::before {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.gresult-quote.expanded .gresult-toggle::before { margin-top: 3px; transform: rotate(-135deg); }
.gresult-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- Pricing: tabs + currency switch ---------- */
.pricing-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px; border-bottom: 1px solid var(--ink);
}
.pricing-tabs { display: flex; flex-wrap: wrap; gap: 0 36px; }
.pricing-tab {
  appearance: none; -webkit-appearance: none; font: inherit; cursor: pointer; text-align: start;
  background: none; border: 0; border-radius: 0; margin: 0; padding: 8px 0 14px; min-height: 44px;
  display: flex; flex-direction: column; gap: 3px;
  color: var(--ink-mute); box-shadow: inset 0 -4px 0 transparent;
}
.pricing-tab:hover { color: var(--ink-soft); }
.pricing-tab.active { color: var(--ink); box-shadow: inset 0 -4px 0 var(--ink); }
.pricing-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pt-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: -0.02em; line-height: 1.1; }
.pt-sub { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }

/* The fiat box keeps its own rules from the page stylesheet; here it only
   shares a row with the separate Stars button. */
.pricing-controls .pricing-currency-wrap {
  display: inline-flex; align-items: stretch; justify-content: flex-start; gap: 8px;
  margin: 0 0 14px;
}
.pricing-currency-stars {
  appearance: none; -webkit-appearance: none; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 0; margin: 0;
  padding: 0 14px; min-height: 36px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; color: var(--ink-soft);
}
.pricing-currency-stars.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pricing-currency-stars:focus-visible,
.pricing-currency-toggle button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pricing-stars-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.pricing-stars-note a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.pricing-panel > .price-table { margin-top: 22px; }

/* One row for what every plan includes (was four identical rows of dots). */
.price-table tbody tr.all-plans td { font-weight: 600; }
.price-table tbody tr.all-plans td:first-child { font-weight: 500; }
.price-cards-all { display: none; margin: 14px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Personal tab: one-off packages ---------- */
.packs { margin-top: 48px; border: 1px solid var(--ink); background: var(--paper-warm); }
.packs-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; padding: 22px 24px 18px; border-bottom: 1px solid var(--ink);
}
.packs-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.packs-title h3 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.packs-title span { font-size: 14px; color: var(--ink-soft); }
.packs-link { font-weight: 600; font-size: 13px; color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.packs-link:hover { color: var(--gold); border-color: var(--gold); }
.packs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px;
  background: rgba(24,24,26,0.2);
}
.pack { background: var(--paper-warm); padding: 20px 24px 22px; }
.pack-min { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.pack-ai { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.pack-price { margin-top: 16px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.packs-note {
  margin: 0; padding: 16px 24px 20px; border-top: 1px solid rgba(24,24,26,0.2);
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.55;
}
.packs + .pricing-footnote { margin-top: 28px; }

/* ---------- Group tab ---------- */
.group-pricing { padding-top: 40px; }
.gp-head { display: flex; flex-wrap: wrap; gap: 12px 56px; align-items: flex-end; margin-bottom: 28px; }
.gp-head h3 { flex: 1 1 320px; font-size: 34px; letter-spacing: -0.025em; line-height: 1.05; }
.gp-head p { flex: 1 1 320px; margin: 0; font-size: 15px; color: var(--ink-soft); max-width: 480px; line-height: 1.55; }
.gp-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--ink); border: 1px solid var(--ink);
}
.gp-cell { background: var(--paper); padding: 24px 24px 26px; min-width: 0; }
.gp-cell.gp-free { background: var(--paper-warm); }
.gp-kicker { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.gp-amount { margin-top: 14px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.gp-period { font-size: 14px; font-weight: 600; margin-top: 4px; }
.gp-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin-top: 4px; }
.gp-valid { font-size: 13px; color: var(--ink-soft); margin-top: 14px; line-height: 1.5; }
.gp-types { grid-column: 1 / -1; background: var(--paper); padding: 14px 24px; font-size: 14px; font-weight: 600; }
.gp-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.gp-ctas { margin-top: 36px; }

/* The Arabic page pins the document flow to LTR (css/rtl.css) and turns each
   block right-to-left on its own; this block does the same. The pricing
   section is already switched there. */
html[dir="rtl"] .groups { direction: rtl; text-align: right; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .groups { padding: 56px 18px; }
  .groups-inner { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .groups-inner > *,
  .groups-inner > .groups-demo { grid-column: 1; grid-row: auto; max-width: none; }

  /* Modes become one segmented control above the chat; the description of the
     selected mode moves under the chat. */
  .group-modes {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--ink);
  }
  .group-mode {
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 0 6px; min-height: 46px; border-bottom: 0; border-inline-end: 1px solid var(--ink);
  }
  .group-mode:last-child { border-inline-end: 0; }
  .group-mode:hover { background: transparent; }
  .group-mode.active, .group-mode.active:hover { background: var(--ink); color: var(--paper); }
  .gm-num, .gm-name, .gm-desc { display: none; }
  .gm-short { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
  .group-mode-desc { display: block; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
  .gchat-body { min-height: 356px; }
  .groups-ctas .btn-solid, .gp-ctas .btn-solid { width: 100%; justify-content: center; min-height: 52px; }
  .groups-ctas .btn-link { align-self: center; margin: 0 auto; }
}

@media (max-width: 720px) {
  .pricing-controls { border-bottom: 0; gap: 12px; }
  .pricing-tabs {
    width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
    border: 1px solid var(--ink);
  }
  .pricing-tab {
    align-items: center; justify-content: center; text-align: center; padding: 6px 8px; min-height: 52px;
    color: var(--ink-soft); box-shadow: none;
  }
  .pricing-tab + .pricing-tab { border-inline-start: 1px solid var(--ink); }
  .pricing-tab.active { background: var(--ink); color: var(--paper); box-shadow: none; }
  .pt-name { font-size: 16px; letter-spacing: -0.01em; }
  .pt-sub { display: none; }

  .pricing-controls .pricing-currency-wrap { width: 100%; margin: 0; }
  .pricing-controls .pricing-currency-toggle { flex: 3 1 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .pricing-controls .pricing-currency-toggle button { min-height: 44px; padding: 0 4px; }
  .pricing-currency-stars { flex: 1.25 1 0; min-height: 44px; padding: 0 4px; letter-spacing: 0.08em; }
  .pricing-stars-note { margin-top: 12px; }

  .price-cards-all { display: block; }

  .packs { margin-top: 32px; }
  .packs-head { padding: 18px 18px 14px; }
  .packs-grid { grid-template-columns: minmax(0, 1fr); }
  .pack {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
    padding: 12px 18px; min-height: 66px; box-sizing: border-box;
  }
  .pack-min { grid-column: 1; font-size: 18px; letter-spacing: -0.01em; line-height: 1.2; }
  .pack-ai { grid-column: 1; margin-top: 0; }
  .pack-price { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; white-space: nowrap; }
  .packs-note { padding: 14px 18px 18px; }

  .group-pricing { padding-top: 30px; }
  .gp-head { margin-bottom: 22px; gap: 10px; }
  .gp-head h3 { flex-basis: 100%; font-size: 26px; line-height: 1.08; }
  .gp-head p { flex-basis: 100%; }
  .gp-grid { grid-template-columns: minmax(0, 1fr); }
  .gp-cell { padding: 18px 18px 20px; }
  .gp-cell.gp-pack {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
    padding: 12px 18px; min-height: 66px; box-sizing: border-box;
  }
  .gp-pack .gp-kicker { display: none; }
  .gp-pack .gp-amount { grid-column: 1; grid-row: 1; margin-top: 0; font-size: 18px; letter-spacing: -0.01em; line-height: 1.2; }
  .gp-pack .gp-valid { grid-column: 1; grid-row: 2; margin-top: 0; }
  .gp-pack .gp-price { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; white-space: nowrap; }
  .gp-free .gp-amount { margin-top: 10px; font-size: 28px; }
  .gp-types { padding: 13px 18px; }
  .gp-ctas { margin-top: 28px; }
}
