.profile {
    position: relative;
}

.profile__main,
.profile__awards-wrap {
    background-color: var(--neutral-surface);
    border-radius: var(--space-sm);
    max-width: 100vw;
    padding: 0;

    @media (width<=440px) {
        margin: 0;
    }

}

.profile__header {
    position: relative;
    height: 148px;
}

.profile__background {
    anchor-name: --profile-background;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--space-sm) var(--space-sm) 0 0;
}

.profile__avatar {
    position-anchor: --profile-background;
    position: absolute;
    width: 128px;
    aspect-ratio: 1;
    border-radius: 100%;
    border: 3px solid var(--neutral-surface);
    left: calc(anchor(left) + var(--space-sm));
    bottom: calc(anchor(bottom) - 40px)
}

.profile__user {
    margin-block-start: calc(40px + var(--space-sm));
    margin-block-end: var(--space-xs);
    margin-inline: var(--space-sm);
    position: relative;
}

.profile__nick-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-h1);
    font-weight: 400;
    padding-block-end: var(--space-xs);
}

.profile__nick {
    font-size: inherit;
    font-weight: inherit;
}

.profile__button {
    --profile-button-setting: 32px;
    height: var(--profile-button-setting);
    display: flex;
    align-items: center;
    position: absolute;
    bottom: calc(var(--profile-button-setting) + 8px);
    right: 0;
    background-color: var(--accent-default);
    border-radius: var(--space-xxs);
}

.profile__button-edit,
.profile__button-settings {
    height: 100%;
    display: flex;
    align-items: center;
    padding: var(--space-xxs) var(--space-sm);
    background-color: var(--accent-default);
    border-radius: var(--space-xxs);
    color: var(--neutral-surface);
    font-weight: 500;
    font-size: var(--font-size-sm);

    &:hover {
        background-color: var(--accent-hover);
    }
}

.profile__button-settings {
    anchor-name: --profile-settings-button;
    margin: 0;
    border-left: 1px solid var(--accent-hover);
    background-color: var(--accent-active);
    font-size: var(--font-size-h4);
    font-family: symbols !important;
    padding-inline: var(--space-xs);
    cursor: pointer;
}

.profile__settings {
    position-anchor: --profile-settings-button;
}

.user__label {
    font-family: symbols !important;
    font-size: var(--font-size-h3);
    color: var(--accent-default)
}

.profile__section {
    margin-inline: var(--space-sm);
    color: var(--text-secondary);
    padding-block: 0 var(--space-sm);

    &:not(:last-child) {
        border-bottom: 1px solid var(--neutral-border);
    }
}

.profile__user-about {
    color: var(--text-secondary);
    line-height: var(--line-height-base);
    margin-block-start: var(--space-xxs);
}

.profile__user-information {
    color: inherit
}

.profile__digitals {
    display: flex;
    align-items: center;
    margin-inline: var(--space-sm);
    padding-block: var(--space-sm);
    overflow-x: scroll;
    scrollbar-width: none;
}

.profile__digital {
    display: inline-block;
    align-items: center;

    &:not(:last-child) {
        margin-inline-end: var(--space-xl);
    }

    & b {
        font-size: var(--font-size-h3);
        font-weight: 500;
        display: block;
    }

    & span {
        color: var(--text-disabled);
        display: flex;
        align-items: center;
        gap: var(--space-xxs)
    }

    & a {
        font-family: symbols !important;
        font-size: inherit;
        color: var(--text-subtitle);
    }
}

.profile__awards-wrap {
    position: relative;
    margin-block: var(--space-lg);
}

