/*
 * Окно «Записаться на пробное занятие» (#modal_proba, theme/footer.php).
 * Тёмное узкое окно в цветах сайта: чёрный, белый и фирменный красный #ff0000.
 * Наклонные красные и белые линии выходят за границы окна, поэтому у окна
 * нет обрезки (overflow), а фон вынесен в отдельный слой .tp-bg.
 */

/* Лёгкое размытие и затемнение страницы под окном (поверх обычной подложки Bootstrap). */
#modal_proba {
    background: rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#modal_proba .tp-dialog {
    max-width: 540px;
}

#modal_proba .tp {
    position: relative;
    z-index: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
}

/* ---------- Фон окна ---------- */

#modal_proba .tp-bg {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(150deg, #1d1d1d 0%, #0a0a0a 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

/* Красный угол с белой линией — под кнопкой закрытия */
#modal_proba .tp-bg::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: linear-gradient(to bottom left, #ff0000 0, #ff0000 36%, transparent 36%, transparent 40%, #ffffff 40%, #ffffff 41.5%, transparent 41.5%);
}

/* Тонкая диагональная штриховка в нижнем левом углу */
#modal_proba .tp-bg::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70%;
    height: 60%;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0.05) 2px, transparent 2px, transparent 14px);
    -webkit-mask-image: linear-gradient(to top right, #000000 0, transparent 55%);
    mask-image: linear-gradient(to top right, #000000 0, transparent 55%);
}

/* ---------- Линии, выходящие за границы окна ---------- */

#modal_proba .tp-line {
    position: absolute;
    z-index: -1; /* уходят под окно: видны только выступающие концы */
    width: 340px;
    transform: rotate(45deg);
    pointer-events: none;
}

/* нижний левый угол */
#modal_proba .tp-line-1 { left: -140px; bottom: 26px; height: 16px; background: #ff0000; }
#modal_proba .tp-line-2 { left: -112px; bottom: 60px; height: 4px; background: #ffffff; }
#modal_proba .tp-line-3 { left: -190px; bottom: -18px; height: 3px; background: #ff0000; width: 300px; }

/* верхний правый угол */
#modal_proba .tp-line-4 { right: -146px; top: 28px; height: 10px; background: #ffffff; }
#modal_proba .tp-line-5 { right: -196px; top: -16px; height: 3px; background: #ff0000; width: 300px; }

/* ---------- Кнопка закрытия ---------- */

#modal_proba .tp-close {
    position: absolute;
    top: 4px;
    right: 6px;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 30px;
    line-height: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#modal_proba .tp-close:hover,
#modal_proba .tp-close:focus {
    outline: none;
    transform: rotate(90deg);
}

/* ---------- Содержимое ---------- */

#modal_proba .tp-body {
    position: relative;
    z-index: 2;
    padding: 46px 44px 44px;
}

/* Красная плашка с филиалом выступает за левый край окна */
#modal_proba .tp-tag {
    display: inline-block;
    max-width: calc(100% - 40px);
    margin-left: -60px;
    padding: 8px 30px 8px 30px;
    background: #ff0000;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: "Montserrat", sans-serif;
    -webkit-clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}

#modal_proba .tp-title {
    margin: 24px 0 12px;
    color: #ffffff;
    font-size: 36px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-family: "Montserrat", sans-serif;
}

#modal_proba .tp-title small {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.22em;
}

#modal_proba .tp-title b {
    color: #ff0000;
    font-weight: 800;
}

#modal_proba .tp-sub {
    margin: 0 0 26px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    font-family: "Roboto", sans-serif;
}

/* ---------- Форма ---------- */

#modal_proba .tp-form {
    display: block;
    margin: 0;
}

#modal_proba .tp-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 56px;
    margin: 0 0 14px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 3px solid #ff0000;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    color: #ffffff;
    font-size: 16px;
    line-height: 54px;
    font-family: "Roboto", sans-serif;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

#modal_proba .tp-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#modal_proba .tp-input:focus {
    outline: none;
    border-color: #ff0000;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Поля, заполненные автоподстановкой браузера, остаются тёмными */
