/*
 * Лендинг «Благотворительность CarBlank» (/charity/).
 * Подключается только в templates/main/pages/charity.html, все правила внутри .charity —
 * остальные страницы сайта не затрагиваются. Шрифт Montserrat, оранжевый #FF620A и
 * радиусы кнопок — из общих стилей сайта; палитра строгая: белый, серые, графит.
 */

.charity {
    --ch-orange: #FF620A;
    --ch-orange-hover: #E55500;
    --ch-orange-text: #C44700;      /* оранжевый для мелкого текста на белом (контраст ≥ 4.5) */
    --ch-orange-soft: #FFF1E8;
    --ch-ink: #1F2026;              /* графит */
    --ch-ink-2: #3D3F48;
    --ch-muted: #61636D;
    --ch-line: #E4E4E8;
    --ch-grey: #F5F5F7;
    --ch-error: #B42318;
    --ch-ok: #146C43;
    --ch-radius: 20px;
    --ch-radius-sm: 12px;
    --ch-nav-top: 60px;             /* высота фиксированной шапки сайта, уточняется скриптом */

    max-width: none;
    color: var(--ch-ink);
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: #fff;
}

/* Сброс старых глобальных правил темы (h1 50px, h3 uppercase, outline: none и т. п.) */
.charity h1, .charity h2, .charity h3, .charity p, .charity ul, .charity ol, .charity figure {
    margin: 0;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
}
.charity ul, .charity ol { list-style: none; }
.charity a { color: inherit; }
.charity a:focus-visible,
.charity button:focus-visible,
.charity summary:focus-visible,
.charity input:focus-visible,
.charity textarea:focus-visible,
.charity [tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 3px solid var(--ch-orange);
    outline-offset: 2px;
}
.charity [id] { scroll-margin-top: calc(var(--ch-nav-top) + 20px); }
.charity .ch-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Типографика */
.charity .ch-eyebrow {
    margin-bottom: 10px;
    color: var(--ch-orange-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.charity .ch-h2 {
    margin-bottom: 18px;
    color: var(--ch-ink);
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
}
.charity .ch-h3 {
    margin-bottom: 10px;
    color: var(--ch-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}
.charity .ch-muted { color: var(--ch-muted); }
.charity p + p { margin-top: 12px; }

/* Кнопки и ссылки — как .button сайта: оранжевый, радиус 20px, Montserrat 600 */
.charity .ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 15px 28px;
    border: 1px solid var(--ch-orange);
    border-radius: var(--ch-radius);
    background: var(--ch-orange);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.charity .ch-btn:hover { background: var(--ch-orange-hover); border-color: var(--ch-orange-hover); color: #fff; }
.charity .ch-btn[disabled] { opacity: .55; cursor: not-allowed; }
.charity .ch-btn--sm { min-height: 42px; padding: 9px 18px; font-size: 14px; border-radius: 14px; }

.charity .ch-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ch-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--ch-orange);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}
.charity .ch-link i { color: var(--ch-orange-text); font-size: .85em; }
.charity .ch-link:hover { color: var(--ch-orange-text); }
.charity .ch-link--sm { font-size: 14px; }

.charity .ch-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--ch-orange-soft);
    color: var(--ch-orange);
    font-size: 20px;
}

.charity .ch-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ch-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.charity .ch-badge--muted { background: var(--ch-grey); color: var(--ch-muted); border: 1px solid var(--ch-line); }

.charity .ch-placeholder-note {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    color: var(--ch-muted);
    font-size: 14px;
}
.charity .ch-placeholder-note i { margin-top: 4px; color: var(--ch-orange); }

/* Первый экран */
.charity .ch-hero {
    position: relative;
    /* 60px сверху — хлебные крошки на той же высоте, что на остальных страницах (105px от верха окна) */
    padding: 60px 0 40px;
    background:
        radial-gradient(circle at 1px 1px, #E9E9EE 1px, transparent 1.5px) 0 0 / 22px 22px,
        linear-gradient(180deg, #fff 0%, var(--ch-grey) 100%);
}
.charity .ch-hero__grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-top: 20px;
}
.charity .ch-hero__title {
    color: var(--ch-ink);
    font-size: 56px;
    font-weight: 800;
    line-height: 1.05;
}
.charity .ch-hero__lead {
    margin-top: 18px;
    color: var(--ch-ink);
    font-size: 22px;
    font-weight: 600;
}
.charity .ch-hero__desc {
    max-width: 540px;
    margin-top: 14px;
    color: var(--ch-ink-2);
    font-size: 17px;
}
.charity .ch-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    margin-top: 30px;
}
.charity .ch-hero__note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--ch-muted);
    font-size: 14px;
}
.charity .ch-hero__note i { color: var(--ch-orange); }
.charity .ch-hero__media { display: flex; justify-content: center; }
.charity .ch-hero__media img {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

/* Принципы */
.charity .ch-principles { padding: 0 0 20px; background: var(--ch-grey); }
.charity .ch-principles__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.charity .ch-principle {
    display: flex;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    background: #fff;
}
.charity .ch-principle__title { margin-bottom: 4px; font-size: 17px; font-weight: 700; line-height: 1.3; }
.charity .ch-principle p { color: var(--ch-muted); font-size: 14px; }

/* Секции */
.charity .ch-section { padding: 80px 0; }
.charity .ch-section--grey { background: var(--ch-grey); }
.charity .ch-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 40px;
    margin-bottom: 30px;
}
.charity .ch-section__head .ch-h2 { margin-bottom: 0; }
.charity .ch-section__aside { max-width: 460px; font-size: 14px; }

