.component-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 16px;

    .form-field-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 16px;
    }

    .form-field-spacer {
        height: 16px;
    }

    .component-form-field {
        position: relative;
        width: 100%;

        &[data-has-error="true"] {
            .component-field-error-message {
                display: flex;

                :not([data-type]) {
                    display: inline-block;
                }

                [data-type="true"] {
                    display: inline-block;
                }
            }
        }

        &[data-has-error="server"] {
            .component-field-error-message {
                display: flex;

                :not([data-type="server"]) {
                    display: none;
                }
            }
        }

        &[data-has-error="browser"] {
            .component-field-error-message {
                display: flex;

                :not([data-type="browser"]) {
                    display: none;
                }
            }
        }
    }

    .component-floating-label-input {
        --letter-spacing: 0px;
        --font-weight: 500;
        --font-family: 'Roboto', sans-serif;

        &:has([type="tel"]) {
            --letter-spacing: 3px;
            --font-weight: 600;
            --font-family: 'Roboto Mono', monospace;
        }

        position: relative;
        width: 100%;

        input {
            width: 100%;
            height: 60px;
            padding: 22px 16px 6px 16px;
            font-size: 18px;
            font-weight: var(--font-weight);
            letter-spacing: var(--letter-spacing);
            color: #1a1a2e;
            background-color: #fff;
            border: 1px solid rgb(from var(--color-btm-dark-grey) r g b / 0.25);
            border-radius: 12px;
            outline: none;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
            font-family: var(--font-family), sans-serif;

            &:hover {
                border-color: var(--color-btm-orange);
            }

            &:focus {
                border-color: var(--color-general-purple);
                box-shadow: 0 0 0 4px rgb(from var(--color-general-purple) r g b / 0.15);
            }
        }

        label {
            position: absolute;
            left: 16px;
            top: 30px;
            transform: translateY(-50%);
            font-size: 18px;
            line-height: 1;
            pointer-events: none;
            transition: all 0.2s linear;
            font-family: 'Roboto', sans-serif;
            color: rgb(from var(--color-btm-dark-grey) r g b / 0.65);
        }

        input:focus ~ label,
        input:not(:placeholder-shown) ~ label {
            top: 14px;
            transform: translateY(-6px);
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--color-btm-dark-grey);
        }

        input:focus ~ label {
            color: var(--color-general-purple);
        }

        &[data-has-error="true"],
        &[data-has-error="server"],
        &[data-has-error="browser"] {
            input {
                border-color: #ef4444;
                background-color: #fef2f2;
            }

            input:focus {
                box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
            }

            label,
            input:focus ~ label {
                color: #dc2626;
            }

            .component-field-error-message {
                display: flex;
            }
        }

        &[data-has-error="true"] {
            .component-field-error-message {
                :not([data-type]) {
                    display: inline-block;
                }

                [data-type="true"] {
                    display: inline-block;
                }
            }
        }

        &[data-has-error="server"] {
            .component-field-error-message {
                :not([data-type="server"]) {
                    display: none;
                }
            }
        }

        &[data-has-error="browser"] {
            .component-field-error-message {
                :not([data-type="browser"]) {
                    display: none;
                }
            }
        }

        .mask-guide {
            position: absolute;
            z-index: 5;
            display: flex;
            flex-direction: row;
            align-items: start;
            justify-content: start;
            left: 16px;
            top: 28px;
            font-size: 18px;
            font-weight: var(--font-weight);
            letter-spacing: var(--letter-spacing);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease;
            font-family: var(--font-family), sans-serif;

            .mask-typed {
                font: inherit;
                visibility: hidden;
            }

            .mask-remaining {
                font: inherit;
                color: rgb(from var(--color-btm-dark-grey) r g b / 0.65);
            }
        }

        input:focus ~ .mask-guide,
        input:not(:placeholder-shown) ~ .mask-guide {
            opacity: 1;
        }
    }

    .component-field-error-message {
        display: none;
        align-items: center;
        gap: 6px;
        margin: 12px 0;
        font-size: 16px;
        font-weight: 500;
        line-height: 1;
        color: #dc2626;

        &:before {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            background-color: #dc2626;
            mask: url('/assets/svg/misc/warning-circle-46sQMjL.svg') no-repeat center center / contain;
        }
    }

    .component-field-info-message {
        display: flex;
        flex-direction: column;
        align-items: start;
        justify-content: start;
        gap: 6px;
        margin: 12px 0;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.325;
        color: rgb(from var(--color-btm-dark-grey) r g b / 0.65);
        font-family: 'Roboto', sans-serif;
    }

    .component-loading-button {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 56px;
        padding: 0;
        background-color: var(--color-general-purple);
        color: #fff;
        font-size: 18px;
        line-height: 1;
        font-weight: 500;
        border: none;
        border-radius: 56px;
        cursor: pointer;
        overflow: hidden;
        transition: all 0.2s linear;
        box-shadow: 0 0 4px 0 rgb(from var(--color-btm-dark-grey) r g b / 0.25);
        font-family: 'Roboto', sans-serif;

        &:hover {
            background-color: #2e2e2e;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        }

        &:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .button-text {
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .button-spinner {
            position: absolute;
            width: 20px;
            height: 20px;
            border: 2.5px solid rgba(255, 255, 255, 0.25);
            border-top-color: #ffffff;
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        &[data-is-loading="true"] {
            pointer-events: none;
            cursor: default;

            .button-text {
                opacity: 0;
                transform: scale(0.9);
            }

            .button-spinner {
                opacity: 1;
                animation: animation-component-form-loading-button 0.7s linear infinite;
            }
        }
    }

    .component-forgot-password-link {
        a {
            font-size: 16px;
            line-height: 1;
            font-weight: 600;
            text-decoration: none;
            transition: color 0.2s linear;
            color: var(--color-general-purple);
            font-family: 'IBM Plex Sans', sans-serif;

            &:hover {
                color: var(--color-btm-orange);
            }
        }
    }

    .component-field-header {
        display: flex;
        flex-direction: column;
        align-items: start;
        justify-content: start;
        gap: 8px;

        h3 {
            font-size: 18px;
            line-height: 1;
            font-weight: 600;
            color: var(--color-btm-dark-grey);
        }

        p {
            font-size: 16px;
            line-height: 1.325;
            color: rgb(from var(--color-btm-dark-grey) r g b / 0.75);
        }
    }

    .component-social-media-profiles {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 16px;
        margin-top: 24px;

        .social-icons {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: start;
            gap: 4px;
            margin-top: 8px;

            .social-icon {
                --image-url: none;

                &.icon-instagram { --image-url: url('/assets/svg/social-media/instagram-Wz6xtA7.svg'); }
                &.icon-tiktok { --image-url: url('/assets/svg/social-media/tiktok-Mo3ocsL.svg'); }
                &.icon-youtube { --image-url: url('/assets/svg/social-media/youtube-ou3VBO3.svg'); }
                &.icon-x { --image-url: url('/assets/svg/social-media/x-h2yhpr0.svg'); }
                &.icon-threads { --image-url: url('/assets/svg/social-media/threads-4oGrbKE.svg'); }
                &.icon-pinterest { --image-url: url('/assets/svg/social-media/pinterest-XcZTgSq.svg'); }

                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;
                width: 28px;
                height: 24px;
                border-radius: 6px;
                background-color: rgb(from var(--color-da-purple) r g b / 0.25);

                &:before {
                    content: '';
                    display: block;
                    width: 16px;
                    height: 16px;
                    background-repeat: no-repeat;
                    background-position: center center;
                    background-size: contain;
                    background-image: var(--image-url);
                }
            }
        }

        .items-list {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            gap: 16px;

            .social-item {
                --remove-display: none;

                display: flex;
                flex-direction: column;
                align-items: stretch;
                justify-content: start;

                &:has(+ .social-item) {
                    --remove-display: block;
                }

                &:last-child:not(:first-child) {
                    --remove-display: block;
                }

                .item-wrapper {
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    justify-content: center;
                    gap: 16px;

                    .component-floating-label-input {
                        flex: 1;
                    }

                    .item-remove {
                        width: 24px;

                        button {
                            display: var(--remove-display);
                            width: 24px;
                            height: 24px;
                            margin: 0;
                            padding: 0;
                            border: 0;
                            background-color: var(--color-general-red);
                            mask: url('/assets/svg/misc/trash-8Tx0ZZr.svg') no-repeat center center / contain;
                        }
                    }
                }

                .component-field-error-message {
                    margin: 12px 0;
                }
            }
        }

        .add-item {
            a {
                --color: var(--color-general-purple);

                display: inline-flex;
                align-items: center;
                justify-content: start;
                gap: 6px;
                font-size: 16px;
                line-height: 1;
                font-weight: 600;
                text-decoration: none;
                transition: color 0.2s linear;
                color: var(--color);
                font-family: 'IBM Plex Sans', sans-serif;

                &:hover {
                    --color: var(--color-btm-orange);
                }

                &:before {
                    content: '';
                    display: inline-block;
                    width: 14px;
                    height: 14px;
                    transition: color 0.2s linear;
                    background-color: var(--color);
                    mask: url('/assets/svg/sign-plus-P5HkcT8.svg') no-repeat center center / contain;
                }
            }
        }
    }

    .component-toggle-switch-group {
        display: flex;
        flex-direction: row;
        align-items: start;
        justify-content: start;
        gap: 16px;
        user-select: none;

        .toggle-label {
            font-size: 18px;
            line-height: 1.325;
            font-weight: 400;
            color: rgb(from var(--color-btm-dark-grey) r g b / 0.75);
            cursor: pointer;

            a {
                font-size: 18px;
                line-height: 1.325;
                font-weight: 500;
                color: var(--color-general-purple);
                text-decoration: none;
                transition: all 0.3s linear;

                &:hover {
                    color: var(--color-btm-orange);
                }
            }
        }
    }

    .component-toggle-switch {
        position: relative;
        display: inline-block;
        width: 48px;
        height: 26px;
        flex-shrink: 0;

        input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #e2e8f0;
            border-radius: 26px;
            transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);

            &:before {
                position: absolute;
                content: '';
                height: 20px;
                width: 20px;
                left: 3px;
                bottom: 3px;
                background-color: #ffffff;
                border-radius: 50%;
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
                transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            }
        }

        input:checked + .toggle-slider {
            background-color: #6b21a8;
        }

        input:checked + .toggle-slider::before {
            transform: translateX(22px);
        }

        input:focus-visible + .toggle-slider {
            box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.2);
        }
    }
}

@keyframes animation-component-form-loading-button {
    to { transform: rotate(360deg); }
}