.profile__awards-title {
    padding: var(--space-sm);
    padding-block-end: 0;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile__awards,
.user_awards_list {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
}

.user_awards_list {
    & li {
        width: 48px;
        aspect-ratio: 1;
        border: 1px solid var(--neutral-bg);
        border-radius: var(--space-xxs);
        display: flex;
        padding: var(--space-xs);
        align-items: center;
        justify-content: center;
        overflow: hidden;

        &:not(:last-child) {
            margin-inline-end: var(--space-sm);
        }

        & img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }
}

.blog-badge {
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--space-xxs) var(--space-xs);
    background-color: var(--badge-accent);
    color: var(--text-badge-accent);
    border-radius: var(--space-xxs);
    margin-block-end: var(--space-xxs);

    &:hover {
        background-color: var(--badge-accent-hover);
    }

    & b {
        font-size: inherit;
        color: inherit;
        margin-inline: var(--space-xxs);
    }
}

.--badge-red {
    background-color: var(--danger);
    color: var(--danger-text);

    &:hover {
        background-color: var(--danger-hover);
    }
}

/*** Registration ***/
.register {

    & [type="text"],
    & [type="number"],
    & [type="button"],
    & [type="password"],
    & textarea {
        padding: var(--space-xs);
        background-color: var(--neutral-surface);
        border: 1px solid var(--neutral-border);
        border-radius: var(--space-xs);
        resize: none;

        &::placeholder {
            color: var(--text-disabled)
        }
    }

    & br {
        display: none;
    }

}

.register__main {
    position: relative;
}

.register__section {
    display: grid;
    grid-template-columns: 20% 1fr;
    gap: var(--space-lg);
    align-items: baseline;
    margin-block-end: var(--space-sm);
    width: 100%;
    position: relative;

    & > label {
        font-weight: 400;
    }

    & > input {
        width: 100%;
    }
}

.register__section-block {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);

    & [type="text"],
    & [type="password"] {
        flex: 1 1 0;
    }

    & label {
        display: flex;
        align-items: center;
    }

    & [type="file"] {
        flex: 1 1 0;
        font-size: var(--font-size-sm);

        &::file-selector-button {
            padding: var(--space-xxs) var(--space-sm);
            background-color: var(--accent-default);
            color: var(--neutral-surface);
            border: none;
            border-radius: var(--space-xxs);
        }

        &::file-selector-button:hover {
            background-color: var(--accent-hover);
            cursor: pointer;
        }
    }

    & [type="checkbox"] {
        display: none;
    }

    & [type="checkbox"] + label {
        display: flex;
        align-items: start;
        flex: 1 1 0;
    }

    & label:has([type="checkbox"]):before,
    & [type="checkbox"] + label:before {
        content: '';
        width: var(--font-size-base);
        height: var(--font-size-base);
        aspect-ratio: 1;
        background-color: var(--neutral-surface);
        border: 1px solid var(--neutral-border);
        border-radius: var(--space-xxs);
        display: inline-flex;
        justify-content: center;
        align-items: center;
        margin-inline-end: var(--space-xs);
        flex: 0 1 0;
    }

    & label:has([type="checkbox"]:checked):before,
    & [type="checkbox"]:checked + label:before {
        content: '✔';
        background-color: var(--accent-default);
        color: var(--neutral-surface);
        font-size: 10px;
        line-height: 0;
    }
}

.register__submit {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--space-xxs);
    background-color: var(--accent-default);
    color: var(--neutral-surface);
    font-weight: 500;
    margin: 0 auto;
    display: block;
    position: sticky;
    bottom: var(--space-xs);
    cursor: pointer;

    &:hover {
        background-color: var(--accent-hover);
    }
}

.register__error {
    position: sticky;
    top: var(--space-xs);
    padding: var(--space-sm);
    background-color: var(--danger-transparent);
    backdrop-filter: blur(10px);
    border-radius: var(--space-xs);
    color: var(--danger-text);
    margin: var(--space-sm) 0;
    z-index: 2;

    & span {
        color: inherit
    }

    &:before {
        content: attr(data-error-title);
        display: block;
        font-weight: 700;
        font-size: var(--font-size-sm);
        margin-block-end: var(--space-xxs);
    }
}