/* Обертка на весь экран */
.role-selector-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none; /* Пропускаем клики, если закрыто */
    display: flex;
    justify-content: center;
}

.role-selector-wrapper .container {
    max-width: 100%;
}

/* Затемнение фона */
.role-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* Черный 50% */
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0; /* Самый нижний слой внутри wrapper */
}

/* Когда открыто - фон виден и ловит клики */
.role-selector-wrapper.is-open .role-overlay {
    opacity: 1;
    pointer-events: auto;
}

.role-selector-inner {
    position: relative;
    width: 100%;
    margin-top: 110px;
    pointer-events: none;
}

.role-robot-icon {
    position: fixed;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.3s ease;
    z-index: 10003;
}

.role-robot-icon:hover {
    transform: scale(1.1);
}

.role-selector-wrapper.is-open .role-robot-icon {
    display: none;
}

.role-bubble {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);

    width: 90%;
    max-width: 582px;
    background: var(--bg-septennary, #0f172a);
    border: 1px solid #2FBED2;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);

    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10002;
    box-sizing: border-box;
}

.role-selector-wrapper.is-open .role-bubble {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.role-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    background: var(--bg-trevigintennary);
    border-radius: 8px 8px 0 0;
    position: relative;
    padding: var(--space-xs) var(--space-md);
}

.role-bubble-title {
    color: var(--text-primary);
    position: absolute;
    justify-self: anchor-center;

    font-weight: 600;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    letter-spacing: 0;
    text-align: center;
}

.role-bubble-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-left: auto;
}

.role-bubble-close:hover {
    opacity: 1;
}

.role-selection {
    display: flex;
    gap: 39px;
    justify-content: space-around;
    padding: var(--space-lg);
}

.role-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.role-selection input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 16px;
    height: 16px;
    min-width: 16px;

    border: 1px solid #2FBED2;
    border-radius: 50%;
    background-color: transparent;

    margin: 0;
    cursor: pointer;
    position: relative;

    margin-top: 4px;
    transition: all 0.2s ease;

    opacity: 1;
}

.role-selection input[type="radio"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #2FBED2;

    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease-in-out;
}

.role-selection input[type="radio"]:checked::after {
    transform: translate(-50%, -50%) scale(1);
}

.role-wrapper {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.role-title {
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: var(--text-primary);
}

.role-subtitle {
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: var(--text-secondary);
}

.role-option input:checked + .role-wrapper {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.role-option:hover .role-wrapper {
    border-color: transparent;
}

@media (max-width: 768px) {
    .role-selector-inner{
        margin-top: 65px;
    }
    .role-robot-icon {
        width: 35px;
        height: 35px;
        top: 58px;
    }
    .role-robot-icon svg{
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 600px) {

    .role-bubble{
        width: 56%;
    }
    .role-bubble-header{
        margin-bottom: 0;
    }
    .role-selection {
        flex-direction: column;
        gap: 20px;
        padding: var(--space-lg) var(--space-xl);
    }

}

@media (max-width: 500px)  {
    .role-robot-icon {
        width: 25px;
        height: 25px;
    }
    .role-robot-icon svg{
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 430px) {
    .role-bubble{
        width: 70%;
    }
}