#modal_proba .tp-input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 100px #1c1c1c inset;
    caret-color: #ffffff;
}

#modal_proba select.tp-input {
    cursor: pointer;
}

#modal_proba select.tp-input option {
    color: #222222;
    background: #ffffff;
}

#modal_proba .tp-consent {
    display: flex;
    align-items: flex-start;
    margin: 6px 0 24px;
    cursor: pointer;
}

#modal_proba .tp-consent input {
    flex: 0 0 22px;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    top: 1px;
    width: 22px;
    height: 22px;
    margin: 0 14px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

#modal_proba .tp-consent input:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

#modal_proba .tp-consent input:checked {
    border-color: #ff0000;
    background: #ff0000;
}

#modal_proba .tp-consent input:checked::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 6px;
    height: 12px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
}

#modal_proba .tp-consent span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.6;
    font-family: "Roboto", sans-serif;
}

#modal_proba .tp-consent a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: #ff0000;
    text-underline-offset: 3px;
}

#modal_proba .tp-consent a:hover {
    color: #ff0000;
}

/* Кнопка-параллелограмм */
#modal_proba .tp-submit {
    display: block;
    width: 100%;
    min-height: 58px;
    padding: 14px 30px;
    border: 0;
    border-radius: 0;
    background: #ff0000;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: "Montserrat", sans-serif;
    cursor: pointer;
    -webkit-clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#modal_proba .tp-submit:hover:not(:disabled),
#modal_proba .tp-submit:focus:not(:disabled) {
    outline: none;
    background: #ffffff;
    color: #111111;
}

#modal_proba .tp-submit:disabled {
    background: #2f2f2f;
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

/* ---------- Ответ сервера: «заявка принята», «проверьте данные», загрузка ---------- */

#modal_proba #result_proba > center {
    display: block;
    padding: 50px 0;
}

#modal_proba .modal_h {
    margin: 24px 0 14px;
    color: #ffffff;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
    font-family: "Montserrat", sans-serif;
}

#modal_proba .modal_text,
#modal_proba #result_proba > p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    line-height: 1.6;
    font-family: "Roboto", sans-serif;
}

#modal_proba .form-retry-box {
    text-align: left !important;
}

#modal_proba .form-retry-box .btn-style-two {
    background-color: #ff0000 !important;
    cursor: pointer;
}

#modal_proba .form-retry-box .btn-style-two::before,
#modal_proba .form-retry-box .btn-style-two::after {
    border-bottom-color: #111111;
}

/* ---------- Планшет и телефон ---------- */

@media only screen and (max-width: 575px) {
    #modal_proba .tp-dialog {
        max-width: none;
        margin: 26px 14px;
    }

    #modal_proba .tp-body {
        padding: 38px 22px 30px;
    }

    #modal_proba .tp-tag {
        margin-left: -30px;
        padding: 7px 24px 7px 22px;
        font-size: 11px;
    }

    #modal_proba .tp-title {
        margin-top: 20px;
        font-size: 28px;
    }

    #modal_proba .tp-title small {
        font-size: 13px;
    }

    #modal_proba .tp-sub {
        margin-bottom: 20px;
        font-size: 14px;
    }

    #modal_proba .tp-input {
        height: 52px;
        line-height: 50px;
        margin-bottom: 12px;
    }

    #modal_proba .tp-submit {
        min-height: 54px;
        padding: 12px 22px;
        font-size: 13px;
        letter-spacing: 0.12em;
    }

    #modal_proba .tp-bg::before {
        width: 120px;
        height: 120px;
    }

    /* Линии короче: выступают на ширину поля вокруг окна */
    #modal_proba .tp-line { width: 220px; }
    #modal_proba .tp-line-1 { left: -92px; bottom: 16px; height: 12px; }
    #modal_proba .tp-line-2 { left: -72px; bottom: 40px; height: 3px; }
    #modal_proba .tp-line-3 { left: -124px; bottom: -12px; width: 200px; }
    #modal_proba .tp-line-4 { right: -96px; top: 18px; height: 8px; }
    #modal_proba .tp-line-5 { right: -128px; top: -10px; width: 200px; }
}
