/* Общие компоненты современных текстовых страниц: .ag — «Агентствам» (/agent/, id 8),
   «Частным лицам» (/terms/, id 33), «Скидки» (/actions/, id 35). Подключается движком
   (core/page/page.front.php) только к страницам, в разметке которых есть класс ag или ag-…;
   каждое правило касается только элементов с этими классами. Выноски (.ag-callout) и
   «Красный текст» (.ag-red) из меню «Стили» редактора работают и вне обёртки .ag.
   Разметку правят в mymaster2 (TinyMCE): значки, номера шагов и форматы файлов
   рисуются псевдоэлементами, потому что пустые теги и SVG редактор вычищает. */

#content .ag,
#content .ag-callout {
    --ag-navy: #014090;
    --ag-blue: #0a6ebd;
    --ag-ink: #1f2a37;
    --ag-text: #3d4a5c;
    --ag-muted: #6b7788;
    --ag-line: #dde5ef;
    --ag-soft: #f3f7fc;
    --ag-radius: 14px;
}
#content .ag {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ag-text);
    padding-bottom: 8px;
}
#content .ag * { box-sizing: border-box; }
/* в стилях сайта «body, p, td, div… { font: 12px Tahoma }» задан каждому
   блоку напрямую — без этого сброса вложенные div не наследуют шрифт .ag */
#content .ag div,
#content .ag p,
#content .ag ul,
#content .ag ol,
#content .ag li,
#content .ag table,
#content .ag td {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

#content .ag p {
    font: inherit;
    color: inherit;
    line-height: inherit;
    margin: 0 0 14px;
    padding: 0;
}
/* «SPAN { font-size: 11px; font-weight: normal }» из стилей сайта: редактор оборачивает в span
   подчёркнутый текст, и без сброса он становился мельче и терял жирность */
#content .ag span { font-size: inherit; font-weight: inherit; }
#content .ag a { color: var(--ag-blue); text-decoration: none; font-family: inherit; font-size: inherit; }
#content .ag a:hover { text-decoration: underline; }
#content .ag strong { color: var(--ag-ink); }

#content .ag h1,
#content .ag h2,
#content .ag h3 {
    font-family: inherit;
    color: var(--ag-ink);
    background: none;
    border: 0;
    text-transform: none;
}
#content .ag h2 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 18px;
    padding: 0;
}
#content .ag h3 {
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
    margin: 26px 0 10px;
    padding: 0;
}

#content .ag ul,
#content .ag ol { margin: 0 0 16px; padding: 0; list-style: none; }
#content .ag li { margin: 0; padding: 0; background: none; list-style: none; }

/* ---------- шапка ---------- */
#content .ag-hero {
    margin: 24px 0 20px;
    padding: 36px 40px 34px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 92% 12%, rgba(255, 255, 255, .16) 0 90px, transparent 91px),
        radial-gradient(circle at 80% 110%, rgba(255, 255, 255, .10) 0 140px, transparent 141px),
        linear-gradient(135deg, #013a86 0%, #0a6ebd 100%);
    box-shadow: 0 18px 40px -22px rgba(1, 64, 144, .75);
}
#content .ag-hero .ag-kicker {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
}
#content .ag-hero h1 {
    color: #fff;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 0;
}
#content .ag-hero .ag-lead { font-size: 17px; color: rgba(255, 255, 255, .9); margin: 0 0 22px; }

/* три шага */
#content .ag-steps {
    counter-reset: agstep;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 0 0 26px;
}
#content .ag-steps li {
    counter-increment: agstep;
    position: relative;
    padding: 50px 18px 18px;
    border-radius: var(--ag-radius);
    background: #fff;
    color: var(--ag-text);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .5);
}
#content .ag-steps li::before {
    content: counter(agstep);
    position: absolute;
    top: 16px;
    left: 18px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ag-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}
/* название шага — только первый strong пункта: остальной жирный текст внутри остаётся в строке */
#content .ag-steps li > strong:first-child {
    position: absolute;
    top: 17px;
    left: 54px;
    font-size: 15px;
    color: var(--ag-ink);
}
#content .ag-steps li a { word-break: break-word; }

/* кнопки */
#content .ag-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
#content .ag a.ag-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    background: #ffd23f;
    color: #1f2a37;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .45);
}
#content .ag a.ag-btn:hover { transform: translateY(-1px); background: #ffdb66; text-decoration: none; }
#content .ag a.ag-btn-ghost {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7);
}
#content .ag a.ag-btn-ghost:hover { background: rgba(255, 255, 255, .12); }
#content .ag a.ag-btn-light { background: #fff; color: var(--ag-navy); }
#content .ag a.ag-btn-light:hover { background: #eef4fb; }

/* оглавление */
#content .ag .ag-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 26px;
}
#content .ag-toc a {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--ag-soft);
    border: 1px solid var(--ag-line);
    color: var(--ag-navy);
    font-size: 13px;
    font-weight: 600;
}
#content .ag-toc a:hover { background: #e6effa; text-decoration: none; }

/* разделы */
#content .ag-section {
    margin: 0 0 22px;
    padding: 30px 34px 18px;
    border: 1px solid var(--ag-line);
    border-radius: 18px;
    background: #fff;
    scroll-margin-top: 16px;
}
#content .ag-section > h2::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin-bottom: 12px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ag-navy), var(--ag-blue));
}