/* Об инициативе */
.charity .ch-about {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 48px;
    align-items: start;
}
.charity .ch-about__text p { color: var(--ch-ink-2); }
.charity .ch-about__text .ch-muted { color: var(--ch-muted); font-size: 14px; }
.charity .ch-team .ch-h3 { font-size: 16px; color: var(--ch-muted); font-weight: 600; }
.charity .ch-team__list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.charity .ch-person {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    background: #fff;
}
.charity .ch-person__photo {
    display: block;
    flex: 0 0 auto;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--ch-grey);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--ch-line);
    object-fit: cover;
}
.charity .ch-person__name { font-size: 17px; font-weight: 700; }
.charity .ch-person__role { margin-top: 2px !important; color: var(--ch-orange-text); font-size: 13px; font-weight: 600; }
.charity .ch-person__text { margin: 10px 0 12px !important; color: var(--ch-muted); font-size: 14px; }

/* Карточки направлений */
.charity .ch-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; }
.charity .ch-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 32px;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    background: #fff;
}
.charity .ch-card .ch-icon { margin-bottom: 12px; }
.charity .ch-card p { margin-bottom: 18px; color: var(--ch-ink-2); }
.charity .ch-card .ch-link { margin-top: auto; }
.charity .ch-card--accent { background: var(--ch-ink); border-color: var(--ch-ink); }
.charity .ch-card--accent .ch-h3,
.charity .ch-card--accent p,
.charity .ch-card--accent .ch-link { color: #fff; }
.charity .ch-card--accent p { color: #D5D6DC; }
.charity .ch-card--accent .ch-link i { color: var(--ch-orange); }
.charity .ch-card--accent .ch-icon { background: rgba(255, 98, 10, .16); }

/* Слайдер */
.charity .ch-slider { border-radius: var(--ch-radius); }
.charity .ch-slider__viewport { overflow: hidden; border-radius: var(--ch-radius); }
.charity .ch-slider__track {
    display: flex;
    transition: transform .4s ease;
    touch-action: pan-y;
}
.charity .ch-slide {
    display: grid;
    flex: 0 0 100%;
    grid-template-columns: 1.4fr 1fr;
    min-width: 0;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    overflow: hidden;
    background: #fff;
}
.charity .ch-slide__photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 360px;
    background:
        repeating-linear-gradient(135deg, transparent 0 14px, rgba(31, 32, 38, .035) 14px 15px),
        var(--ch-grey);
    color: #9A9CA5;
    font-size: 14px;
    font-weight: 600;
}
.charity .ch-slide__photo i { font-size: 42px; }
.charity .ch-slide__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    padding: 36px;
}
.charity .ch-slide__photo img { width: 100%; height: 100%; object-fit: cover; }
.charity .ch-slide__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ch-orange-text);
    font-size: 14px;
    font-weight: 600;
}
.charity .ch-slide__title { color: var(--ch-ink); font-size: 24px; font-weight: 800; line-height: 1.25; }
.charity .ch-slide__text { margin-top: 0 !important; color: var(--ch-ink-2); font-size: 16px; line-height: 1.6; }
.charity .ch-slider__controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}
.charity .ch-slider__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    border: 1px solid var(--ch-line);
    border-radius: 50%;
    background: #fff;
    color: var(--ch-ink);
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.charity .ch-slider__arrow:hover { border-color: var(--ch-orange); color: var(--ch-orange-text); }
.charity .ch-slider__dots { display: flex; gap: 4px; }
.charity .ch-slider__dot {
    width: 28px; height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.charity .ch-slider__dot::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #C9CAD1;
    transform: translate(-50%, -50%);
    transition: width .2s, background-color .2s;
}
.charity .ch-slider__dot[aria-current="true"]::before { width: 22px; border-radius: 6px; background: var(--ch-orange); }
.charity .ch-slider__counter { margin-left: auto !important; color: var(--ch-muted); font-size: 14px; font-weight: 600; }

