/* ==========================================================================
   alpha-lead — Telegram-виджет на сайте. Чистый HTML/CSS, без картинок и JS.
   --------------------------------------------------------------------------
   Размеры в em от базового font-size: весь виджет масштабируется одной
   переменной --s. Открытие/закрытие — на скрытом чекбоксе.
   Палитра — из alpha.css (бумага, графит, оранжевый акцент).
   Тексты подставляются по разделу сайта при сборке (build_widget.py).
   ========================================================================== */

.altg {
  --s: .58;

  /* палитра alpha-lead */
  --paper:   #EEE9DE;
  --paper-2: #E6E0D2;
  --paper-3: #DBD4C2;
  --ink:     #14150E;
  --ink-2:   #31332A;
  --muted:   #7A7A6C;
  --line:    #C8C1AE;
  --accent:  #D93B16;
  --accent-d:#A82A0B;
  --graphite:#1A1C15;
  --graphite-2:#232619;
  --ok:      #3E8E5F;

  --radius: 1.35em;
  --shadow: 0 .5em 1.6em rgba(20, 21, 14, .22);

  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7em;
  font-size: calc(16px * var(--s));
  font-family: var(--body, "Golos Text"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}

.altg *, .altg *::before, .altg *::after { box-sizing: border-box; }

/* скрытый переключатель состояния */
.altg__toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ============================== ПАНЕЛЬ ================================= */
.altg__panel {
  width: 30em;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  pointer-events: auto;
  transform-origin: left bottom;
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.altg__toggle:not(:checked) ~ .altg__panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.2em) scale(.97);
  pointer-events: none;
}

/* ============================== ШАПКА ================================== */
.altg__head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo titles close"
    "status status status";
  align-items: center;
  gap: .35em 1em;
  padding: 1.25em 1.25em 1.1em;
  background: linear-gradient(155deg, var(--graphite-2) 0%, var(--graphite) 100%);
  color: var(--paper);
  overflow: hidden;
}
.altg__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 120% at 108% 42%, rgba(217, 59, 22, .30), rgba(217, 59, 22, 0) 62%),
    radial-gradient(50% 90% at 88% 0%, rgba(238, 233, 222, .10), rgba(238, 233, 222, 0) 60%);
  pointer-events: none;
}

.altg__logo { grid-area: logo; display: block; width: 4.4em; height: 4.4em; position: relative; }
.altg__logo svg { display: block; width: 100%; height: 100%; border-radius: 50%; }

.altg__titles { grid-area: titles; position: relative; min-width: 0; }
.altg__title {
  font-family: var(--disp, "Unbounded"), system-ui, sans-serif;
  font-size: 1.5em; font-weight: 700; letter-spacing: -.01em;
}
.altg__sub { font-size: 1em; font-weight: 500; color: rgba(238, 233, 222, .82); margin-top: .22em; }

.altg__close {
  grid-area: close;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 2.5em; height: 2.5em;
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  transition: transform .2s ease;
}
.altg__close:hover { transform: scale(1.06); }
.altg__close svg { width: 1.05em; height: 1.05em; }
.altg__close path { stroke: var(--ink); }

.altg__status {
  grid-area: status;
  display: flex; align-items: center; gap: .6em;
  margin-top: .55em;
  font-size: 1.02em;
  min-width: 0;
}
.altg__dot {
  width: .62em; height: .62em; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 .18em rgba(62, 142, 95, .28);
  flex: 0 0 auto;
}
.altg__online { font-weight: 700; white-space: nowrap; }
.altg__sep { width: 1px; height: 1.3em; background: rgba(238, 233, 222, .3); flex: 0 0 auto; }
.altg__statusnote {
  color: rgba(238, 233, 222, .82);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* =============================== ТЕЛО ================================== */
.altg__body { padding: 1.25em 1.25em 1.1em; background: var(--paper); }

.altg__msgrow { display: flex; align-items: flex-start; gap: .8em; }

.altg__avatar {
  flex: 0 0 auto;
  width: 3.3em; height: 3.3em;
  border-radius: 50%;
  background: var(--paper-2);
  overflow: hidden;
}
.altg__avatar svg { display: block; width: 100%; height: 100%; }

.altg__bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--paper-2);
  border-radius: 1.1em;
  padding: .95em 1.05em .7em;
}
.altg__msg { margin: 0; font-size: 1.2em; line-height: 1.44; color: var(--ink); }
.altg__msg2 { margin: .5em 0 0; font-size: 1.04em; color: var(--ink-2); }
.altg__meta { display: flex; align-items: center; justify-content: flex-end; gap: .4em; margin-top: .45em; }
.altg__time { font-size: .92em; color: var(--muted); font-family: var(--mono, monospace); }
.altg__checks { width: 1.8em; height: auto; }
.altg__checks path { stroke: var(--ok); }

/* три преимущества раздела */
.altg__features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5em;
  margin: 1.15em 0 1.05em;
  padding: 0;
  list-style: none;
}
.altg__feature { display: flex; flex-direction: column; align-items: center; text-align: center; }
.altg__fi {
  display: flex; align-items: center; justify-content: center;
  width: 4em; height: 4em;
  border-radius: 50%;
  margin-bottom: .5em;
  background: var(--paper-3);
  color: var(--accent);
}
.altg__fi svg { width: 1.7em; height: 1.7em; display: block; }
.altg__fi-label { font-size: .96em; line-height: 1.3; color: var(--ink-2); }

/* кнопка действия раздела */
.altg__cta {
  display: flex; align-items: center; gap: .7em;
  min-height: 4em;
  padding: .55em 1.25em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 .35em 1em rgba(217, 59, 22, .32);
  transition: background-color .2s ease, transform .2s ease;
}
.altg__cta:hover { background: var(--accent-d); transform: translateY(-1px); }
.altg__cta-plane { width: 2em; height: 2em; flex: 0 0 auto; }
.altg__cta-text { flex: 1 1 auto; font-size: 1.26em; font-weight: 700; text-align: center; }
.altg__cta-arrow { width: 1.2em; height: 1.2em; flex: 0 0 auto; color: rgba(255, 255, 255, .9); }

.altg__cta2 {
  display: flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 3.5em;
  margin-top: .55em;
  padding: .5em 1.2em;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.altg__cta2:hover { border-color: var(--accent); background: var(--paper-2); transform: translateY(-1px); }
.altg__cta2-icon { display: flex; align-items: center; justify-content: center; }
.altg__cta2-icon svg { width: 1.45em; height: 1.45em; display: block; }
.altg__cta2-text { font-size: 1.1em; font-weight: 600; text-align: center; }
.altg__cta2-arrow { width: 1.05em; height: 1.05em; flex: 0 0 auto; color: var(--muted); }

.altg__note {
  margin: .85em 0 0;
  text-align: center;
  font-size: .92em;
  color: var(--muted);
  font-family: var(--mono, monospace);
}

/* ======================= ПЛАВАЮЩАЯ КНОПКА ============================== */
.altg__launcher {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 3.8em; height: 3.8em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 .35em 1em rgba(217, 59, 22, .45);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .2s ease, background-color .2s ease;
}
.altg__launcher:hover { transform: translateY(-2px); background: var(--accent-d); }
.altg__launcher svg { width: 2em; height: 2em; }

/* ============================ УЗКИЙ ЭКРАН ============================== */
@media (max-width: 480px) {
  .altg { left: 10px; right: 10px; bottom: 10px; --s: .72; }
  .altg__panel { width: 100%; }
  .altg__launcher { width: 3.5em; height: 3.5em; }
}

/* на печати виджет не нужен */
@media print { .altg { display: none; } }