/* выноски */
#content .ag-callout {
    position: relative;
    margin: 0 0 18px;
    padding: 18px 22px 6px 58px;
    border-radius: var(--ag-radius);
    border: 1px solid;
}
#content .ag-callout::before {
    content: "i";
    position: absolute;
    top: 18px;
    left: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font: 700 14px/24px Georgia, serif;
    text-align: center;
    color: #fff;
}
/* у списков в выноске — только свои точки: вне .ag (старые страницы) без этого оставались
   маркер браузера и отступы сайта (внутри .ag те же значения уже заданы правилом «.ag ul, .ag ol») */
#content .ag-callout ul,
#content .ag-callout ol { list-style: none; padding: 0; }
#content .ag-callout ul { margin: -4px 0 14px 2px; }
#content .ag-callout li { position: relative; padding-left: 16px; margin-bottom: 4px; }
#content .ag-callout li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .6;
}
#content .ag-info  { background: #eef5fd; border-color: #cfe0f5; }
#content .ag-info::before  { background: var(--ag-blue); }
#content .ag-warn  { background: #fff7e8; border-color: #f6dca6; }
#content .ag-warn::before  { content: "!"; font-family: inherit; background: #e39b12; }
#content .ag-danger { background: #fdf0ef; border-color: #f4c9c4; }
#content .ag-danger::before { content: "!"; font-family: inherit; background: #d23c2e; }
#content .ag .ag-muted,
#content .ag-callout.ag-muted { background: var(--ag-soft); border-color: var(--ag-line); color: var(--ag-muted); font-size: 13.5px; margin-top: 18px; }
#content .ag-muted::before { background: #97a3b3; }
#content .ag .ag-red,
#content .ag-red { color: #d23c2e; }

#content .ag .ag-note {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff7e8;
    color: #8a5a00;
    font-size: 14px;
    font-weight: 600;
}

/* список с галочками */
#content .ag-check li { position: relative; padding-left: 30px; margin-bottom: 8px; }
#content .ag-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .2em;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e3eefb;
}
#content .ag-check li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: calc(.2em + 5px);
    width: 5px;
    height: 9px;
    border: solid var(--ag-blue);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* документы */
#content .ag-docs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
#content .ag-docs a {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 68px;
    padding: 12px 96px 12px 70px;
    border: 1px solid var(--ag-line);
    border-radius: var(--ag-radius);
    background: #fff;
    color: var(--ag-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#content .ag-docs a:hover {
    text-decoration: none;
    border-color: #b9cfe9;
    box-shadow: 0 10px 22px -16px rgba(1, 64, 144, .6);
    transform: translateY(-1px);
}
/* пояснение под названием документа */
#content .ag-docs a small {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--ag-muted);
}
/* бейдж формата — по расширению в ссылке */
#content .ag-docs a::before {
    content: "DOC";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 48px;
    border-radius: 6px 14px 6px 6px;
    background: #2b6cd4;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 62px;
    text-align: center;
}
#content .ag-docs a[href$=".docx"]::before { content: "DOCX"; }
#content .ag-docs a[href$=".xlsx"]::before,
#content .ag-docs a[href$=".xls"]::before { content: "XLSX"; background: #1d8a52; }
#content .ag-docs a[href$=".pdf"]::before { content: "PDF"; background: #d23c2e; }
#content .ag-docs a::after {
    content: "Скачать";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ag-blue);
    font-size: 13px;
    font-weight: 600;
}

/* реквизиты */
#content .ag table.ag-req {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--ag-line);
    border-radius: var(--ag-radius);
    overflow: hidden;
    font-family: inherit;
    font-size: 14px;
}
#content .ag-req td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--ag-line);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ag-ink);
    vertical-align: top;
}
#content .ag-req tr:last-child td { border-bottom: 0; }
#content .ag-req tr:nth-child(odd) td { background: var(--ag-soft); }
#content .ag-req td:first-child { width: 38%; color: var(--ag-muted); }

/* «в путевке» — в две колонки */
#content .ag-cols { columns: 2; column-gap: 28px; }
#content .ag-cols li {
    break-inside: avoid;
    position: relative;
    padding: 0 0 6px 18px;
}
#content .ag-cols li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .62em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--ag-blue);
}

/* условия оплаты */
#content .ag-terms {
    counter-reset: agterm;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
#content .ag-terms li {
    counter-increment: agterm;
    position: relative;
    padding: 16px 18px 16px 58px;
    border-radius: var(--ag-radius);
    background: var(--ag-soft);
    border: 1px solid var(--ag-line);
    font-size: 14px;
    line-height: 1.5;
}
#content .ag-terms li::before {
    content: counter(agterm);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ag-navy);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 28px;
    text-align: center;
}

/* финал */
#content .ag-thanks {
    margin: 4px 0 20px;
    padding: 28px 34px;
    border-radius: 18px;
    background: linear-gradient(135deg, #013a86 0%, #0a6ebd 100%);
    color: #fff;
    text-align: center;
}
#content .ag-thanks p { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
#content .ag-thanks p:last-child { margin-bottom: 0; }

/* колонка сайта сейчас жёстко 900px, поэтому по ширине самой колонки, а не экрана */
#content .ag { container-type: inline-size; }
@container (max-width: 700px) {
    #content .ag-hero { padding: 26px 20px; }
    #content .ag-hero h1 { font-size: 25px; }
    #content .ag-steps,
    #content .ag-docs,
    #content .ag-terms { grid-template-columns: 1fr; }
    #content .ag-section { padding: 22px 18px 10px; }
    #content .ag-cols { columns: 1; }
}