/* Шаги */
.charity .ch-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 10px;
    counter-reset: none;
}
.charity .ch-step {
    padding: 26px 24px;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    background: #fff;
}
.charity .ch-step__num {
    display: block;
    margin-bottom: 18px;
    color: var(--ch-orange);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}
.charity .ch-step__title { margin-bottom: 6px; font-size: 17px; font-weight: 700; }
.charity .ch-step p { color: var(--ch-muted); font-size: 14px; }

/* Форма */
.charity .ch-apply {
    display: grid;
    grid-template-columns: 1fr minmax(0, 560px);
    gap: 64px;
    align-items: start;
}
.charity .ch-apply__intro { position: sticky; top: calc(var(--ch-nav-top) + 30px); }
.charity .ch-apply__intro > p:not(.ch-eyebrow) { color: var(--ch-ink-2); font-size: 17px; }
.charity .ch-checklist { margin-top: 24px; }
.charity .ch-checklist li {
    position: relative;
    padding: 8px 0 8px 30px;
    border-top: 1px solid var(--ch-line);
    color: var(--ch-ink-2);
    font-size: 15px;
}
.charity .ch-checklist li::before {
    content: "\f00c";
    position: absolute;
    left: 2px; top: 9px;
    color: var(--ch-orange);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
}
.charity .ch-apply__form {
    padding: 26px 28px;
    border: 1px solid var(--ch-line);
    border-radius: var(--ch-radius);
    background: #fff;
    box-shadow: 0 20px 50px -30px rgba(31, 32, 38, .25);
}
.charity .ch-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.charity .ch-field { position: relative; margin-bottom: 12px; }
.charity .ch-field label,
.charity .ch-fieldset legend {
    display: block;
    margin-bottom: 4px;
    color: var(--ch-ink);
    font-size: 13px;
    font-weight: 600;
}
/* Глобальные стили форм сайта раскладывают label столбиком — возвращаем строчную разметку */
.charity .ch-field label,
.charity .ch-check label { display: block !important; }
.charity .ch-req { display: inline !important; margin: 0 !important; color: var(--ch-orange-text); }
.charity .ch-field input,
.charity .ch-field textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #CFD0D6;
    border-radius: var(--ch-radius-sm);
    background: #fff;
    color: var(--ch-ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}
