/* ==========================================================================
   Модальное окно «Обратный звонок» — стили страниц автоинструктора/автошколы
   ========================================================================== */

.apr-cb-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 14px 18px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    box-shadow: 0 10px 30px rgba(109, 40, 217, .38), 0 2px 6px rgba(0, 0, 0, .18);
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease, filter .22s ease;
    -webkit-tap-highlight-color: transparent;
}

.apr-cb-fab:hover {
    transform: translateY(-3px);
    filter: saturate(1.15);
    box-shadow: 0 16px 40px rgba(109, 40, 217, .48), 0 4px 10px rgba(0, 0, 0, .2);
    color: #fff;
}

.apr-cb-fab:active {
    transform: translateY(-1px) scale(.985);
}

.apr-cb-fab:focus-visible {
    outline: 3px solid rgba(139, 92, 246, .55);
    outline-offset: 3px;
}

.apr-cb-fab__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 13px;
}

.apr-cb-fab__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .55);
    animation: apr-cb-pulse 2.4s ease-out infinite;
}

@keyframes apr-cb-pulse {
    0% { transform: scale(1); opacity: .8; }
    70% { transform: scale(1.75); opacity: 0; }
    100% { transform: scale(1.75); opacity: 0; }
}

.apr-cb-fab__text {
    white-space: nowrap;
}

/* ---- Оверлей ---- */
.apr-cb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 12, 28, .62);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    backdrop-filter: blur(6px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s ease;
}

.apr-cb.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---- Карточка ---- */
.apr-cb__card {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px 28px 26px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
    box-shadow:
        0 30px 70px rgba(8, 12, 32, .45),
        0 2px 8px rgba(8, 12, 32, .12),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    transform: translateY(18px) scale(.97);
    opacity: 0;
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
}

.apr-cb.is-open .apr-cb__card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Декоративная подсветка сверху */
.apr-cb__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7 60%, #ec4899);
}

/* ---- Крестик закрытия ---- */
.apr-cb__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f2f7;
    color: #64748b;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.apr-cb__close:hover {
    background: #e7e9f2;
    color: #1a2332;
    transform: rotate(90deg);
}

.apr-cb__close:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .45);
    outline-offset: 2px;
}

.apr-cb__close::before,
.apr-cb__close::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.apr-cb__close::before { transform: rotate(45deg); }
.apr-cb__close::after { transform: rotate(-45deg); }

/* ---- Заголовок ---- */
.apr-cb__title {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #141b2d;
}

.apr-cb__subtitle {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.5;
    color: #6b7386;
}

/* ---- Форма ---- */
.apr-cb__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.apr-cb__field {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 14px;
    background: #f5f6fa;
    border: 1.5px solid transparent;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.apr-cb__field:focus-within {
    background: #fff;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .14);
}

.apr-cb__field > i {
    margin: 0 2px 0 14px;
    font-size: 14px;
    color: #a3aab9;
    transition: color .18s ease;
}

.apr-cb__field:focus-within > i {
    color: #8b5cf6;
}

.apr-cb__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 16px 14px 10px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: #141b2d;
    outline: none;
}

.apr-cb__input::placeholder {
    color: #a3aab9;
}

/* ---- Кнопка отправки ---- */
.apr-cb__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    padding: 15px 20px;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    box-shadow: 0 10px 24px rgba(109, 40, 217, .32);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
}

.apr-cb__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: saturate(1.12);
    box-shadow: 0 14px 30px rgba(109, 40, 217, .42);
}

.apr-cb__submit:active:not(:disabled) {
    transform: translateY(0) scale(.99);
}

.apr-cb__submit:disabled {
    opacity: .65;
    cursor: default;
}

.apr-cb__submit:focus-visible {
    outline: 3px solid rgba(139, 92, 246, .5);
    outline-offset: 3px;
}

.apr-cb__submit .apr-cb__spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: apr-cb-spin .7s linear infinite;
}

.apr-cb__submit.is-loading .apr-cb__spinner {
    display: block;
}

@keyframes apr-cb-spin {
    to { transform: rotate(360deg); }
}

/* ---- Сообщение ---- */
.apr-cb__msg {
    margin-top: 14px;
    min-height: 20px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    color: #141b2d;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .22s ease, transform .22s ease;
}

.apr-cb__msg.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.apr-cb__msg.is-success { color: #16a34a; }
.apr-cb__msg.is-error { color: #dc2626; }

.apr-cb__note {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: #a3aab9;
}

/* ---- Адаптив ---- */
@media (max-width: 560px) {
    .apr-cb {
        padding: 12px;
        align-items: flex-end;
    }

    .apr-cb__card {
        width: 100%;
        padding: 26px 20px 22px;
        border-radius: 22px;
        transform: translateY(24px) scale(1);
    }

    .apr-cb-fab {
        bottom: 16px;
        right: 16px;
        padding: 12px 18px 12px 14px;
        font-size: 14px;
    }

    .apr-cb__title { font-size: 19px; }
}

@media (max-height: 520px) {
    .apr-cb {
        align-items: center;
    }
}
