:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #ff2e63;
    --background-color: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --primary-light: rgba(106, 17, 203, 0.15);
    --primary-medium: rgba(106, 17, 203, 0.25);
    --primary-dark: rgba(106, 17, 203, 0.9);
    --accent-light: rgba(255, 46, 99, 0.15);
    --text-color: #ffffff;
    --border-light: rgba(255, 255, 255, 0.3);
    --border-medium: rgba(255, 255, 255, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --background-dark: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 600px;
    width: 100%;
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px 20px;
    box-shadow: 0 8px 32px var(--shadow-color);
    border: 1px solid var(--border-light);
    margin: 20px 0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.greeting {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px var(--shadow-color);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--text-color);
    margin: 0 auto 15px;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-letter {
    font-weight: bold;
    font-size: 2.5rem;
}

.user-name {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: bold;
}

.username {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-top: 25px;
    padding: 0 15px;
}

.heart {
    color: var(--accent-color);
    display: inline-block;
}

.desktop-warning {
    background: var(--background-dark);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    max-width: 500px;
}

.form-container {
    text-align: left;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1.1rem;
}

.form-label.required::after {
    content: " *";
    color: var(--accent-color);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 16px;
    border: 2px solid var(--border-light);
    background: var(--primary-light);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-medium);
    background: var(--primary-medium);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    color: var(--accent-color);
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    padding: 8px 12px;
    background: var(--accent-light);
    border-radius: 8px;
}

.services-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 5px;
}

.service-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.service-checkbox:hover {
    background: rgba(255, 255, 255, 0.2);
}

.service-checkbox input {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 30px 15px;
    }

    .greeting {
        font-size: 2rem;
    }

    .user-name {
        font-size: 1.5rem;
    }

    .username {
        font-size: 1rem;
    }

    .welcome-text {
        font-size: 1.2rem;
    }

    .services-container {
        grid-template-columns: 1fr;
    }

    /* Объединенные стили для .role-page */
    .role-page .greeting-text {
        font-size: 1.5rem;
    }

    .role-page .user-name {
        font-size: 1.3rem;
    }

    .role-page .avatar {
        width: 80px;
        height: 80px;
    }

    .role-page .avatar-letter {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .greeting {
        font-size: 1.8rem;
    }

    .avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .user-name {
        font-size: 1.3rem;
    }

    .welcome-text {
        font-size: 1.1rem;
    }

    .form-container {
        padding: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 15px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: var(--text-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.theme-blue {
    --primary-color: #1a73e8;
    --secondary-color: #4285f4;
}

.theme-green {
    --primary-color: #0f9d58;
    --secondary-color: #34a853;
}

.theme-purple {
    --primary-color: #8e24aa;
    --secondary-color: #ab47bc;
}

.theme-red {
    --primary-color: #d93025;
    --secondary-color: #ea4335;
}

.theme-orange {
    --primary-color: #f57c00;
    --secondary-color: #fb8c00;
}

.theme-beige {
    --primary-color: #654321;
    --secondary-color: #FFF44F;
    background-image: url(/webapp/css/icons/marble_back.jpg);
}

.photo-upload-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.photo-upload {
    flex: 1;
    text-align: center;
}

.photo-preview {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.complete-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: var(--text-color);
    text-align: center;
    border-radius: 12px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.complete-btn:disabled {
    background: rgba(255, 46, 99, 0.5);
    cursor: not-allowed;
}

.complete-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Унифицированные стили для кнопки смены роли */
.btn-change-role {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 15px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-change-role:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.role-icon-small {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Стили для мраморной темы */
.theme-beige .btn-change-role {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-beige .btn-change-role:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Унифицированные стили для карточек ролей */
.role-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.role-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.role-icon img {
    max-width: 10%;
    max-height: 10%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.role-card:hover .role-icon img {
    transform: scale(1.1);
}

/* Унифицированные стили для страницы выбора роли */
.role-page .user-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.role-page .greeting-text {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.role-page .user-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 15px;
}

.role-page .avatar {
    background: rgba(255, 255, 255, 0.2);
}

.role-page .avatar-letter {
    font-size: 3rem;
}

/* Стили для аватара бота */
.bot-avatar-container {
    position: relative;
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
}

.bot-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0088cc;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid white;
    overflow: hidden;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Стили для иконок ролей */
.role-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.role-card:hover .role-icon img {
    transform: scale(1.1);
}

/* Остальные стили */
.header-container {
    text-align: center;
    margin-bottom: 30px;
}

.bitrix-section {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    transition: all 0.3s;
    margin: 5px;
    border: none;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-about {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.btn-icon {
    margin-right: 8px;
}