/* Analytics free trial — новые правила. Ничего из существующего не переопределяем,
   только добавляем классы с префиксом at- / модификатор widget--trial.
   Цвета взяты из уже используемых в проекте: #118a52 (pricing .price-badge),
   #00a193 (.btn-primary), #007f74 (.card-title), #676767, #8c93ad, #176ec7
   (.subscription-buy__extra-link). ВАЖНО: весь блок выводится только для $/€,
   в рублёвой версии разметка не печатается вовсе. */

/* ─── 1. Прайсинг: карточка Analytics ─────────────────────────────────── */

/* Чип живёт В ЛЕНТЕ плана, справа от её названия: абсолютный чип в углу
   карточки садился на центрированный текст .plan-type ($lab_003) и на
   длинных переводах перекрывал его. Лента переводится во флекс только
   вместе с чипом — через дополнительный класс at-has-chip, существующее
   правило .plan-type не меняется. */
.plan-type.at-has-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-right: 6px;
}

.plan-type.at-has-chip > .at-chip {
    flex: 0 0 auto;
}

.at-chip {
    padding: 4px 9px;
    border-radius: 999px;
    background: #118a52;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Чип строкой под названием плана, по центру — единственный носитель
   месседжа про бесплатную неделю (отдельной строки над ценой нет).
   Текст длиннее, поэтому без капса и разрядки. */
.at-chip--inline {
    display: table;
    margin: 0 auto 14px;
    font-size: 13px;
    line-height: 18px;
    padding: 6px 14px;
    letter-spacing: 0;
    text-transform: none;
}

/* Микротекст под кнопкой. Идёт ПОСЛЕ <p class="button">, внутри карточки. */
.at-notes {
    margin: 12px 0 0;
    text-align: center;
    text-wrap: pretty;
}

.at-notes__line {
    display: block;
    font-size: 13px;
    line-height: 17px;
    color: #676767;
}

.at-notes__line + .at-notes__line {
    margin-top: 6px;
    color: #676767;
}

/* ─── 2. Дашборд: виджет ──────────────────────────────────────────────── */

/* Цвет — смысл, а не оформление: задаём классом, как у .widget--notice-*,
   и убираем пипетку (перекрашивать нечего). */
.widgets-main .widget--trial.block-shadow {
    max-height: -webkit-fit-content;
    max-height: fit-content;
}

/* Яркая шапка: color-3 из штатной палитры виджетов (#ffb77e) — виджет стоит
   первым в ряду и должен цеплять взгляд. */
.widgets-main .widget--trial .widget__header[data-color] {
    background-color: #ffb77e;
    border-bottom-color: #ffb77e;
}

.change-state .widget--trial .widget__colors {
    display: none;
}

.at-w-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    color: #202124;
}

.at-w-text {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: #676767;
}

/* Кнопка: не тянется на всю ширину; радиус 25px — как у .btn в controls.css
   и .widget-cl__btn, а не 2px из локального .btn dashboard/style.css */
.widget--trial .widget-cl__link {
    width: auto;
    min-width: 0;
    padding: .475rem 1.1rem;
    border-radius: 25px;
}

/* ─── 3. Модалка подписки, ступень 2 (залогинен, без подписки) ─────────── */

/* Заменяет .subscription-buy__title; строка цены (.subscription-buy__price)
   не выводится — цена в чекауте. */
.at-headline {
    margin: 0 0 22px;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.15;
    color: #202124;
}

/* Условие списания — вместо сноски со звёздочкой */
.at-terms {
    display: block;
    max-width: 320px;
    margin: 16px auto 0;
    font-size: 14px;
    line-height: 1.45;
    color: #202124;
    text-wrap: pretty;
}

.at-plans-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.4;
    color: #176ec7;
    text-decoration: none;
}

.at-plans-link:hover {
    color: #176ec7;
    text-decoration: underline;
}

/* ─── Мобильные (проверено на 360 и 390px) ───────────────────────────── */

@media screen and (max-width: 640px) {
    .at-chip {
        font-size: 10px;
        padding: 3px 7px;
    }

    .at-notes__line {
        font-size: 12px;
        line-height: 16px;
    }

    .at-headline {
        font-size: 21px;
    }

    .at-terms {
        font-size: 13px;
        max-width: none;
    }

    /* Виджет на мобильном: кнопка на всю ширину карточки */
    .widget--trial .widget-cl__buttons {
        display: block;
    }

    .widget--trial .widget-cl__link {
        width: 100%;
    }
}

/* ─── 4. Триальный чекаут (/subscriptions/analytics/?trial=1) ────────────
   Правки владельца 06.09. Область действия -- ТОЛЬКО страница триального
   чекаута: scope-класс at-trial-checkout ставит pay/main.php на карточку
   плана и на правую колонку при $at_trial_mode. На прайсинге, в дашборде и
   модалке эти правила не применяются. */
.at-trial-checkout .at-terms {
    margin: 0 auto 0;
}

.at-trial-checkout .at-chip {
    padding: 4px 12px;
    font-size: 14px;
}

.at-trial-checkout .tariff__plan .tariff__header {
    margin: 6px auto 4px;
    font-size: 16px;
}

.at-trial-checkout span.tariff__price {
    font-size: 16px;
}

.at-trial-checkout label.planTitle.description.my-0,
.at-trial-checkout .planVal.description.my-0 {
    font-size: 16px;
}

/* абзац условий под итогом -- вплотную к строке Due today */
.at-trial-checkout .description.my-0.at-terms {
    margin: 0;
}