.charity .ch-field textarea { resize: vertical; min-height: 72px; }
.charity #ch-need { min-height: 58px; }
.charity .ch-field input::placeholder,
.charity .ch-field textarea::placeholder { color: #9A9CA5; opacity: 1; }
.charity .ch-field input:hover,
.charity .ch-field textarea:hover { border-color: #A9AAB3; }
.charity .ch-field input:focus,
.charity .ch-field textarea:focus {
    border-color: var(--ch-ink);
    box-shadow: 0 0 0 3px rgba(255, 98, 10, .25);
    outline: none;
}
.charity .ch-field [aria-invalid="true"] { border-color: var(--ch-error); }
.charity .ch-field__hint { margin-top: 3px !important; color: var(--ch-muted); font-size: 12px; line-height: 1.4; }
/* Счётчик символов — справа в строке подписи поля, без отдельной строки */
.charity .ch-field__count { position: absolute; top: 0; right: 0; margin: 0 !important; line-height: 19px; }
.charity .ch-legend-note { color: var(--ch-muted); font-size: 12px; font-weight: 400; }
.charity .ch-fieldset legend { margin-bottom: 8px; }
.charity .ch-field__error {
    margin-top: 4px !important;
    color: var(--ch-error);
    font-size: 13px;
    font-weight: 600;
}
.charity .ch-field__error::before {
    content: "\f06a";
    margin-right: 6px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.charity .ch-fieldset {
    margin: 0 0 6px;
    padding: 0;
    border: 0;
    min-width: 0;
}
.charity .ch-fieldset > .ch-field__error { margin: -4px 0 10px !important; }
.charity .ch-warning {
    display: flex;
    gap: 10px;
    margin: 0 0 12px !important;
    padding: 9px 12px;
    border-radius: var(--ch-radius-sm);
    background: var(--ch-grey);
    color: var(--ch-ink-2);
    font-size: 13px;
    line-height: 1.45;
}
.charity .ch-warning i { margin-top: 2px; color: var(--ch-muted); }

.charity .ch-check {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 10px;
    margin-bottom: 8px;
}
.charity .ch-check input {
    width: 20px; height: 20px;
    margin: 1px 0 0;
    accent-color: var(--ch-orange);
    cursor: pointer;
}
.charity .ch-check label { font-size: 12px; line-height: 1.45; color: var(--ch-muted); cursor: pointer; }
.charity .ch-check .ch-field__hint,
.charity .ch-check .ch-field__error { grid-column: 2; }
.charity .ch-check .ch-field__hint a { color: var(--ch-ink); text-decoration: underline; }
.charity .ch-check [aria-invalid="true"] { outline: 2px solid var(--ch-error); outline-offset: 2px; }

.charity .ch-form__submit { width: 100%; min-height: 50px; margin-top: 8px; }
.charity .ch-form__status:not(:empty) {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--ch-radius-sm);
    font-size: 14px;
}
.charity .ch-form__status.is-error { background: #FDECEA; color: var(--ch-error); }
.charity .ch-form__status.is-ok { background: #E9F5EE; color: var(--ch-ok); }

/* FAQ */
.charity .ch-center { text-align: center; }
.charity .ch-faq { max-width: 900px; margin: 10px auto 0; border-top: 1px solid var(--ch-line); }
.charity .ch-faq__item { border-bottom: 1px solid var(--ch-line); }
.charity .ch-faq__item summary {
    position: relative;
    padding: 20px 48px 20px 0;
    color: var(--ch-ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    list-style: none;
    cursor: pointer;
}
.charity .ch-faq__item summary::-webkit-details-marker { display: none; }
.charity .ch-faq__item summary::after {
    content: "\2b";
    position: absolute;
    right: 0; top: 50%;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--ch-line);
    color: var(--ch-orange);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
    line-height: 30px;
    text-align: center;
    transform: translateY(-50%);
    transition: transform .2s;
}
.charity .ch-faq__item[open] summary::after { content: "\f068"; }
.charity .ch-faq__item summary:hover { color: var(--ch-orange-text); }
.charity .ch-faq__body { padding: 0 48px 22px 0; color: var(--ch-ink-2); }

/* Завершение */
.charity .ch-final { padding: 80px 0; }
.charity .ch-final__box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 48px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 1.5px) 0 0 / 22px 22px,
        var(--ch-ink);
}
.charity .ch-final__box .ch-h2 { max-width: 620px; margin: 0; color: #fff; }

/* Планшет */
@media (max-width: 1249px) {
    .charity .ch-hero__title { font-size: 46px; }
    .charity .ch-about { grid-template-columns: 1fr; gap: 32px; }
    .charity .ch-steps { grid-template-columns: repeat(2, 1fr); }
    .charity .ch-apply { grid-template-columns: 1fr; gap: 28px; }
    .charity .ch-apply__intro { position: static; }
    .charity .ch-apply__form { max-width: 640px; }
}

@media (max-width: 991px) {
    .charity .ch-hero__grid { grid-template-columns: 1fr; gap: 10px; }
    .charity .ch-hero__media { order: 2; }
    .charity .ch-hero__media img { max-width: 340px; }
    .charity .ch-principles__list { grid-template-columns: 1fr; }
    .charity .ch-cards { grid-template-columns: 1fr; }
    .charity .ch-slide { grid-template-columns: 1fr; }
    .charity .ch-slide__photo { min-height: 240px; }
}

/* Телефон */
@media (max-width: 767px) {
    .charity { font-size: 15px; }
    .charity .ch-hero { padding-bottom: 30px; }
    .charity .ch-hero__title { font-size: 36px; }
    .charity .ch-hero__lead { font-size: 19px; }
    .charity .ch-hero__desc { font-size: 16px; }
    .charity .ch-hero__actions .ch-btn { width: 100%; }
    .charity .ch-hero__media img { max-width: 280px; }

    .charity .ch-section, .charity .ch-final { padding: 56px 0; }
    .charity .ch-h2 { font-size: 27px; }
    .charity .ch-team__list { grid-template-columns: 1fr; }
    .charity .ch-person { flex-direction: row; align-items: flex-start; }
    .charity .ch-person__photo { width: 64px; height: 64px; }
    .charity .ch-card { padding: 24px; }
    .charity .ch-slide__body { padding: 24px; }
    .charity .ch-slide__title { font-size: 20px; }
    .charity .ch-slide__text { font-size: 15px; }
    .charity .ch-steps { grid-template-columns: 1fr; }
    .charity .ch-apply__form { padding: 18px 14px; border-radius: 16px; }
    /* 16px в полях на телефоне — иначе iOS увеличивает страницу при фокусе */
    .charity .ch-field input, .charity .ch-field textarea { font-size: 16px; }
    .charity .ch-form__row { grid-template-columns: 1fr; }
    .charity .ch-final__box { padding: 32px 22px; }
    .charity .ch-final__box .ch-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .charity *, .charity *::before, .charity *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
