.ac-card {
    display: flex;
    flex-direction: column;
    width: 530px;
    max-width: 100%;
    padding: 40px;
    margin-bottom: 50px;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1a;
    font-family: "F5ka Sans Design", sans-serif;
}

.ac-title {
    margin: 0;
    color: #000;
    font-size: 36px;
    font-weight: 950;
    line-height: 1.15;
}

.ac-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 8px;
    color: #808080;
    font-size: 14px;
    line-height: 1.3;
}

.ac-link {
    color: #00923A;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ac-link:hover,
.ac-link:focus-visible {
    color: #007A30;
    text-decoration: underline;
}

/* ---------- Вкладки «Зарегистрироваться / Войти» ---------- */

.ac-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 24px;
    padding: 4px;
    border-radius: 10px;
    background: #F2F2F2;
}

.ac-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    padding: 8px 14px;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #1a1a1a;
    text-decoration: none;
    transition: background-color .2s, border-color .2s;
}

.ac-tab:hover {
    background: #E8E8E8;
    color: #1a1a1a;
    text-decoration: none;
}

.ac-tab__hint {
    color: #808080;
    font-size: 14px;
    line-height: 1.3;
}

.ac-tab__label {
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.ac-tab.is-active {
    border-color: #048D39;
    background: #E3F5E8;
    cursor: default;
}

.ac-tab.is-active .ac-tab__hint {
    color: #048D39;
}

/* ---------- Поля ---------- */

.ac-form,
#register-form.ac-form {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.ac-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

/* Регистрация: подпись слева от поля */
.ac-field--inline {
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: start;
    column-gap: 12px;
}

.ac-field--inline .ac-label {
    margin: 0;
    padding-top: 14px;
}

/* Вход: подпись над полем */
.ac-field--stacked .ac-label {
    margin-bottom: 8px;
}

.ac-label {
    display: block;
    color: #000;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.ac-control {
    position: relative;
    min-width: 0;
}

.ac-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #C4C4C4;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 16px;
    transition: border-color .2s;
}

.ac-input:focus {
    border-color: #048D39;
    outline: none;
}

.ac-input.is-invalid {
    border-color: #E52322;
}

.ac-card .invalid-feedback {
    display: block;
    position: static;
    margin-top: 4px;
    color: #E52322;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.ac-hint {
    margin: 6px 0 0;
    color: #808080;
    font-size: 12px;
    line-height: 1.4;
}

/* Пароль с кнопкой «показать» */
.ac-password .ac-input {
    padding-right: 48px;
}

.ac-password__toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
}

.ac-password__toggle .ac-eye-open { display: none; }
.ac-password__toggle.is-visible .ac-eye-open { display: block; }
.ac-password__toggle.is-visible .ac-eye-closed { display: none; }

.ac-forgot {
    align-self: flex-start;
    margin-top: 16px;
    font-size: 14px;
}

.ac-agreement {
    margin-top: 20px;
    color: #808080;
    font-size: 12px;
    line-height: 1.4;
}

.ac-agreement a {
    color: #00923A;
    text-decoration: underline;
}

/* ---------- Кнопки ---------- */

.ac-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 20px;
    padding: 0 24px;
    border: 0;
    border-radius: 24px;
    background: #048D39;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color .2s;
}

.ac-btn:hover,
.ac-btn:focus-visible {
    background: #037A31;
    color: #fff;
}

.ac-btn:disabled {
    opacity: .6;
    cursor: default;
}

.ac-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    color: #808080;
    font-size: 14px;
    white-space: nowrap;
}

.ac-divider::before,
.ac-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #D9D9D9;
}

.ac-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.ac-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 12px;
    transition: opacity .2s;
}

.ac-social__btn:hover,
.ac-social__btn:focus-visible {
    opacity: .9;
}

.ac-social__btn--vk { background: #0077FF; }
.ac-social__btn--ya { background: #333333; }

.ac-social__btn svg {
    width: 28px;
    height: 28px;
}

.ac-alert {
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    background: #FEE2E2;
    color: #991B1B;
    font-size: 14px;
}

/* ---------- Главная: выбор роли ---------- */

/* На главной карточка по центру экрана по вертикали */
.form-usage-container:has(.ac-card--centered) {
    flex: 1;
}

.ac-card--centered {
    margin-top: auto;
    margin-bottom: auto;
}

.ac-roles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 32px;
}

.ac-role {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 56px;
    padding: 10px 16px;
    border: 1px solid #333333;
    border-radius: 10px;
    background: #fff;
    color: #333333;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

.ac-role:hover,
.ac-role:focus-visible {
    border-color: #048D39;
    background: #E3F5E8;
    color: #1a1a1a;
    text-decoration: none;
}

.ac-role__title {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
}

.ac-role__hint {
    color: #808080;
    font-size: 13px;
    line-height: 1.3;
}

/* ---------- Мобильная версия ---------- */

.ac-only-mobile { display: none; }

@media (max-width: 576px) {
    .ac-only-mobile { display: inline; }
    .ac-only-desktop { display: none; }

    .ac-card {
        width: 100%;
        padding: 24px 16px;
    }

    .ac-title {
        font-size: 30px;
    }

    .ac-subtitle {
        gap: 4px 8px;
        font-size: 13px;
    }

    .ac-tab {
        padding: 8px 10px;
    }

    .ac-tab__hint,
    .ac-tab__label {
        font-size: 13px;
    }

    .ac-field--inline {
        grid-template-columns: 84px 1fr;
        column-gap: 8px;
    }

    .ac-label {
        font-size: 14px;
    }

    .ac-role {
        min-height: 64px;
    }

    .ac-role__title {
        font-size: 15px;
    }

    .ac-role__hint {
        font-size: 13px;
    }
}
