.agency-page {
    --agency-accent: #333840;
    --agency-hover: #474c53;
    --agency-border: #d6d9de;
    padding: 145px 24px 80px;
    color: #333840;
    background: #fff;
    font-family: 'Vela Sans', Arial, sans-serif;
    letter-spacing: 0;
}

.kkvartal-page .agency-page {
    --agency-accent: #93201d;
    --agency-hover: #761917;
}

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

.agency-page__inner {
    max-width: 880px;
    margin: 0 auto;
}

.agency-page .agency-page__back {
    display: inline-block;
    margin-bottom: 24px;
    color: #656565;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    font-size: 14px;
}

.agency-page .agency-page__title {
    margin: 0 0 20px;
    font-size: 36px;
    line-height: 1.2;
    font-weight: 600;
    text-transform: none;
}

.agency-page .agency-page__intro {
    max-width: 720px;
    margin: 0 0 32px;
    color: #656565;
    font-size: 16px;
    line-height: 1.5;
}

.agency-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.agency-form__wide {
    grid-column: 1 / -1;
}

.agency-form__agency {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--agency-border);
}

.agency-form .form-group {
    min-width: 0;
    margin: 0;
}

.agency-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
}

.agency-form .form-control,
.agency-form .select2-container .select2-selection--single {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--agency-border);
    border-radius: 4px;
    color: #333840;
    background: #fff;
    box-shadow: none;
    font: inherit;
    font-size: 16px;
    line-height: 22px;
}

.agency-form textarea.form-control {
    height: auto;
    resize: vertical;
}

.agency-form .form-control:focus,
.agency-form .select2-container--focus .select2-selection--single {
    border-color: var(--agency-accent);
    outline: 2px solid var(--agency-accent);
    outline-offset: 2px;
}

.agency-form .select2-container .select2-selection__rendered {
    padding: 0 20px 0 0;
    color: inherit;
    line-height: 22px;
}

.agency-form .select2-container .select2-selection__arrow {
    top: 11px;
    right: 10px;
}

.agency-form .select2-container {
    max-width: 100%;
}

.agency-form .help-block {
    margin: 6px 0 0;
    color: #b02727;
    font-size: 14px;
}

.agency-form .help-block:empty {
    display: none;
}

.agency-form .has-error .form-control {
    border-color: #b02727;
}

.agency-page__notice,
.agency-page__errors {
    margin-bottom: 24px;
    padding: 14px 0;
    color: #93201d;
}

.agency-page__notice--success {
    color: #176b43;
}

.agency-page .agency-page__success {
    position: fixed;
    top: 112px;
    right: 24px;
    z-index: 1000;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
    width: min(420px, calc(100% - 48px));
    padding: 16px;
    border: 1px solid #bedfcf;
    border-left: 4px solid #176b43;
    border-radius: 8px;
    background: #f2faf5;
    box-shadow: 0 8px 32px rgba(24, 58, 41, .16);
    font-size: 16px;
    line-height: 1.5;
}

.agency-page__success > svg {
    width: 24px;
    height: 24px;
}

.agency-page .agency-page__success-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: #176b43;
    background: transparent;
    cursor: pointer;
    transition: background .2s;
}

.agency-page .agency-page__success-close:hover {
    background: #deeee4;
}

.agency-page .agency-page__success-close:focus-visible {
    outline: 2px solid #176b43;
    outline-offset: 2px;
}

.agency-page__success-close svg {
    width: 20px;
    height: 20px;
}

.agency-form .agency-form__submit {
    min-width: 180px;
    min-height: 48px;
    margin-top: 28px;
    padding: 12px 24px;
    border: 1px solid var(--agency-accent);
    border-radius: 4px;
    color: #fff;
    background: var(--agency-accent);
    cursor: pointer;
    font: inherit;
    transition: background .2s, border-color .2s;
}

.agency-form .agency-form__submit:hover {
    border-color: var(--agency-hover);
    background: var(--agency-hover);
}

.agency-form .agency-form__submit:disabled {
    cursor: wait;
    opacity: .65;
}

@media (max-width: 600px) {
    .agency-page { padding: 120px 20px 48px; }
    .agency-page .agency-page__title { font-size: 28px; }
    .agency-form__grid { grid-template-columns: minmax(0, 1fr); }
    .agency-form .agency-form__submit { width: 100%; }
    .agency-page .agency-page__success {
        top: 104px;
        right: 16px;
        width: calc(100% - 32px);
    }
}
